summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-17 15:30:15 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-17 15:30:15 +0000
commit6597f5950650060aeea7969057587e6180dd8e71 (patch)
tree245780e2fa96cf641b2fe2c5e45c827c45d652b2 /clang/lib/Basic/SourceManager.cpp
parent2a4b080c5dd9c5c8698462a3ed460758f5dfb330 (diff)
downloadbcm5719-llvm-6597f5950650060aeea7969057587e6180dd8e71.tar.gz
bcm5719-llvm-6597f5950650060aeea7969057587e6180dd8e71.zip
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. llvm-svn: 98725
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r--clang/lib/Basic/SourceManager.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index be7c256b5b1..440e688cd73 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/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);
}
}
OpenPOWER on IntegriCloud