From: Douglas Gregor Date: Thu, 15 Sep 2011 20:53:28 +0000 (+0000) Subject: Comment what's going on when we compile a module X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2d39c217b2cfe87cbe69f25df83869940d8adcd;p=clang 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 --- 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 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;