summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/LowerInvoke.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-05-13 06:27:02 +0000
committerChris Lattner <sabre@nondot.org>2005-05-13 06:27:02 +0000
commitefd9168eae647b3a52d5acef04d9e042d00f2ea3 (patch)
treef93bb73c5bea6d80a984bd06327152712f83e08a /lib/Transforms/Utils/LowerInvoke.cpp
parent1381dd8a6eeb882db92024a46cdbd6689ea1cd94 (diff)
downloadllvm-efd9168eae647b3a52d5acef04d9e042d00f2ea3.tar.gz
llvm-efd9168eae647b3a52d5acef04d9e042d00f2ea3.tar.bz2
llvm-efd9168eae647b3a52d5acef04d9e042d00f2ea3.tar.xz
When lowering invokes to calls, amke sure to preserve the calling conv. This
fixes Ptrdist/anagram with x86 llcbeta git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21925 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/LowerInvoke.cpp')
-rw-r--r--lib/Transforms/Utils/LowerInvoke.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Transforms/Utils/LowerInvoke.cpp b/lib/Transforms/Utils/LowerInvoke.cpp
index 2738b4aa5e..b0c807f958 100644
--- a/lib/Transforms/Utils/LowerInvoke.cpp
+++ b/lib/Transforms/Utils/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