diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-13 04:09:18 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-13 04:09:18 +0000 |
commit | 53a52215b5480bd52f1aee5189c7b08a7098fc51 (patch) | |
tree | 20cde4af23fe30f2b0cf520520affbb0c66a53ab /llvm/lib/Transforms/Utils/LowerInvoke.cpp | |
parent | 5302389442e928e7d8e9d07be1a4a463085d754a (diff) | |
download | llvm-53a52215b5480bd52f1aee5189c7b08a7098fc51.zip llvm-53a52215b5480bd52f1aee5189c7b08a7098fc51.tar.gz llvm-53a52215b5480bd52f1aee5189c7b08a7098fc51.tar.bz2 |
Begin the painful process of tearing apart the rat'ss nest that is Constants.cpp and ConstantFold.cpp.
This involves temporarily hard wiring some parts to use the global context. This isn't ideal, but it's
the only way I could figure out to make this process vaguely incremental.
llvm-svn: 75445
Diffstat (limited to 'llvm/lib/Transforms/Utils/LowerInvoke.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LowerInvoke.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Utils/LowerInvoke.cpp b/llvm/lib/Transforms/Utils/LowerInvoke.cpp index b8e0fd8..2e13ed3 100644 --- a/llvm/lib/Transforms/Utils/LowerInvoke.cpp +++ b/llvm/lib/Transforms/Utils/LowerInvoke.cpp @@ -251,7 +251,7 @@ bool LowerInvoke::insertCheapEHSupport(Function &F) { // Insert a return instruction. This really should be a "barrier", as it // is unreachable. ReturnInst::Create(F.getReturnType() == Type::VoidTy ? 0 : - Constant::getNullValue(F.getReturnType()), UI); + Context->getNullValue(F.getReturnType()), UI); // Remove the unwind instruction now. BB->getInstList().erase(UI); @@ -285,7 +285,7 @@ void LowerInvoke::rewriteExpensiveInvoke(InvokeInst *II, unsigned InvokeNo, BasicBlock::iterator NI = II->getNormalDest()->getFirstNonPHI(); // nonvolatile. - new StoreInst(Constant::getNullValue(Type::Int32Ty), InvokeNum, false, NI); + new StoreInst(Context->getNullValue(Type::Int32Ty), InvokeNum, false, NI); // Add a switch case to our unwind block. CatchSwitch->addCase(InvokeNoC, II->getUnwindDest()); @@ -473,7 +473,7 @@ bool LowerInvoke::insertExpensiveEHSupport(Function &F) { new AllocaInst(JBLinkTy, 0, Align, "jblink", F.begin()->begin()); std::vector<Value*> Idx; - Idx.push_back(Constant::getNullValue(Type::Int32Ty)); + Idx.push_back(Context->getNullValue(Type::Int32Ty)); Idx.push_back(ConstantInt::get(Type::Int32Ty, 1)); OldJmpBufPtr = GetElementPtrInst::Create(JmpBuf, Idx.begin(), Idx.end(), "OldBuf", EntryBB->getTerminator()); @@ -525,7 +525,7 @@ bool LowerInvoke::insertExpensiveEHSupport(Function &F) { // Compare the return value to zero. Value *IsNormal = new ICmpInst(EntryBB->getTerminator(), ICmpInst::ICMP_EQ, SJRet, - Constant::getNullValue(SJRet->getType()), + Context->getNullValue(SJRet->getType()), "notunwind"); // Nuke the uncond branch. EntryBB->getTerminator()->eraseFromParent(); @@ -559,14 +559,14 @@ bool LowerInvoke::insertExpensiveEHSupport(Function &F) { // Load the JBList, if it's null, then there was no catch! Value *NotNull = new ICmpInst(*UnwindHandler, ICmpInst::ICMP_NE, BufPtr, - Constant::getNullValue(BufPtr->getType()), + Context->getNullValue(BufPtr->getType()), "notnull"); BranchInst::Create(UnwindBlock, TermBlock, NotNull, UnwindHandler); // Create the block to do the longjmp. // Get a pointer to the jmpbuf and longjmp. std::vector<Value*> Idx; - Idx.push_back(Constant::getNullValue(Type::Int32Ty)); + Idx.push_back(Context->getNullValue(Type::Int32Ty)); Idx.push_back(ConstantInt::get(Type::Int32Ty, 0)); Idx[0] = GetElementPtrInst::Create(BufPtr, Idx.begin(), Idx.end(), "JmpBuf", UnwindBlock); |