Skip to content

Commit f4d599c

Browse files
authored
[Support] Do not remove lock file on failure (#130834)
Clients of `LockFileManager` call `unsafeRemoveLockFile()` whenever `tryLock()` fails. However looking at the code, there are no scenarios where this actually does something useful. This PR removes such calls.
1 parent 2620742 commit f4d599c

File tree

2 files changed

+0
-3
lines changed

2 files changed

+0
-3
lines changed

clang/lib/Frontend/CompilerInstance.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,8 +1491,6 @@ static bool compileModuleAndReadASTBehindLock(
14911491
// related errors.
14921492
Diags.Report(ModuleNameLoc, diag::remark_module_lock_failure)
14931493
<< Module->Name << toString(std::move(Err));
1494-
// Clear out any potential leftover.
1495-
Lock.unsafeRemoveLockFile();
14961494
return compileModuleAndReadASTImpl(ImportingInstance, ImportLoc,
14971495
ModuleNameLoc, Module, ModuleFileName);
14981496
}

llvm/lib/Target/AMDGPU/AMDGPUSplitModule.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,6 @@ PreservedAnalyses AMDGPUSplitModulePass::run(Module &M,
15521552
LLVM_DEBUG(
15531553
dbgs() << "[amdgpu-split-module] unable to acquire lockfile, debug "
15541554
"output may be mangled by other processes\n");
1555-
Lock.unsafeRemoveLockFile();
15561555
} else if (!Owned) {
15571556
switch (Lock.waitForUnlock()) {
15581557
case LockFileManager::Res_Success:

0 commit comments

Comments
 (0)