From b292b8ce708d8d5fa4286f1bc2855d6ac0d0f526 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. llvm-svn: 77635 --- llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp') diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp index 5f6edcf336d..e6522749bcc 100644 --- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/llvm/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