aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-09 15:54:22 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-09 15:54:22 +0000
commit9f692a0308975cf24ef117c05e31284a1a944e86 (patch)
tree547319d1034210f01bab3ad0fb595e444ad5934d /lib/Basic/SourceManager.cpp
parent4ecb25fa94897b2c03510292acace710e5262ba5 (diff)
On Windows, disable the modification-time check for files used in
precompiled headers and/or when reading the contents of the file into memory. These checks seem to be causing spurious regression-test failures on Windows. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100866 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/SourceManager.cpp')
-rw-r--r--lib/Basic/SourceManager.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp
index 27cb9bebde..27a859c9d7 100644
--- a/lib/Basic/SourceManager.cpp
+++ b/lib/Basic/SourceManager.cpp
@@ -98,11 +98,17 @@ const llvm::MemoryBuffer *ContentCache::getBuffer(Diagnostic &Diag,
<< Entry->getName() << ErrorStr;
Buffer.setInt(true);
- } else if (FileInfo.st_size != Entry->getSize() ||
- FileInfo.st_mtime != Entry->getModificationTime()) {
- // Check that the file's size, modification time, and inode are
- // the same as in the file entry (which may have come from a
- // stat cache).
+ } else if (FileInfo.st_size != Entry->getSize()
+#if !defined(LLVM_ON_WIN32)
+ // In our regression testing, the Windows file system
+ // seems to have inconsistent modification times that
+ // sometimes erroneously trigger this error-handling
+ // path.
+ || FileInfo.st_mtime != Entry->getModificationTime()
+#endif
+ ) {
+ // Check that the file's size and modification time are the same
+ // as in the file entry (which may have come from a stat cache).
if (Diag.isDiagnosticInFlight())
Diag.SetDelayedDiagnostic(diag::err_file_modified,
Entry->getName());