]> granicus.if.org Git - clang/commitdiff
Comment what's going on when we compile a module
authorDouglas Gregor <dgregor@apple.com>
Thu, 15 Sep 2011 20:53:28 +0000 (20:53 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 15 Sep 2011 20:53:28 +0000 (20:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139837 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/CompilerInstance.cpp

index e3689c0c52a77d50fb51efc93162efec4f0314f3..c56cc3d9db46417d1bb3e13de7d5ce34c0e139db 100644 (file)
@@ -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;