File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
llvm/lib/Transforms/Instrumentation Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -661,7 +661,7 @@ bool ThreadSanitizer::sanitizeFunction(
661
661
662
662
// /////////////////////////////////////////////////////////////////////////////
663
663
// List of instructions (function calls) to delete
664
- SmallVector<CallInst*, 8 > EnableDisableFuncToDelete ;
664
+ SmallVector<CallInst*, 8 > EnableDisableFuncCleanupList ;
665
665
666
666
// Counter for considering nesting __tsan_disable/__tsan_enable
667
667
int disableEnableNesting = 0 ;
@@ -682,11 +682,12 @@ bool ThreadSanitizer::sanitizeFunction(
682
682
// errs() << "CalledFunc: " << CalledFunc->getName() << "\n";
683
683
if (CalledFunc->getName () == " __tsan_disable" ) {
684
684
disableEnableNesting++;
685
- EnableDisableFuncToDelete .push_back (CI);
685
+ EnableDisableFuncCleanupList .push_back (CI);
686
686
continue ;
687
- } else if (CalledFunc->getName () == " __tsan_enable" ) {
687
+ }
688
+ if (CalledFunc->getName () == " __tsan_enable" ) {
688
689
disableEnableNesting--;
689
- EnableDisableFuncToDelete .push_back (CI);
690
+ EnableDisableFuncCleanupList .push_back (CI);
690
691
continue ;
691
692
}
692
693
}
@@ -741,7 +742,7 @@ bool ThreadSanitizer::sanitizeFunction(
741
742
*/
742
743
743
744
// Erase all __tsan_disable/enable functions
744
- for (auto *CI: EnableDisableFuncToDelete )
745
+ for (auto *CI: EnableDisableFuncCleanupList )
745
746
CI->eraseFromParent ();
746
747
// ////////////////////////////////////////////////////////////////////////////
747
748
You can’t perform that action at this time.
0 commit comments