]> granicus.if.org Git - clang/commitdiff
Move two Darwin-specific hacks into #ifdef __APPLE__. These were stat'ing
authorRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 20 May 2013 23:17:08 +0000 (23:17 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 20 May 2013 23:17:08 +0000 (23:17 +0000)
nonexistent Darwin-specific files on every module build.

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

lib/Frontend/CompilerInvocation.cpp
lib/Serialization/ASTWriter.cpp

index 6af36630019a25839d3b838ef910bb0c30d4eda8..3d82d7a3a6073ab72ab9f5e0db2deddf842cb36b 100644 (file)
@@ -1690,6 +1690,7 @@ std::string CompilerInvocation::getModuleHash() const {
                       hsOpts.UseStandardCXXIncludes,
                       hsOpts.UseLibcxx);
 
+#ifdef __APPLE__
   // Darwin-specific hack: if we have a sysroot, use the contents and
   // modification time of
   //   $sysroot/System/Library/CoreServices/SystemVersion.plist
@@ -1710,6 +1711,7 @@ std::string CompilerInvocation::getModuleHash() const {
         code = hash_combine(code, statBuf.st_mtime);
     }
   }
+#endif
 
   return llvm::APInt(64, code).toString(36, /*Signed=*/false);
 }
index ba6243a51af2b89983f598a6b4879fb8570c9808..43d3910acb32cd2a1414acc41a0e89f4f63e7252 100644 (file)
@@ -1279,11 +1279,13 @@ void ASTWriter::WriteInputFiles(SourceManager &SourceMgr,
       SortedFiles.push_front(Entry);
   }
 
+  FileManager &FileMgr = SourceMgr.getFileManager();
+
+#ifdef __APPLE__
   // If we have an isysroot for a Darwin SDK, include its SDKSettings.plist in
   // the set of (non-system) input files. This is simple heuristic for
   // detecting whether the system headers may have changed, because it is too
   // expensive to stat() all of the system headers.
-  FileManager &FileMgr = SourceMgr.getFileManager();
   if (!HSOpts.Sysroot.empty() && !Chain) {
     llvm::SmallString<128> SDKSettingsFileName(HSOpts.Sysroot);
     llvm::sys::path::append(SDKSettingsFileName, "SDKSettings.plist");
@@ -1292,6 +1294,7 @@ void ASTWriter::WriteInputFiles(SourceManager &SourceMgr,
       SortedFiles.push_front(Entry);
     }
   }
+#endif
 
   unsigned UserFilesNum = 0;
   // Write out all of the input files.