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 | 957f4a25f60ecf6404aa2df3dd1d24ff0519616f (patch) | |
tree | 870117ef998670e81c8841831f1c4d642db1a71b /lib/Rewrite | |
parent | 13c23baeccef48fa15a9af01c1958580682a82da (diff) | |
download | clang-957f4a25f60ecf6404aa2df3dd1d24ff0519616f.tar.gz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207795 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite')
-rw-r--r-- | lib/Rewrite/Frontend/InclusionRewriter.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Rewrite/Frontend/InclusionRewriter.cpp b/lib/Rewrite/Frontend/InclusionRewriter.cpp index d6a434d80a..7700096a9a 100644 --- a/lib/Rewrite/Frontend/InclusionRewriter.cpp +++ b/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())) { |