[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LowerInvoke.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu May 12 23:27:26 PDT 2005



Changes in directory llvm/lib/Transforms/Scalar:

LowerInvoke.cpp updated: 1.24 -> 1.25
---
Log message:

When lowering invokes to calls, amke sure to preserve the calling conv.  This
fixes Ptrdist/anagram with x86 llcbeta


---
Diffs of the changes:  (+9 -7)

 LowerInvoke.cpp |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)


Index: llvm/lib/Transforms/Scalar/LowerInvoke.cpp
diff -u llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.24 llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.25
--- llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.24	Fri May 13 01:10:12 2005
+++ llvm/lib/Transforms/Scalar/LowerInvoke.cpp	Fri May 13 01:27:02 2005
@@ -205,9 +205,10 @@
     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 @@
 
       // 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






More information about the llvm-commits mailing list