[llvm-branch-commits] [llvm-branch] r99086 - in /llvm/branches/ggreif/InvokeInst-operands: ./ include/llvm/Instructions.h lib/Transforms/IPO/GlobalOpt.cpp lib/Transforms/InstCombine/InstCombineCalls.cpp

Gabor Greif ggreif at gmail.com
Sat Mar 20 14:09:21 PDT 2010


Author: ggreif
Date: Sat Mar 20 16:09:20 2010
New Revision: 99086

URL: http://llvm.org/viewvc/llvm-project?rev=99086&view=rev
Log:
pull r99084 from trunk and adapt accordingly

Modified:
    llvm/branches/ggreif/InvokeInst-operands/   (props changed)
    llvm/branches/ggreif/InvokeInst-operands/include/llvm/Instructions.h
    llvm/branches/ggreif/InvokeInst-operands/lib/Transforms/IPO/GlobalOpt.cpp
    llvm/branches/ggreif/InvokeInst-operands/lib/Transforms/InstCombine/InstCombineCalls.cpp

Propchange: llvm/branches/ggreif/InvokeInst-operands/
------------------------------------------------------------------------------
    svn:mergeinfo = /llvm/trunk:99084

Modified: llvm/branches/ggreif/InvokeInst-operands/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/InvokeInst-operands/include/llvm/Instructions.h?rev=99086&r1=99085&r2=99086&view=diff
==============================================================================
--- llvm/branches/ggreif/InvokeInst-operands/include/llvm/Instructions.h (original)
+++ llvm/branches/ggreif/InvokeInst-operands/include/llvm/Instructions.h Sat Mar 20 16:09:20 2010
@@ -2516,6 +2516,11 @@
   const Value *getCalledValue() const { return Op<-3>(); }
         Value *getCalledValue()       { return Op<-3>(); }
 
+  /// setCalledFunction - Set the function called.
+  void setCalledFunction(Value* Fn) {
+    Op<-3>() = Fn;
+  }
+
   // get*Dest - Return the destination basic blocks...
   BasicBlock *getNormalDest() const {
     return cast<BasicBlock>(Op<-2>());

Modified: llvm/branches/ggreif/InvokeInst-operands/lib/Transforms/IPO/GlobalOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/InvokeInst-operands/lib/Transforms/IPO/GlobalOpt.cpp?rev=99086&r1=99085&r2=99086&view=diff
==============================================================================
--- llvm/branches/ggreif/InvokeInst-operands/lib/Transforms/IPO/GlobalOpt.cpp (original)
+++ llvm/branches/ggreif/InvokeInst-operands/lib/Transforms/IPO/GlobalOpt.cpp Sat Mar 20 16:09:20 2010
@@ -622,12 +622,12 @@
         return false;  // Storing the value.
       }
     } else if (CallInst *CI = dyn_cast<CallInst>(*UI)) {
-      if (CI->getOperand(0) != V) {
+      if (CI->getCalledValue() != V) {
         //cerr << "NONTRAPPING USE: " << **UI;
         return false;  // Not calling the ptr
       }
     } else if (InvokeInst *II = dyn_cast<InvokeInst>(*UI)) {
-      if (II->getOperand(0) != V) {
+      if (II->getCalledValue() != V) {
         //cerr << "NONTRAPPING USE: " << **UI;
         return false;  // Not calling the ptr
       }

Modified: llvm/branches/ggreif/InvokeInst-operands/lib/Transforms/InstCombine/InstCombineCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/InvokeInst-operands/lib/Transforms/InstCombine/InstCombineCalls.cpp?rev=99086&r1=99085&r2=99086&view=diff
==============================================================================
--- llvm/branches/ggreif/InvokeInst-operands/lib/Transforms/InstCombine/InstCombineCalls.cpp (original)
+++ llvm/branches/ggreif/InvokeInst-operands/lib/Transforms/InstCombine/InstCombineCalls.cpp Sat Mar 20 16:09:20 2010
@@ -820,7 +820,7 @@
       
       // We cannot remove an invoke, because it would change the CFG, just
       // change the callee to a null pointer.
-      cast<InvokeInst>(OldCall)->setOperand(0,
+      cast<InvokeInst>(OldCall)->setCalledFunction(
                                     Constant::getNullValue(CalleeF->getType()));
       return 0;
     }





More information about the llvm-branch-commits mailing list