diff options
| author | Lubos Lunak <l.lunak@centrum.cz> | 2014-05-01 21:11:57 +0000 |
|---|---|---|
| committer | Lubos Lunak <l.lunak@centrum.cz> | 2014-05-01 21:11:57 +0000 |
| commit | 4526b46ee694b272c7b2cc949d8270a4e12471b1 (patch) | |
| tree | 20f8c2b331881c8aa1ffaa63516801085cd91889 /clang/lib/Rewrite/Frontend | |
| parent | 72cad68b302d113d739566112c960e6ff60d1b96 (diff) | |
| download | bcm5719-llvm-4526b46ee694b272c7b2cc949d8270a4e12471b1.tar.gz bcm5719-llvm-4526b46ee694b272c7b2cc949d8270a4e12471b1.zip | |
write a line marker right before adding included file
Enclosing the original #include directive inside #if 0 adds lines,
so warning/errors messages would have the line number off in
"In file included from <file>:<line>:", so add line marker to fix this.
llvm-svn: 207795
Diffstat (limited to 'clang/lib/Rewrite/Frontend')
| -rw-r--r-- | clang/lib/Rewrite/Frontend/InclusionRewriter.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp b/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp index d6a434d80ad..7700096a9af 100644 --- a/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp +++ b/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp @@ -390,6 +390,8 @@ bool InclusionRewriter::Process(FileID FileId, case tok::pp_import: { CommentOutDirective(RawLex, HashToken, FromFile, EOL, NextToWrite, Line); + if (FileId != PP.getPredefinesFileID()) + WriteLineInfo(FileName, Line - 1, FileType, EOL, ""); StringRef LineInfoExtra; if (const FileChange *Change = FindFileChangeLocation( HashToken.getLocation())) { |

