[PATCH] D36642: [Lexer] Report more precise skipped regions (PR34166)

2017-09-11 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL312947: [Lexer] Report more precise skipped regions (PR34166) (authored by vedantk). Changed prior to commit: https://reviews.llvm.org/D36642?vs=114433&id=114676#toc Repository: rL LLVM https://revi

[PATCH] D36642: [Lexer] Report more precise skipped regions (PR34166)

2017-09-11 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman accepted this revision. arphaman added a comment. This revision is now accepted and ready to land. Thanks, LGTM https://reviews.llvm.org/D36642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/li

[PATCH] D36642: [Lexer] Report more precise skipped regions (PR34166)

2017-09-08 Thread Vedant Kumar via Phabricator via cfe-commits
vsk updated this revision to Diff 114433. vsk added a comment. Herald added subscribers: kbarton, nemanjai. - Add an 'EndifLoc' parameter to the SourceRangeSkipped callback so that indexing clients can preserve their existing behavior. - I'll submit a follow-up patch which updates the pp-trace te

[PATCH] D36642: [Lexer] Report more precise skipped regions (PR34166)

2017-09-08 Thread Vedant Kumar via Phabricator via cfe-commits
vsk added inline comments. Comment at: test/Index/skipped-ranges.c:23 // RUN: env CINDEXTEST_SHOW_SKIPPED_RANGES=1 c-index-test -test-annotate-tokens=%s:1:1:16:1 %s | FileCheck %s -// CHECK: Skipping: [5:2 - 6:7] -// CHECK: Skipping: [8:2 - 12:7] -// CHECK: Skipping: [14:2 - 20

[PATCH] D36642: [Lexer] Report more precise skipped regions (PR34166)

2017-08-23 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/Lex/PPDirectives.cpp:564 + if (Callbacks) +Callbacks->SourceRangeSkipped( +SourceRange(HashToken.getLocation(), CurPPLexer->getSourceLocation())); You'd have to update the pp-tests in clang-tools-extra

[PATCH] D36642: [Lexer] Report more precise skipped regions (PR34166)

2017-08-23 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: test/Index/skipped-ranges.c:23 // RUN: env CINDEXTEST_SHOW_SKIPPED_RANGES=1 c-index-test -test-annotate-tokens=%s:1:1:16:1 %s | FileCheck %s -// CHECK: Skipping: [5:2 - 6:7] -// CHECK: Skipping: [8:2 - 12:7] -// CHECK: Skipping: [14:2

[PATCH] D36642: [Lexer] Report more precise skipped regions (PR34166)

2017-08-23 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. I'd like to see someone more familiar with indexing comment on the effect there; otherwise LGTM. https://reviews.llvm.org/D36642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

[PATCH] D36642: [Lexer] Report more precise skipped regions (PR34166)

2017-08-17 Thread Vedant Kumar via Phabricator via cfe-commits
vsk added inline comments. Comment at: lib/Lex/PPDirectives.cpp:570 + // We'll warn about reaching the end of file later. + if (C == '\0' || C == '\r' || C == '\n') +break; efriedma wrote: > This doesn't really handle backslash-escaped newlines

[PATCH] D36642: [Lexer] Report more precise skipped regions (PR34166)

2017-08-17 Thread Vedant Kumar via Phabricator via cfe-commits
vsk updated this revision to Diff 111596. vsk marked an inline comment as done. vsk added a comment. - Address Eli's comment. https://reviews.llvm.org/D36642 Files: include/clang/Lex/Preprocessor.h lib/Lex/PPDirectives.cpp test/CoverageMapping/preprocessor.c test/Index/skipped-ranges.c

[PATCH] D36642: [Lexer] Report more precise skipped regions (PR34166)

2017-08-15 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added inline comments. Comment at: lib/Lex/PPDirectives.cpp:570 + // We'll warn about reaching the end of file later. + if (C == '\0' || C == '\r' || C == '\n') +break; This doesn't really handle backslash-escaped newlines correctly. (

[PATCH] D36642: [Lexer] Report more precise skipped regions (PR34166)

2017-08-14 Thread Vedant Kumar via Phabricator via cfe-commits
vsk updated this revision to Diff 13. vsk added a comment. Thanks for the review. I've updated the patch so that we do better with "#\" directives. https://reviews.llvm.org/D36642 Files: include/clang/Lex/Preprocessor.h lib/Lex/PPDirectives.cpp test/CoverageMapping/preprocessor.c t

[PATCH] D36642: [Lexer] Report more precise skipped regions (PR34166)

2017-08-14 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. I'm not sure this produces the right locations in general. Consider the following slightly evil testcase: #\ if 0 #elif \ 11\ int a; #endif https://reviews.llvm.org/D36642 ___ cfe-commits mailing list cf

[PATCH] D36642: [Lexer] Report more precise skipped regions (PR34166)

2017-08-11 Thread Vedant Kumar via Phabricator via cfe-commits
vsk created this revision. This patch teaches the preprocessor to report more precise source ranges for code that is skipped due to conditional directives. The new behavior includes the '#' from the opening directive and the full text of the line containing the closing directive in the skipped