r209195 - Speculative fix for Windows buildbot after r209138
Ben Langmuir
blangmuir at apple.com
Mon May 19 22:55:04 PDT 2014
Author: benlangmuir
Date: Tue May 20 00:55:04 2014
New Revision: 209195
URL: http://llvm.org/viewvc/llvm-project?rev=209195&view=rev
Log:
Speculative fix for Windows buildbot after r209138
It appears that Windows doesn't like renaming over open files, which we
do in clearOutputFiles. The file being compiled should be safe to
removed, but this isn't very satisfying - we don't want to manually
manage the lifetime of files we cannot prove have no references.
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=209195&r1=209194&r2=209195&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ModuleManager.cpp (original)
+++ cfe/trunk/lib/Serialization/ModuleManager.cpp Tue May 20 00:55:04 2014
@@ -140,6 +140,11 @@ void ModuleManager::removeModules(Module
if (first == last)
return;
+ // The first file entry is about to be rebuilt (or there was an error), so
+ // there should be no references to it. Remove it from the cache to close it,
+ // as Windows doesn't seem to allow renaming over an open file.
+ FileMgr.invalidateCache((*first)->File);
+
// Collect the set of module file pointers that we'll be removing.
llvm::SmallPtrSet<ModuleFile *, 4> victimSet(first, last);
More information about the cfe-commits
mailing list