From 83beaee227dad622a7e378897c6f29b511388fa0 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Mon, 4 Jun 2007 16:43:25 +0000 Subject: [PATCH] s/DominatorTree::createNewNode/DominatorTree::addNewBlock/g git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37415 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/Dominators.h | 13 ++++++------- lib/Transforms/Utils/BreakCriticalEdges.cpp | 2 +- lib/Transforms/Utils/CodeExtractor.cpp | 2 +- lib/Transforms/Utils/LoopSimplify.cpp | 3 +-- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index f36afd4a2f0..03eab60034d 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -170,18 +170,17 @@ protected: // API to update (Post)DominatorTree information based on modifications to // the CFG... - /// createNewNode - Add a new node to the dominator tree information. This - /// creates a new node as a child of IDomNode, linking it into the children - /// list of the immediate dominator. - /// - DomTreeNode *createNewNode(BasicBlock *BB, DomTreeNode *IDomNode) { + /// addNewBlock - Add a new node to the dominator tree information. This + /// creates a new node as a child of DomBB dominator node,linking it into + /// the children list of the immediate dominator. + DomTreeNode *addNewBlock(BasicBlock *BB, DomTreeNode *IDomNode) { assert(getNode(BB) == 0 && "Block already in dominator tree!"); assert(IDomNode && "Not immediate dominator specified for block!"); return DomTreeNodes[BB] = IDomNode->addChild(new DomTreeNode(BB, IDomNode)); } - void createNewNode(BasicBlock *BB, BasicBlock *DomBB) { - createNewNode(BB, getNode(DomBB)); + DomTreeNode *addNewBlock(BasicBlock *BB, BasicBlock *DomBB) { + return addNewBlock(BB, getNode(DomBB)); } /// changeImmediateDominator - This method is used to update the dominator diff --git a/lib/Transforms/Utils/BreakCriticalEdges.cpp b/lib/Transforms/Utils/BreakCriticalEdges.cpp index a234b9cc420..707cdf0edcb 100644 --- a/lib/Transforms/Utils/BreakCriticalEdges.cpp +++ b/lib/Transforms/Utils/BreakCriticalEdges.cpp @@ -209,7 +209,7 @@ bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P, // TINode is the immediate dominator for the new node. // if (TINode) { // Don't break unreachable code! - DomTreeNode *NewBBNode = DT->createNewNode(NewBB, TINode); + DomTreeNode *NewBBNode = DT->addNewBlock(NewBB, TIBB); DomTreeNode *DestBBNode = 0; // If NewBBDominatesDestBB hasn't been computed yet, do so with DT. diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp index f0eb6250f72..2e8db5099ec 100644 --- a/lib/Transforms/Utils/CodeExtractor.cpp +++ b/lib/Transforms/Utils/CodeExtractor.cpp @@ -143,7 +143,7 @@ void CodeExtractor::severSplitPHINodes(BasicBlock *&Header) { // blocks that dominate TIBB plus the new block itself. if (EF) { BasicBlock* idom = EF->getIDom(OldPred); - DT->createNewNode(NewBB, idom); + DT->addNewBlock(NewBB, idom); EF->addNewBlock(NewBB, idom); // Additionally, NewBB replaces OldPred as the immediate dominator of blocks diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index f641264f12c..71a29bbdc6c 100644 --- a/lib/Transforms/Utils/LoopSimplify.cpp +++ b/lib/Transforms/Utils/LoopSimplify.cpp @@ -778,10 +778,9 @@ void LoopSimplify::UpdateDomInfoForRevectoredPreds(BasicBlock *NewBB, } assert(NewBBIDom && "No immediate dominator found??"); } - DomTreeNode *NewBBIDomNode = DT->getNode(NewBBIDom); // Create the new dominator tree node... and set the idom of NewBB. - DomTreeNode *NewBBNode = DT->createNewNode(NewBB, NewBBIDomNode); + DomTreeNode *NewBBNode = DT->addNewBlock(NewBB, NewBBIDom); // If NewBB strictly dominates other blocks, then it is now the immediate // dominator of NewBBSucc. Update the dominator tree as appropriate. -- 2.34.1