summaryrefslogtreecommitdiffstats
path: root/clang/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
commit4526b46ee694b272c7b2cc949d8270a4e12471b1 (patch)
tree20f8c2b331881c8aa1ffaa63516801085cd91889 /clang/lib/Rewrite
parent72cad68b302d113d739566112c960e6ff60d1b96 (diff)
downloadbcm5719-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')
-rw-r--r--clang/lib/Rewrite/Frontend/InclusionRewriter.cpp2
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())) {
OpenPOWER on IntegriCloud