From 1d608abbc07bbc7c78c20da6b305ef14c6c30e8e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 10 Sep 2002 22:38:47 +0000 Subject: Clean up code due to auto-insert constructors git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3665 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/PromoteMemoryToRegister.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/Transforms/Utils/PromoteMemoryToRegister.cpp') diff --git a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index 5fcab97035..b84f1a378f 100644 --- a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp @@ -196,14 +196,12 @@ bool PromotePass::QueuePhiNode(BasicBlock *BB, unsigned AllocaNo) { // If the BB already has a phi node added for the i'th alloca then we're done! if (BBPNs[AllocaNo]) return false; - // Create a PhiNode using the dereferenced type... + // Create a PhiNode using the dereferenced type... and add the phi-node to the + // BasicBlock PHINode *PN = new PHINode(Allocas[AllocaNo]->getAllocatedType(), - Allocas[AllocaNo]->getName()+".mem2reg"); + Allocas[AllocaNo]->getName()+".mem2reg", + BB->begin()); BBPNs[AllocaNo] = PN; - - // Add the phi-node to the basic-block - BB->getInstList().push_front(PN); - PhiNodes[AllocaNo].push_back(BB); return true; } -- cgit v1.2.3-18-g5258