[cfe-commits] r100866 - in /cfe/trunk/lib: Basic/SourceManager.cpp Frontend/PCHReader.cpp
Douglas Gregor
dgregor at apple.com
Fri Apr 9 08:54:22 PDT 2010
Author: dgregor
Date: Fri Apr 9 10:54:22 2010
New Revision: 100866
URL: http://llvm.org/viewvc/llvm-project?rev=100866&view=rev
Log:
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.
Modified:
cfe/trunk/lib/Basic/SourceManager.cpp
cfe/trunk/lib/Frontend/PCHReader.cpp
Modified: cfe/trunk/lib/Basic/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceManager.cpp?rev=100866&r1=100865&r2=100866&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/SourceManager.cpp (original)
+++ cfe/trunk/lib/Basic/SourceManager.cpp Fri Apr 9 10:54:22 2010
@@ -98,11 +98,17 @@
<< 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());
Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=100866&r1=100865&r2=100866&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Fri Apr 9 10:54:22 2010
@@ -910,8 +910,14 @@
return Failure;
}
- if ((off_t)Record[4] != File->getSize() ||
- (time_t)Record[5] != File->getModificationTime()) {
+ if ((off_t)Record[4] != File->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.
+ || (time_t)Record[5] != File->getModificationTime()
+#endif
+ ) {
Diag(diag::err_fe_pch_file_modified)
<< Filename;
return Failure;
More information about the cfe-commits
mailing list