diff options
author | Lubos Lunak <l.lunak@centrum.cz> | 2014-05-01 21:10:08 +0000 |
---|---|---|
committer | Lubos Lunak <l.lunak@centrum.cz> | 2014-05-01 21:10:08 +0000 |
commit | 72cad68b302d113d739566112c960e6ff60d1b96 (patch) | |
tree | 78496d41f98560fe142c4f3a2eef4a61730b4f76 /clang/lib/Rewrite/Frontend | |
parent | bf8a9ac768ec0bcf72a5e425954ad033e10a45eb (diff) | |
download | bcm5719-llvm-72cad68b302d113d739566112c960e6ff60d1b96.tar.gz bcm5719-llvm-72cad68b302d113d739566112c960e6ff60d1b96.zip |
do not use "1" for line marker for the predefines "file" either
Similar to r207764.
llvm-svn: 207794
Diffstat (limited to 'clang/lib/Rewrite/Frontend')
-rw-r--r-- | clang/lib/Rewrite/Frontend/InclusionRewriter.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp b/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp index ad8328e7ca1..d6a434d80ad 100644 --- a/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp +++ b/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp @@ -250,6 +250,10 @@ void InclusionRewriter::CommentOutDirective(Lexer &DirectiveLex, do { DirectiveLex.LexFromRawLexer(DirectiveToken); } while (!DirectiveToken.is(tok::eod) && DirectiveToken.isNot(tok::eof)); + if (&FromFile == PredefinesBuffer) { + // OutputContentUpTo() would not output anything anyway. + return; + } OS << "#if 0 /* expanded by -frewrite-includes */" << EOL; OutputContentUpTo(FromFile, NextToWrite, SM.getFileOffset(DirectiveToken.getLocation()) + DirectiveToken.getLength(), @@ -353,7 +357,7 @@ bool InclusionRewriter::Process(FileID FileId, StringRef EOL = DetectEOL(FromFile); // Per the GNU docs: "1" indicates entering a new file. - if (FileId == SM.getMainFileID()) + if (FileId == SM.getMainFileID() || FileId == PP.getPredefinesFileID()) WriteLineInfo(FileName, 1, FileType, EOL, ""); else WriteLineInfo(FileName, 1, FileType, EOL, " 1"); |