summaryrefslogtreecommitdiff
path: root/lib/Rewrite
diff options
context:
space:
mode:
authorLubos Lunak <l.lunak@centrum.cz>2014-05-01 21:11:57 +0000
committerLubos Lunak <l.lunak@centrum.cz>2014-05-01 21:11:57 +0000
commit957f4a25f60ecf6404aa2df3dd1d24ff0519616f (patch)
tree870117ef998670e81c8841831f1c4d642db1a71b /lib/Rewrite
parent13c23baeccef48fa15a9af01c1958580682a82da (diff)
downloadclang-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.cpp2
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())) {