From 11ef0b7778e5a8d18f75b4969acbcd8b86b0cbc4 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 22 Mar 2013 21:26:48 +0000 Subject: [PATCH] Only rebuild the global module cache when we're allowed to. This eliminates excessive rebuilds of the global module cache. llvm-svn: 177766 --- clang/lib/Frontend/CompilerInstance.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 633f3c58689d..f83c8704f677 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -62,7 +62,8 @@ void CompilerInstance::setInvocation(CompilerInvocation *Value) { bool CompilerInstance::shouldBuildGlobalModuleIndex() const { return (BuildGlobalModuleIndex || - (ModuleManager && ModuleManager->isGlobalIndexUnavailable())) && + (ModuleManager && ModuleManager->isGlobalIndexUnavailable() && + getFrontendOpts().GenerateGlobalModuleIndex)) && !ModuleBuildFailed; }