aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-09-13 20:44:41 +0000
committerDouglas Gregor <dgregor@apple.com>2011-09-13 20:44:41 +0000
commit1c7e0472f5683a8ade62285f366637050cf113e5 (patch)
tree5cce234698b9cc8c665aebdc1a29bea9843b652a /lib/Frontend/CompilerInstance.cpp
parent221d5a5005b3dbde50b8b0a40bb5c5e6da8c1173 (diff)
When building a module on-demand, clear out the "non-modular" language
and preprocessor options (such as macro definitions) first. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139638 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInstance.cpp')
-rw-r--r--lib/Frontend/CompilerInstance.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index f39b119c32..ece9cd8406 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/lib/Frontend/CompilerInstance.cpp
@@ -654,6 +654,9 @@ static void compileModule(CompilerInstance &ImportingInstance,
// Construct a compiler invocation for creating this module.
llvm::IntrusiveRefCntPtr<CompilerInvocation> Invocation
(new CompilerInvocation(ImportingInstance.getInvocation()));
+ Invocation->getLangOpts().resetNonModularOptions();
+ Invocation->getPreprocessorOpts().resetNonModularOptions();
+
FrontendOptions &FrontendOpts = Invocation->getFrontendOpts();
FrontendOpts.OutputFile = ModuleFile.str();
FrontendOpts.DisableFree = false;