summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SjLjEHPrepare.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-06-19 20:51:24 +0000
committerBill Wendling <isanbard@gmail.com>2013-06-19 20:51:24 +0000
commitea44281d5da5096de50ce1cb358ff0c6f20e1a2a (patch)
treee5921b602a2747efb334a9b13b94d5f090c779fb /lib/CodeGen/SjLjEHPrepare.cpp
parent2e1dc2d2650c64f8fa57d12eb194dcf57e85ebb7 (diff)
downloadllvm-ea44281d5da5096de50ce1cb358ff0c6f20e1a2a.tar.gz
llvm-ea44281d5da5096de50ce1cb358ff0c6f20e1a2a.tar.bz2
llvm-ea44281d5da5096de50ce1cb358ff0c6f20e1a2a.tar.xz
Access the TargetLoweringInfo from the TargetMachine object instead of caching it. The TLI may change between functions. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SjLjEHPrepare.cpp')
-rw-r--r--lib/CodeGen/SjLjEHPrepare.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/CodeGen/SjLjEHPrepare.cpp b/lib/CodeGen/SjLjEHPrepare.cpp
index 23984e9986..2fc8f46f48 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<LandingPadInst*> 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 =