summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 9cc83ef2193..746eba9cf2b 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -417,13 +417,17 @@ bool InitializePreprocessor(Preprocessor &PP,
const PreprocessorInitOptions& InitOpts) {
std::vector<char> PredefineBuffer;
+ const char *LineDirective = "# 1 \"<built-in>\" 3\n";
+ PredefineBuffer.insert(PredefineBuffer.end(),
+ LineDirective, LineDirective+strlen(LineDirective));
+
// Install things like __POWERPC__, __GNUC__, etc into the macro table.
InitializePredefinedMacros(PP.getTargetInfo(), PP.getLangOptions(),
PredefineBuffer);
// Add on the predefines from the driver. Wrap in a #line directive to report
// that they come from the command line.
- const char *LineDirective = "# 1 \"<command line>\" 1\n";
+ LineDirective = "# 1 \"<command line>\" 1\n";
PredefineBuffer.insert(PredefineBuffer.end(),
LineDirective, LineDirective+strlen(LineDirective));
@@ -451,7 +455,7 @@ bool InitializePreprocessor(Preprocessor &PP,
AddImplicitInclude(PredefineBuffer, I->first);
}
- LineDirective = "# 2 \"<built-in>\" 2\n";
+ LineDirective = "# 2 \"<built-in>\" 2 3\n";
PredefineBuffer.insert(PredefineBuffer.end(),
LineDirective, LineDirective+strlen(LineDirective));
OpenPOWER on IntegriCloud