diff options
author | Chris Lattner <sabre@nondot.org> | 2005-05-13 06:27:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-05-13 06:27:02 +0000 |
commit | ca968393ab924439f26086dea46ceebebcd148c2 (patch) | |
tree | 0aa3beb1cb73bb811c8b00eca3278ad0a1b1ece3 /llvm/lib/Transforms/Scalar/LowerInvoke.cpp | |
parent | ae186e012c07bd3fd21e7a535457149a838bf0ac (diff) | |
download | bcm5719-llvm-ca968393ab924439f26086dea46ceebebcd148c2.tar.gz bcm5719-llvm-ca968393ab924439f26086dea46ceebebcd148c2.zip |
When lowering invokes to calls, amke sure to preserve the calling conv. This
fixes Ptrdist/anagram with x86 llcbeta
llvm-svn: 21925
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LowerInvoke.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LowerInvoke.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Scalar/LowerInvoke.cpp b/llvm/lib/Transforms/Scalar/LowerInvoke.cpp index 2738b4aa5e3..b0c807f958a 100644 --- a/llvm/lib/Transforms/Scalar/LowerInvoke.cpp +++ b/llvm/lib/Transforms/Scalar/LowerInvoke.cpp @@ -205,9 +205,10 @@ bool LowerInvoke::insertCheapEHSupport(Function &F) { if (InvokeInst *II = dyn_cast<InvokeInst>(BB->getTerminator())) { // Insert a normal call instruction... std::string Name = II->getName(); II->setName(""); - Value *NewCall = new CallInst(II->getCalledValue(), - std::vector<Value*>(II->op_begin()+3, - II->op_end()), Name,II); + CallInst *NewCall = new CallInst(II->getCalledValue(), + std::vector<Value*>(II->op_begin()+3, + II->op_end()), Name, II); + NewCall->setCallingConv(II->getCallingConv()); II->replaceAllUsesWith(NewCall); // Insert an unconditional branch to the normal destination. @@ -286,10 +287,11 @@ bool LowerInvoke::insertExpensiveEHSupport(Function &F) { // Insert a normal call instruction on the normal execution path. std::string Name = II->getName(); II->setName(""); - Value *NewCall = new CallInst(II->getCalledValue(), - std::vector<Value*>(II->op_begin()+3, - II->op_end()), Name, - InsertLoc); + CallInst *NewCall = new CallInst(II->getCalledValue(), + std::vector<Value*>(II->op_begin()+3, + II->op_end()), Name, + InsertLoc); + NewCall->setCallingConv(II->getCallingConv()); II->replaceAllUsesWith(NewCall); // If we got this far, then no exception was thrown and we can pop our |