aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-09-15 20:53:28 +0000
committerDouglas Gregor <dgregor@apple.com>2011-09-15 20:53:28 +0000
commitb2d39c217b2cfe87cbe69f25df83869940d8adcd (patch)
treec43516b23189ae3f81099536cd8b21f432f54fff /lib/Frontend/CompilerInstance.cpp
parent412a49641c9365662b34331d36bf072bc3a228ea (diff)
Comment what's going on when we compile a module
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139837 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInstance.cpp')
-rw-r--r--lib/Frontend/CompilerInstance.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index e3689c0c52..c56cc3d9db 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/lib/Frontend/CompilerInstance.cpp
@@ -658,10 +658,18 @@ static void compileModule(CompilerInstance &ImportingInstance,
// Construct a compiler invocation for creating this module.
llvm::IntrusiveRefCntPtr<CompilerInvocation> Invocation
(new CompilerInvocation(ImportingInstance.getInvocation()));
+
+ // For any options that aren't intended to affect how a module is built,
+ // reset them to their default values.
Invocation->getLangOpts().resetNonModularOptions();
Invocation->getPreprocessorOpts().resetNonModularOptions();
+
+ // Note that this module is part of the module build path, so that we
+ // can detect cycles in the module graph.
Invocation->getPreprocessorOpts().ModuleBuildPath.push_back(ModuleName);
+ // Set up the inputs/outputs so that we build the module from its umbrella
+ // header.
FrontendOptions &FrontendOpts = Invocation->getFrontendOpts();
FrontendOpts.OutputFile = ModuleFileName.str();
FrontendOpts.DisableFree = false;