diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-17 15:30:15 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-17 15:30:15 +0000 |
commit | e39b600582f9183e3301c3e6cb48b76ac5087119 (patch) | |
tree | d54416dc55d18283366cfd3b68340a1938760819 /lib/Basic/SourceManager.cpp | |
parent | 69247139f5ce3edf46c48344129792b3a05d090a (diff) |
Use a simple diagnostic (file modified) when we detect that a file has
changed, rather than trying to point out how it changed. The "why"
doesn't matter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98725 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/SourceManager.cpp')
-rw-r--r-- | lib/Basic/SourceManager.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp index be7c256b5b..440e688cd7 100644 --- a/lib/Basic/SourceManager.cpp +++ b/lib/Basic/SourceManager.cpp @@ -92,18 +92,12 @@ const llvm::MemoryBuffer *ContentCache::getBuffer(Diagnostic &Diag, Diag.Report(diag::err_cannot_open_file) << Entry->getName() << ErrorStr; Buffer.setInt(true); - } else { + } 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). - if (FileInfo.st_size != Entry->getSize()) { - Diag.Report(diag::err_file_size_changed) - << Entry->getName() << (unsigned)Entry->getSize() - << (unsigned)FileInfo.st_size; - Buffer.setInt(true); - } else if (FileInfo.st_mtime != Entry->getModificationTime()) { - Diag.Report(diag::err_file_modified) << Entry->getName(); - Buffer.setInt(true); - } + Diag.Report(diag::err_file_modified) << Entry->getName(); + Buffer.setInt(true); } } |