From 6eec06d0d4fa2e108546b422619c6cb32f234e6e Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Thu, 3 May 2012 21:50:39 +0000 Subject: [PCH] When validating that the files coming from PCH did not change, also validate that we didn't override the contents of any of such files. If this is detected, emit a diagnostic error and recover gracefully by using the contents of the original file that the PCH was built from. Part of rdar://11305263 llvm-svn: 156107 --- clang/lib/Basic/FileManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/lib/Basic/FileManager.cpp') diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp index fd6d33463a2..669bf7d4c78 100644 --- a/clang/lib/Basic/FileManager.cpp +++ b/clang/lib/Basic/FileManager.cpp @@ -584,6 +584,12 @@ void FileManager::GetUniqueIDMapping( UIDToFiles[(*VFE)->getUID()] = *VFE; } +void FileManager::modifyFileEntry(FileEntry *File, + off_t Size, time_t ModificationTime) { + File->Size = Size; + File->ModTime = ModificationTime; +} + void FileManager::PrintStats() const { llvm::errs() << "\n*** File Manager Stats:\n"; -- cgit v1.2.3