Move two Darwin-specific hacks into #ifdef __APPLE__. These were stat'ing
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
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp
index ba6243a..43d3910 100644
--- a/lib/Serialization/ASTWriter.cpp
+++ b/lib/Serialization/ASTWriter.cpp
@@ -1279,11 +1279,13 @@
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 @@
SortedFiles.push_front(Entry);
}
}
+#endif
unsigned UserFilesNum = 0;
// Write out all of the input files.