From c5f2bca86615322f0295f0cf448dfc350f6e7d1e Mon Sep 17 00:00:00 2001 From: Lubos Lunak Date: Thu, 1 May 2014 12:45:08 +0000 Subject: 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 ::", so add line marker to fix this. llvm-svn: 207756 --- clang/lib/Rewrite/Frontend/InclusionRewriter.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/Rewrite/Frontend/InclusionRewriter.cpp') diff --git a/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp b/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp index 058960d3e43..70b299213f3 100644 --- a/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp +++ b/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp @@ -383,6 +383,7 @@ bool InclusionRewriter::Process(FileID FileId, case tok::pp_import: { CommentOutDirective(RawLex, HashToken, FromFile, EOL, NextToWrite, Line); + WriteLineInfo(FileName, Line - 1, FileType, EOL, ""); StringRef LineInfoExtra; if (const FileChange *Change = FindFileChangeLocation( HashToken.getLocation())) { -- cgit v1.2.3