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.

llvm-svn: 209195
This commit is contained in:
Ben Langmuir 2014-05-20 05:55:04 +00:00
parent 4a6f58380a
commit 5988590363
1 changed files with 5 additions and 0 deletions

View File

@ -140,6 +140,11 @@ void ModuleManager::removeModules(ModuleIterator first, ModuleIterator last,
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);