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
diff --git a/lib/Frontend/PrintPreprocessedOutput.cpp b/lib/Frontend/PrintPreprocessedOutput.cpp
index 3742405..ff8dfcd 100644
--- a/lib/Frontend/PrintPreprocessedOutput.cpp
+++ b/lib/Frontend/PrintPreprocessedOutput.cpp
@@ -141,17 +141,23 @@
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';
}