From 9e9a0d5fc26878e51a58a8b57900fcbf952c2691 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Thu, 30 Jul 2009 23:03:37 +0000 Subject: Move more code back to 2.5 APIs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77635 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/BasicBlockUtils.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/Transforms/Utils/BasicBlockUtils.cpp') diff --git a/lib/Transforms/Utils/BasicBlockUtils.cpp b/lib/Transforms/Utils/BasicBlockUtils.cpp index 5f6edcf336..e6522749bc 100644 --- a/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -51,7 +51,7 @@ void llvm::DeleteDeadBlock(BasicBlock *BB) { // contained within it must dominate their uses, that all uses will // eventually be removed (they are themselves dead). if (!I.use_empty()) - I.replaceAllUsesWith(BB->getContext().getUndef(I.getType())); + I.replaceAllUsesWith(UndefValue::get(I.getType())); BB->getInstList().pop_back(); } @@ -71,7 +71,7 @@ void llvm::FoldSingleEntryPHINodes(BasicBlock *BB) { if (PN->getIncomingValue(0) != PN) PN->replaceAllUsesWith(PN->getIncomingValue(0)); else - PN->replaceAllUsesWith(BB->getContext().getUndef(PN->getType())); + PN->replaceAllUsesWith(UndefValue::get(PN->getType())); PN->eraseFromParent(); } } @@ -387,8 +387,7 @@ BasicBlock *llvm::SplitBlockPredecessors(BasicBlock *BB, if (NumPreds == 0) { // Insert dummy values as the incoming value. for (BasicBlock::iterator I = BB->begin(); isa(I); ++I) - cast(I)->addIncoming(BB->getContext().getUndef(I->getType()), - NewBB); + cast(I)->addIncoming(UndefValue::get(I->getType()), NewBB); return NewBB; } -- cgit v1.2.3-18-g5258