[cfe-commits] r38663 - /cfe/cfe/trunk/Driver/PrintPreprocessedOutput.cpp

sabre at cs.uiuc.edu sabre at cs.uiuc.edu
Wed Jul 11 09:23:37 PDT 2007


Author: sabre
Date: Wed Jul 11 11:23:37 2007
New Revision: 38663

URL: http://llvm.org/viewvc/llvm-project?rev=38663&view=rev
Log:
Match GCC behavior better in -P mode.

Modified:
    cfe/cfe/trunk/Driver/PrintPreprocessedOutput.cpp

Modified: cfe/cfe/trunk/Driver/PrintPreprocessedOutput.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/PrintPreprocessedOutput.cpp?rev=38663&r1=38662&r2=38663&view=diff

==============================================================================
--- cfe/cfe/trunk/Driver/PrintPreprocessedOutput.cpp (original)
+++ cfe/cfe/trunk/Driver/PrintPreprocessedOutput.cpp Wed Jul 11 11:23:37 2007
@@ -36,7 +36,6 @@
   // otherwise print a #line directive.
   if (LineNo-EModeCurLine < 8) {
     unsigned CurLine = EModeCurLine;
-    //static const char Newlines[] = "\n\n\n\n\n\n\n\n";
     for (; CurLine != LineNo; ++CurLine)
       putchar_unlocked('\n');
     EModeCurLine = CurLine;
@@ -66,6 +65,13 @@
                              DirectoryLookup::DirType FileType) {
   SourceManager &SourceMgr = EModePP->getSourceManager();
   
+  if (DisableLineMarkers) {
+    EModeCurLine = SourceMgr.getLineNumber(Loc);
+    EModeCurFilename = Lexer::Stringify(SourceMgr.getSourceName(Loc));
+    EmodeFileType = FileType;
+    return;
+  }
+
   // Unless we are exiting a #include, make sure to skip ahead to the line the
   // #include directive was at.
   if (Reason == Preprocessor::EnterFile) {





More information about the cfe-commits mailing list