]> granicus.if.org Git - llvm/commitdiff
GlobalISel: don't leak super-entry BB when merging with IR-level one.
authorTim Northover <tnorthover@apple.com>
Fri, 27 Jan 2017 23:54:31 +0000 (23:54 +0000)
committerTim Northover <tnorthover@apple.com>
Fri, 27 Jan 2017 23:54:31 +0000 (23:54 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293347 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/GlobalISel/IRTranslator.cpp

index 9382de77f88bd85eb8a4c2b0d38e9316ada093c1..1a667d60166a503e8ebd09eda0b05b2608072b55 100644 (file)
@@ -965,6 +965,7 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &CurMF) {
     // 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!");