diff options
author | Owen Anderson <resistor@mac.com> | 2009-08-13 21:58:54 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-08-13 21:58:54 +0000 |
commit | 55f1c09e31cfc6744fb682e17a2a1a00d914694c (patch) | |
tree | e753e20c7186dc8138bef58089274bb5162a7cef /llvm/lib/CodeGen/DwarfEHPrepare.cpp | |
parent | 41a750271b72216801366693bd0f41672892c487 (diff) | |
download | bcm5719-llvm-55f1c09e31cfc6744fb682e17a2a1a00d914694c.tar.gz bcm5719-llvm-55f1c09e31cfc6744fb682e17a2a1a00d914694c.zip |
Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
Diffstat (limited to 'llvm/lib/CodeGen/DwarfEHPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/DwarfEHPrepare.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/DwarfEHPrepare.cpp b/llvm/lib/CodeGen/DwarfEHPrepare.cpp index 5bfb32870c9..16581112b66 100644 --- a/llvm/lib/CodeGen/DwarfEHPrepare.cpp +++ b/llvm/lib/CodeGen/DwarfEHPrepare.cpp @@ -142,7 +142,8 @@ bool DwarfEHPrepare::NormalizeLandingPads() { // edges to a new basic block which falls through into this one. // Create the new basic block. - BasicBlock *NewBB = BasicBlock::Create(LPad->getName() + "_unwind_edge"); + BasicBlock *NewBB = BasicBlock::Create(F->getContext(), + LPad->getName() + "_unwind_edge"); // Insert it into the function right before the original landing pad. LPad->getParent()->getBasicBlockList().insert(LPad, NewBB); @@ -230,8 +231,10 @@ bool DwarfEHPrepare::LowerUnwinds() { // Find the rewind function if we didn't already. if (!RewindFunction) { - std::vector<const Type*> Params(1, PointerType::getUnqual(Type::Int8Ty)); - FunctionType *FTy = FunctionType::get(Type::VoidTy, Params, false); + std::vector<const Type*> Params(1, + PointerType::getUnqual(Type::getInt8Ty(TI->getContext()))); + FunctionType *FTy = FunctionType::get(Type::getVoidTy(TI->getContext()), + Params, false); const char *RewindName = TLI->getLibcallName(RTLIB::UNWIND_RESUME); RewindFunction = F->getParent()->getOrInsertFunction(RewindName, FTy); } @@ -239,7 +242,7 @@ bool DwarfEHPrepare::LowerUnwinds() { // Create the call... CallInst::Create(RewindFunction, CreateReadOfExceptionValue(I), "", TI); // ...followed by an UnreachableInst. - new UnreachableInst(TI); + new UnreachableInst(TI->getContext(), TI); // Nuke the unwind instruction. TI->eraseFromParent(); @@ -354,8 +357,8 @@ Instruction *DwarfEHPrepare::CreateValueLoad(BasicBlock *BB) { // Create the temporary if we didn't already. if (!ExceptionValueVar) { - ExceptionValueVar = new AllocaInst(PointerType::getUnqual(Type::Int8Ty), - "eh.value", F->begin()->begin()); + ExceptionValueVar = new AllocaInst(PointerType::getUnqual( + Type::getInt8Ty(BB->getContext())), "eh.value", F->begin()->begin()); ++NumStackTempsIntroduced; } |