From 9adc0abad3c3ed40a268ccbcee0c74cb9e1359fe Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Tue, 14 Jul 2009 23:09:55 +0000 Subject: Move EVER MORE stuff over to LLVMContext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75703 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/bugpoint/ExtractFunction.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tools/bugpoint/ExtractFunction.cpp') diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp index bb35d4fab4..3df130771f 100644 --- a/tools/bugpoint/ExtractFunction.cpp +++ b/tools/bugpoint/ExtractFunction.cpp @@ -74,7 +74,7 @@ Module *BugDriver::deleteInstructionFromProgram(const Instruction *I, // If this instruction produces a value, replace any users with null values if (isa(TheInst->getType())) - TheInst->replaceAllUsesWith(UndefValue::get(TheInst->getType())); + TheInst->replaceAllUsesWith(Context.getUndef(TheInst->getType())); else if (TheInst->getType() != Type::VoidTy) TheInst->replaceAllUsesWith(Context.getNullValue(TheInst->getType())); @@ -183,14 +183,15 @@ void llvm::DeleteFunctionBody(Function *F) { /// as a constant array. static Constant *GetTorInit(std::vector > &TorList) { assert(!TorList.empty() && "Don't create empty tor list!"); + LLVMContext &Context = *TorList[0].first->getContext(); std::vector ArrayElts; for (unsigned i = 0, e = TorList.size(); i != e; ++i) { std::vector Elts; - Elts.push_back(ConstantInt::get(Type::Int32Ty, TorList[i].second)); + Elts.push_back(Context.getConstantInt(Type::Int32Ty, TorList[i].second)); Elts.push_back(TorList[i].first); - ArrayElts.push_back(ConstantStruct::get(Elts)); + ArrayElts.push_back(Context.getConstantStruct(Elts)); } - return ConstantArray::get(ArrayType::get(ArrayElts[0]->getType(), + return Context.getConstantArray(Context.getArrayType(ArrayElts[0]->getType(), ArrayElts.size()), ArrayElts); } -- cgit v1.2.3