r209143 - Don't refresh stat() info for pcm files

Ben Langmuir blangmuir at apple.com
Mon May 19 10:04:29 PDT 2014


Author: benlangmuir
Date: Mon May 19 12:04:28 2014
New Revision: 209143

URL: http://llvm.org/viewvc/llvm-project?rev=209143&view=rev
Log:
Don't refresh stat() info for pcm files

Follow-up fix for 209138.  Actually, since we already have this file
open, we don't want to refresh the stat() info, since that might be
newer than what we have open (bad!).

Modified:
    cfe/trunk/lib/Serialization/ModuleManager.cpp

Modified: cfe/trunk/lib/Serialization/ModuleManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ModuleManager.cpp?rev=209143&r1=209142&r2=209143&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ModuleManager.cpp (original)
+++ cfe/trunk/lib/Serialization/ModuleManager.cpp Mon May 19 12:04:28 2014
@@ -152,19 +152,7 @@ void ModuleManager::removeModules(Module
 
   // Delete the modules and erase them from the various structures.
   for (ModuleIterator victim = first; victim != last; ++victim) {
-    const FileEntry *F = (*victim)->File;
-    Modules.erase(F);
-
-    // Refresh the stat() information for the module file so stale information
-    // doesn't get stored accidentally.
-    vfs::Status UpdatedStat;
-    if (FileMgr.getNoncachedStatValue(F->getName(), UpdatedStat)) {
-      llvm::report_fatal_error(Twine("module file '") + F->getName() +
-                               "' removed after it has been used");
-    } else {
-      FileMgr.modifyFileEntry(const_cast<FileEntry *>(F), UpdatedStat.getSize(),
-          UpdatedStat.getLastModificationTime().toEpochTime());
-    }
+    Modules.erase((*victim)->File);
 
     if (modMap) {
       StringRef ModuleName = (*victim)->ModuleName;





More information about the cfe-commits mailing list