]> granicus.if.org Git - clang/commitdiff
<rdar://problem/13479539> Only rebuild the global module cache when we're allowed to.
authorDouglas Gregor <dgregor@apple.com>
Fri, 22 Mar 2013 21:26:48 +0000 (21:26 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 22 Mar 2013 21:26:48 +0000 (21:26 +0000)
This eliminates excessive rebuilds of the global module cache.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177766 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/CompilerInstance.cpp

index 633f3c58689d8abc0880add60aa3bc2042943781..f83c8704f67705aa2918dd1568225bf66fee6449 100644 (file)
@@ -62,7 +62,8 @@ void CompilerInstance::setInvocation(CompilerInvocation *Value) {
 
 bool CompilerInstance::shouldBuildGlobalModuleIndex() const {
   return (BuildGlobalModuleIndex ||
-          (ModuleManager && ModuleManager->isGlobalIndexUnavailable())) &&
+          (ModuleManager && ModuleManager->isGlobalIndexUnavailable() &&
+           getFrontendOpts().GenerateGlobalModuleIndex)) &&
          !ModuleBuildFailed;
 }