diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-08-25 01:08:34 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-08-25 01:08:34 +0000 |
commit | 07efd6f1e030d043e52d44c38a2cc8ea320025c5 (patch) | |
tree | 7f17005feafa08744087351e57c20886e6d1758a /llvm/lib/Transforms/Utils/LowerInvoke.cpp | |
parent | f066b2fe9917d5972e706b028f4b133249bae4ad (diff) | |
download | bcm5719-llvm-07efd6f1e030d043e52d44c38a2cc8ea320025c5.tar.gz bcm5719-llvm-07efd6f1e030d043e52d44c38a2cc8ea320025c5.zip |
When inserting new instructions, use getFirstInsertionPt instead of
getFirstNonPHI so that it will skip over the landingpad instructions as well.
llvm-svn: 138537
Diffstat (limited to 'llvm/lib/Transforms/Utils/LowerInvoke.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LowerInvoke.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/LowerInvoke.cpp b/llvm/lib/Transforms/Utils/LowerInvoke.cpp index 528c70936ef..c96c8fce7b1 100644 --- a/llvm/lib/Transforms/Utils/LowerInvoke.cpp +++ b/llvm/lib/Transforms/Utils/LowerInvoke.cpp @@ -240,14 +240,14 @@ void LowerInvoke::rewriteExpensiveInvoke(InvokeInst *II, unsigned InvokeNo, CallInst* StackSaveRet = CallInst::Create(StackSaveFn, "ssret", II); new StoreInst(StackSaveRet, StackPtr, true, II); // volatile - BasicBlock::iterator NI = II->getNormalDest()->getFirstNonPHI(); + BasicBlock::iterator NI = II->getNormalDest()->getFirstInsertionPt(); // nonvolatile. new StoreInst(Constant::getNullValue(Type::getInt32Ty(II->getContext())), InvokeNum, false, NI); - Instruction* StackPtrLoad = new LoadInst(StackPtr, "stackptr.restore", true, - II->getUnwindDest()->getFirstNonPHI() - ); + Instruction* StackPtrLoad = + new LoadInst(StackPtr, "stackptr.restore", true, + II->getUnwindDest()->getFirstInsertionPt()); CallInst::Create(StackRestoreFn, StackPtrLoad, "")->insertAfter(StackPtrLoad); // Add a switch case to our unwind block. |