summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/ExtractFunction.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-14 23:09:55 +0000
committerOwen Anderson <resistor@mac.com>2009-07-14 23:09:55 +0000
commitb6b2530000366d6982736dd0d0cc3585b01cf37b (patch)
treefbc341c4197153ef4908d7b6b75b5b2b57a1b46f /llvm/tools/bugpoint/ExtractFunction.cpp
parenteea582f04f1a8fb0d1b81e45e83e9c116869a502 (diff)
downloadbcm5719-llvm-b6b2530000366d6982736dd0d0cc3585b01cf37b.tar.gz
bcm5719-llvm-b6b2530000366d6982736dd0d0cc3585b01cf37b.zip
Move EVER MORE stuff over to LLVMContext.
llvm-svn: 75703
Diffstat (limited to 'llvm/tools/bugpoint/ExtractFunction.cpp')
-rw-r--r--llvm/tools/bugpoint/ExtractFunction.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/tools/bugpoint/ExtractFunction.cpp b/llvm/tools/bugpoint/ExtractFunction.cpp
index bb35d4fab45..3df130771f0 100644
--- a/llvm/tools/bugpoint/ExtractFunction.cpp
+++ b/llvm/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<StructType>(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<std::pair<Function*, int> > &TorList) {
assert(!TorList.empty() && "Don't create empty tor list!");
+ LLVMContext &Context = *TorList[0].first->getContext();
std::vector<Constant*> ArrayElts;
for (unsigned i = 0, e = TorList.size(); i != e; ++i) {
std::vector<Constant*> 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);
}
OpenPOWER on IntegriCloud