[cfe-commits] r98726 - /cfe/trunk/lib/Basic/SourceManager.cpp

Douglas Gregor dgregor at apple.com
Wed Mar 17 08:33:06 PDT 2010


Author: dgregor
Date: Wed Mar 17 10:33:06 2010
New Revision: 98726

URL: http://llvm.org/viewvc/llvm-project?rev=98726&view=rev
Log:
Check the inode in addition to size and modification time to determine
whether a file has changed since it was originally read.

Modified:
    cfe/trunk/lib/Basic/SourceManager.cpp

Modified: cfe/trunk/lib/Basic/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceManager.cpp?rev=98726&r1=98725&r2=98726&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/SourceManager.cpp (original)
+++ cfe/trunk/lib/Basic/SourceManager.cpp Wed Mar 17 10:33:06 2010
@@ -93,9 +93,11 @@
         << Entry->getName() << ErrorStr;
       Buffer.setInt(true);
     } else if (FileInfo.st_size != Entry->getSize() ||
-               FileInfo.st_mtime != Entry->getModificationTime()) {
-      // Check that the file's size and modification time is the same as 
-      // in the file entry (which may have come from a stat cache).
+               FileInfo.st_mtime != Entry->getModificationTime() ||
+               FileInfo.st_ino != Entry->getInode()) {
+      // 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).
       Diag.Report(diag::err_file_modified) << Entry->getName();
       Buffer.setInt(true);
     }





More information about the cfe-commits mailing list