[llvm-branch-commits] [llvm-branch] r101037 - /llvm/branches/ggreif/CallInst-operands/lib/CodeGen/DwarfEHPrepare.cpp

Gabor Greif ggreif at gmail.com
Mon Apr 12 08:18:46 PDT 2010


Author: ggreif
Date: Mon Apr 12 10:18:46 2010
New Revision: 101037

URL: http://llvm.org/viewvc/llvm-project?rev=101037&view=rev
Log:
shift operands

Modified:
    llvm/branches/ggreif/CallInst-operands/lib/CodeGen/DwarfEHPrepare.cpp

Modified: llvm/branches/ggreif/CallInst-operands/lib/CodeGen/DwarfEHPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/CallInst-operands/lib/CodeGen/DwarfEHPrepare.cpp?rev=101037&r1=101036&r2=101037&view=diff
==============================================================================
--- llvm/branches/ggreif/CallInst-operands/lib/CodeGen/DwarfEHPrepare.cpp (original)
+++ llvm/branches/ggreif/CallInst-operands/lib/CodeGen/DwarfEHPrepare.cpp Mon Apr 12 10:18:46 2010
@@ -198,7 +198,7 @@
     bool IsCleanUp = (NumOps == 3);
 
     if (!IsCleanUp)
-      if (ConstantInt *CI = dyn_cast<ConstantInt>(SI->getOperand(3)))
+      if (ConstantInt *CI = dyn_cast<ConstantInt>(SI->getOperand(2)))
         IsCleanUp = (CI->getZExtValue() == 0);
 
     if (IsCleanUp)
@@ -237,7 +237,7 @@
     if (!Sel || Sel->getParent()->getParent() != F) continue;
 
     // Index of the ".llvm.eh.catch.all.value" variable.
-    unsigned OpIdx = Sel->getNumOperands() - 1;
+    unsigned OpIdx = Sel->getNumOperands() - 2;
     GlobalVariable *GV = dyn_cast<GlobalVariable>(Sel->getOperand(OpIdx));
     if (GV != EHCatchAllValue) continue;
     Sel->setOperand(OpIdx, EHCatchAllValue->getInitializer());
@@ -366,7 +366,7 @@
             bool IsCleanUp = (NumOps == 3);
 
             if (!IsCleanUp)
-              if (ConstantInt *CI = dyn_cast<ConstantInt>(II->getOperand(3)))
+              if (ConstantInt *CI = dyn_cast<ConstantInt>(II->getOperand(2)))
                 IsCleanUp = (CI->getZExtValue() == 0);
 
             if (IsCleanUp)
@@ -390,8 +390,8 @@
 
       // Use the exception object pointer and the personality function
       // from the original selector.
-      Args.push_back(II->getOperand(1)); // Exception object pointer.
-      Args.push_back(II->getOperand(2)); // Personality function.
+      Args.push_back(II->getOperand(0)); // Exception object pointer.
+      Args.push_back(II->getOperand(1)); // Personality function.
       Args.push_back(EHCatchAllValue->getInitializer()); // Catch-all indicator.
 
       CallInst *NewSelector =





More information about the llvm-branch-commits mailing list