A minor tweak to -E output, speeding up -E 1.5% on 447.dealII

llvm-svn: 40419
This commit is contained in:
Chris Lattner 2007-07-23 05:14:05 +00:00
parent 43eafb4ed5
commit 5f075827bf
1 changed files with 6 additions and 3 deletions

View 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');