<rdar://problem/13479539> Only rebuild the global module cache when we're allowed to.

This eliminates excessive rebuilds of the global module cache.

llvm-svn: 177766
This commit is contained in:
Douglas Gregor 2013-03-22 21:26:48 +00:00
parent 25fac2f6dc
commit 11ef0b7778
1 changed files with 2 additions and 1 deletions

View 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;
}