diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-18 22:29:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-18 22:29:33 +0000 |
commit | bf78da7b3669385b204b7d7736c6dd2dd230a540 (patch) | |
tree | 5f38a93d7fb3fcba345155025c9faf03b82a8cec /clang/lib | |
parent | 93017cc12a15c742469a57a14f0665143fe440ff (diff) | |
download | bcm5719-llvm-bf78da7b3669385b204b7d7736c6dd2dd230a540.tar.gz bcm5719-llvm-bf78da7b3669385b204b7d7736c6dd2dd230a540.zip |
Fix PR3917: the location of a #line directive is the location of the first _.
llvm-svn: 69485
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Lex/PPMacroExpansion.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index 7e695a542b0..330e2a17aa3 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -485,6 +485,10 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { // be affected by #line. SourceLocation Loc = Tok.getLocation(); + // Advance to the location of the first _, this might not be the first byte + // of the token if it starts with an escaped newline. + Loc = AdvanceToTokenCharacter(Loc, 0); + // One wrinkle here is that GCC expands __LINE__ to location of the *end* of // a macro instantiation. This doesn't matter for object-like macros, but // can matter for a function-like macro that expands to contain __LINE__. |