forked from OSchip/llvm-project
parent
845ca8fba9
commit
53dd644c5d
|
@ -73,12 +73,14 @@ TemporaryFiles::~TemporaryFiles() {
|
||||||
void TemporaryFiles::addFile(StringRef File) {
|
void TemporaryFiles::addFile(StringRef File) {
|
||||||
llvm::MutexGuard Guard(Mutex);
|
llvm::MutexGuard Guard(Mutex);
|
||||||
auto IsInserted = Files.insert(File).second;
|
auto IsInserted = Files.insert(File).second;
|
||||||
|
(void)IsInserted;
|
||||||
assert(IsInserted && "File has already been added");
|
assert(IsInserted && "File has already been added");
|
||||||
}
|
}
|
||||||
|
|
||||||
void TemporaryFiles::removeFile(StringRef File) {
|
void TemporaryFiles::removeFile(StringRef File) {
|
||||||
llvm::MutexGuard Guard(Mutex);
|
llvm::MutexGuard Guard(Mutex);
|
||||||
auto WasPresent = Files.erase(File);
|
auto WasPresent = Files.erase(File);
|
||||||
|
(void)WasPresent;
|
||||||
assert(WasPresent && "File was not tracked");
|
assert(WasPresent && "File was not tracked");
|
||||||
llvm::sys::fs::remove(File);
|
llvm::sys::fs::remove(File);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue