X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FSjLjEHPrepare.cpp;h=2fc8f46f48b1bf50110006cf9973a0018900df2b;hb=e2ff00e117ba9b758b298e671f65c0b002f8a52d;hp=23984e9986a43a247129350fe315c89ba6e3e874;hpb=e4642bc096984c12c1ef129137e17fad61201118;p=oota-llvm.git diff --git a/lib/CodeGen/SjLjEHPrepare.cpp b/lib/CodeGen/SjLjEHPrepare.cpp index 23984e9986a..2fc8f46f48b 100644 --- a/lib/CodeGen/SjLjEHPrepare.cpp +++ b/lib/CodeGen/SjLjEHPrepare.cpp @@ -43,7 +43,7 @@ STATISTIC(NumSpilled, "Number of registers live across unwind edges"); namespace { class SjLjEHPrepare : public FunctionPass { - const TargetLoweringBase *TLI; + const TargetMachine *TM; Type *FunctionContextTy; Constant *RegisterFn; Constant *UnregisterFn; @@ -58,8 +58,8 @@ namespace { AllocaInst *FuncCtx; public: static char ID; // Pass identification, replacement for typeid - explicit SjLjEHPrepare(const TargetLoweringBase *tli = NULL) - : FunctionPass(ID), TLI(tli) { } + explicit SjLjEHPrepare(const TargetMachine *TM) + : FunctionPass(ID), TM(TM) { } bool doInitialization(Module &M); bool runOnFunction(Function &F); @@ -82,8 +82,8 @@ namespace { char SjLjEHPrepare::ID = 0; // Public Interface To the SjLjEHPrepare pass. -FunctionPass *llvm::createSjLjEHPreparePass(const TargetLoweringBase *TLI) { - return new SjLjEHPrepare(TLI); +FunctionPass *llvm::createSjLjEHPreparePass(const TargetMachine *TM) { + return new SjLjEHPrepare(TM); } // doInitialization - Set up decalarations and types needed to process // exceptions. @@ -190,6 +190,7 @@ setupFunctionContext(Function &F, ArrayRef LPads) { // Create an alloca for the incoming jump buffer ptr and the new jump buffer // that needs to be restored on all exits from the function. This is an alloca // because the value needs to be added to the global context list. + const TargetLowering *TLI = TM->getTargetLowering(); unsigned Align = TLI->getDataLayout()->getPrefTypeAlignment(FunctionContextTy); FuncCtx =