diff options
| author | Douglas Gregor <dgregor@apple.com> | 2013-05-10 21:54:08 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2013-05-10 21:54:08 +0000 |
| commit | d8f681e135ebd536e25a60cdb23f4d531f1f993e (patch) | |
| tree | 9277bcfdd521f15dbd283aa91a53f5c88fc8f378 /lib/Frontend/CompilerInvocation.cpp | |
| parent | 9dfd24324c079b564dda936c6ae46898b82121e2 (diff) | |
| download | clang-d8f681e135ebd536e25a60cdb23f4d531f1f993e.tar.gz clang-d8f681e135ebd536e25a60cdb23f4d531f1f993e.tar.bz2 clang-d8f681e135ebd536e25a60cdb23f4d531f1f993e.tar.xz | |
[Modules] Extend Darwin hack to include the modification time of SystemVersion.plist.
Fixes <rdar://problem/13856838>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181635 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
| -rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 9c8eea10ad..6af3663001 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -30,6 +30,7 @@ #include "llvm/Support/Host.h" #include "llvm/Support/Path.h" #include "llvm/Support/system_error.h" +#include <sys/stat.h> using namespace clang; //===----------------------------------------------------------------------===// @@ -1689,7 +1690,8 @@ std::string CompilerInvocation::getModuleHash() const { hsOpts.UseStandardCXXIncludes, hsOpts.UseLibcxx); - // Darwin-specific hack: if we have a sysroot, use the contents of + // Darwin-specific hack: if we have a sysroot, use the contents and + // modification time of // $sysroot/System/Library/CoreServices/SystemVersion.plist // as part of the module hash. if (!hsOpts.Sysroot.empty()) { @@ -1702,6 +1704,10 @@ std::string CompilerInvocation::getModuleHash() const { llvm::sys::path::append(systemVersionFile, "SystemVersion.plist"); if (!llvm::MemoryBuffer::getFile(systemVersionFile, buffer)) { code = hash_combine(code, buffer.get()->getBuffer()); + + struct stat statBuf; + if (stat(systemVersionFile.c_str(), &statBuf) == 0) + code = hash_combine(code, statBuf.st_mtime); } } |
