aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PrintPreprocessedOutput.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-12-06 01:02:14 +0000
committerSteve Naroff <snaroff@apple.com>2009-12-06 01:02:14 +0000
commitd76fbda5da19c34752aa582e690a4dbd1cae39cd (patch)
tree8eb3c307480b3406897135ee02835674b8f6f734 /lib/Frontend/PrintPreprocessedOutput.cpp
parent5794c9714a7d8c7eb8003d3e2616ab389ba9e45b (diff)
Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=71473 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90688 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PrintPreprocessedOutput.cpp')
-rw-r--r--lib/Frontend/PrintPreprocessedOutput.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/Frontend/PrintPreprocessedOutput.cpp b/lib/Frontend/PrintPreprocessedOutput.cpp
index 3742405780..ff8dfcd3c8 100644
--- a/lib/Frontend/PrintPreprocessedOutput.cpp
+++ b/lib/Frontend/PrintPreprocessedOutput.cpp
@@ -141,17 +141,23 @@ void PrintPPOutputPPCallbacks::WriteLineInfo(unsigned LineNo,
EmittedMacroOnThisLine = false;
}
- OS << '#' << ' ' << LineNo << ' ' << '"';
+ OS << '#';
+ if (PP.getLangOptions().Microsoft)
+ OS << "line";
+ OS << ' ' << LineNo << ' ' << '"';
+
OS.write(&CurFilename[0], CurFilename.size());
OS << '"';
- if (ExtraLen)
- OS.write(Extra, ExtraLen);
+ if (!PP.getLangOptions().Microsoft) {
+ if (ExtraLen)
+ OS.write(Extra, ExtraLen);
- if (FileType == SrcMgr::C_System)
- OS.write(" 3", 2);
- else if (FileType == SrcMgr::C_ExternCSystem)
- OS.write(" 3 4", 4);
+ if (FileType == SrcMgr::C_System)
+ OS.write(" 3", 2);
+ else if (FileType == SrcMgr::C_ExternCSystem)
+ OS.write(" 3 4", 4);
+ }
OS << '\n';
}