r233462 - [Modules] Don't compute a modules cache path if we're not using modules!

Chandler Carruth chandlerc at gmail.com
Fri Mar 27 18:10:44 PDT 2015


Author: chandlerc
Date: Fri Mar 27 20:10:44 2015
New Revision: 233462

URL: http://llvm.org/viewvc/llvm-project?rev=233462&view=rev
Log:
[Modules] Don't compute a modules cache path if we're not using modules!

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.

Modified:
    cfe/trunk/lib/Frontend/CompilerInstance.cpp

Modified: cfe/trunk/lib/Frontend/CompilerInstance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=233462&r1=233461&r2=233462&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInstance.cpp Fri Mar 27 20:10:44 2015
@@ -329,7 +329,8 @@ void CompilerInstance::createPreprocesso
 
   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();





More information about the cfe-commits mailing list