Skip to content

Commit 16216da

Browse files
committed
Minor fixes
1 parent ef66b29 commit 16216da

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ bool ThreadSanitizer::sanitizeFunction(
661661

662662
///////////////////////////////////////////////////////////////////////////////
663663
// List of instructions (function calls) to delete
664-
SmallVector<CallInst*, 8> EnableDisableFuncToDelete;
664+
SmallVector<CallInst*, 8> EnableDisableFuncCleanupList;
665665

666666
// Counter for considering nesting __tsan_disable/__tsan_enable
667667
int disableEnableNesting = 0;
@@ -682,11 +682,12 @@ bool ThreadSanitizer::sanitizeFunction(
682682
// errs() << "CalledFunc: " << CalledFunc->getName() << "\n";
683683
if (CalledFunc->getName() == "__tsan_disable") {
684684
disableEnableNesting++;
685-
EnableDisableFuncToDelete.push_back(CI);
685+
EnableDisableFuncCleanupList.push_back(CI);
686686
continue;
687-
} else if (CalledFunc->getName() == "__tsan_enable") {
687+
}
688+
if (CalledFunc->getName() == "__tsan_enable") {
688689
disableEnableNesting--;
689-
EnableDisableFuncToDelete.push_back(CI);
690+
EnableDisableFuncCleanupList.push_back(CI);
690691
continue;
691692
}
692693
}
@@ -741,7 +742,7 @@ bool ThreadSanitizer::sanitizeFunction(
741742
*/
742743

743744
// Erase all __tsan_disable/enable functions
744-
for (auto *CI: EnableDisableFuncToDelete)
745+
for (auto *CI: EnableDisableFuncCleanupList)
745746
CI->eraseFromParent();
746747
//////////////////////////////////////////////////////////////////////////////
747748

0 commit comments

Comments
 (0)