]> granicus.if.org Git - clang/commitdiff
[Modules] Don't compute a modules cache path if we're not using modules!
authorChandler Carruth <chandlerc@gmail.com>
Sat, 28 Mar 2015 01:10:44 +0000 (01:10 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 28 Mar 2015 01:10:44 +0000 (01:10 +0000)
Notably, this prevents us from doing *tons* of work to compute the
modules hash, including trying to read a darwin specific plist file off
of the system. There is a lot that needs cleaning up below this layer
too.

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

lib/Frontend/CompilerInstance.cpp

index 1c5b322230456e55c82f56398d19448f039e9f3b..3492bf184d3b1fe1759ef48ed64bf9139fe81387 100644 (file)
@@ -329,7 +329,8 @@ void CompilerInstance::createPreprocessor(TranslationUnitKind TUKind) {
 
   PP->setPreprocessedOutput(getPreprocessorOutputOpts().ShowCPP);
 
-  PP->getHeaderSearchInfo().setModuleCachePath(getSpecificModuleCachePath());
+  if (PP->getLangOpts().Modules)
+    PP->getHeaderSearchInfo().setModuleCachePath(getSpecificModuleCachePath());
 
   // Handle generating dependencies, if requested.
   const DependencyOutputOptions &DepOpts = getDependencyOutputOpts();