[llvm] r293347 - GlobalISel: don't leak super-entry BB when merging with IR-level one.

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 15:54:31 PST 2017


Author: tnorthover
Date: Fri Jan 27 17:54:31 2017
New Revision: 293347

URL: http://llvm.org/viewvc/llvm-project?rev=293347&view=rev
Log:
GlobalISel: don't leak super-entry BB when merging with IR-level one.

We have to delete the block manually or it leaks. That triggers failures in
-fsanitize=leak bots (unsurprisingly), which should be fixed by this patch.

Modified:
    llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp

Modified: llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp?rev=293347&r1=293346&r2=293347&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp Fri Jan 27 17:54:31 2017
@@ -965,6 +965,7 @@ bool IRTranslator::runOnMachineFunction(
     // Get rid of the now empty basic block.
     EntryBB->removeSuccessor(&NewEntryBB);
     MF->remove(EntryBB);
+    MF->DeleteMachineBasicBlock(EntryBB);
 
     assert(&MF->front() == &NewEntryBB &&
            "New entry wasn't next in the list of basic block!");




More information about the llvm-commits mailing list