aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Frontend')
-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';
}