aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/IR/DominatorTreeTest.cpp
diff options
context:
space:
mode:
authorAlexis Engelke <engelke@in.tum.de>2024-07-31 19:20:49 +0200
committerGitHub <noreply@github.com>2024-07-31 19:20:49 +0200
commit6d103d7746c94cc865138093c7c65138b89aa77c (patch)
treef33ae16901c5e073e697b594eb3fa6c6e035c5fb /llvm/unittests/IR/DominatorTreeTest.cpp
parenta4c6ebeb20168bbedbb1a3aff9f5096416e5914a (diff)
downloadllvm-6d103d7746c94cc865138093c7c65138b89aa77c.zip
llvm-6d103d7746c94cc865138093c7c65138b89aa77c.tar.gz
llvm-6d103d7746c94cc865138093c7c65138b89aa77c.tar.bz2
[Support] Erase blocks after DomTree::eraseNode (#101195)
Change eraseNode to require that the basic block is still contained inside the function. This is a preparation for using numbers of basic blocks inside the dominator tree, which are invalid for blocks that are not inside a function.
Diffstat (limited to 'llvm/unittests/IR/DominatorTreeTest.cpp')
-rw-r--r--llvm/unittests/IR/DominatorTreeTest.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/unittests/IR/DominatorTreeTest.cpp b/llvm/unittests/IR/DominatorTreeTest.cpp
index 44bde74..555348c 100644
--- a/llvm/unittests/IR/DominatorTreeTest.cpp
+++ b/llvm/unittests/IR/DominatorTreeTest.cpp
@@ -607,11 +607,10 @@ TEST(DominatorTree, DeletingEdgesIntroducesInfiniteLoop2) {
SwitchC->removeCase(SwitchC->case_begin());
DT->deleteEdge(C, C2);
PDT->deleteEdge(C, C2);
- C2->removeFromParent();
EXPECT_EQ(DT->getNode(C2), nullptr);
PDT->eraseNode(C2);
- delete C2;
+ C2->eraseFromParent();
EXPECT_TRUE(DT->verify());
EXPECT_TRUE(PDT->verify());