]> granicus.if.org Git - clang/commitdiff
A minor tweak to -E output, speeding up -E 1.5% on 447.dealII
authorChris Lattner <sabre@nondot.org>
Mon, 23 Jul 2007 05:14:05 +0000 (05:14 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 23 Jul 2007 05:14:05 +0000 (05:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40419 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/PrintPreprocessedOutput.cpp

index f857fd63b683b58e32586eed37e25be3bb789bee..706247877c5fbfc658e910eae8ec26536cf79089 100644 (file)
@@ -151,10 +151,13 @@ void PrintPPOutputPPCallbacks::MoveToLine(SourceLocation Loc) {
   // If this line is "close enough" to the original line, just print newlines,
   // otherwise print a #line directive.
   if (LineNo-CurLine < 8) {
-    unsigned Line = CurLine;
-    for (; Line != LineNo; ++Line)
+    if (LineNo-CurLine == 1)
       OutputChar('\n');
-    CurLine = Line;
+    else {
+      const char *NewLines = "\n\n\n\n\n\n\n\n";
+      OutputString(NewLines, LineNo-CurLine);
+      CurLine = LineNo;
+    }
   } else {
     if (EmittedTokensOnThisLine) {
       OutputChar('\n');