diff options
author | Chris Lattner <sabre@nondot.org> | 2009-11-03 19:50:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-11-03 19:50:27 +0000 |
commit | e9d7d78ab391dca1dbc05ab8876d58e8a7f6256c (patch) | |
tree | b65336652bc6c7c8e55eae21c8a70f25e5a6d4d9 /clang/lib/Frontend/InitPreprocessor.cpp | |
parent | 4f10559ba827755d7dd9bbf6b0a695fcebd928d2 (diff) | |
download | bcm5719-llvm-e9d7d78ab391dca1dbc05ab8876d58e8a7f6256c.tar.gz bcm5719-llvm-e9d7d78ab391dca1dbc05ab8876d58e8a7f6256c.zip |
Implement support for the -undef command line option, patch by
Roman Divacky! PR5363
llvm-svn: 85932
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r-- | clang/lib/Frontend/InitPreprocessor.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index 2719fbb456c..ec5c1061bb9 100644 --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/lib/Frontend/InitPreprocessor.cpp @@ -443,7 +443,8 @@ static void InitializePredefinedMacros(const TargetInfo &TI, /// environment ready to process a single file. This returns true on error. /// bool clang::InitializePreprocessor(Preprocessor &PP, - const PreprocessorInitOptions &InitOpts) { + const PreprocessorInitOptions &InitOpts, + bool undef_macros) { std::vector<char> PredefineBuffer; const char *LineDirective = "# 1 \"<built-in>\" 3\n"; @@ -451,8 +452,9 @@ bool clang::InitializePreprocessor(Preprocessor &PP, LineDirective, LineDirective+strlen(LineDirective)); // Install things like __POWERPC__, __GNUC__, etc into the macro table. - InitializePredefinedMacros(PP.getTargetInfo(), PP.getLangOptions(), - PredefineBuffer); + if (!undef_macros) + 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. |