From bf98c575dea7b00ed0fdb37118694e67670badff Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Fri, 27 Jan 2017 23:54:31 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293347 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/GlobalISel/IRTranslator.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/CodeGen/GlobalISel/IRTranslator.cpp b/lib/CodeGen/GlobalISel/IRTranslator.cpp index 9382de77f88..1a667d60166 100644 --- a/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -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!"); -- 2.40.0