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
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
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
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
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
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
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
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
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
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. (
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
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
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
13 matches
Mail list logo