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

Chris Lattner lattner at cs.uiuc.edu
Sat May 14 05:25:49 PDT 2005



Changes in directory llvm/lib/Transforms/Scalar:

ADCE.cpp updated: 1.92 -> 1.93
InstructionCombining.cpp updated: 1.344 -> 1.345
---
Log message:

preserve calling conventions when hacking on code


---
Diffs of the changes:  (+4 -1)

 ADCE.cpp                 |    3 ++-
 InstructionCombining.cpp |    2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)


Index: llvm/lib/Transforms/Scalar/ADCE.cpp
diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.92 llvm/lib/Transforms/Scalar/ADCE.cpp:1.93
--- llvm/lib/Transforms/Scalar/ADCE.cpp:1.92	Sat Apr 23 16:38:35 2005
+++ llvm/lib/Transforms/Scalar/ADCE.cpp	Sat May 14 07:25:31 2005
@@ -188,7 +188,8 @@
           // after it to the normal destination.
           std::vector<Value*> Args(II->op_begin()+3, II->op_end());
           std::string Name = II->getName(); II->setName("");
-          Instruction *NewCall = new CallInst(F, Args, Name, II);
+          CallInst *NewCall = new CallInst(F, Args, Name, II);
+          NewCall->setCallingConv(II->getCallingConv());
           II->replaceAllUsesWith(NewCall);
           new BranchInst(II->getNormalDest(), II);
 


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.344 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.345
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.344	Fri May 13 02:09:09 2005
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Sat May 14 07:25:32 2005
@@ -4271,10 +4271,12 @@
   if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
     NC = new InvokeInst(Callee, II->getNormalDest(), II->getUnwindDest(),
                         Args, Caller->getName(), Caller);
+    cast<InvokeInst>(II)->setCallingConv(II->getCallingConv());
   } else {
     NC = new CallInst(Callee, Args, Caller->getName(), Caller);
     if (cast<CallInst>(Caller)->isTailCall())
       cast<CallInst>(NC)->setTailCall();
+   cast<CallInst>(NC)->setCallingConv(cast<CallInst>(Caller)->getCallingConv());
   }
 
   // Insert a cast of the return type as necessary...






More information about the llvm-commits mailing list