use ArgOperand API
authorGabor Greif <ggreif@gmail.com>
Thu, 24 Jun 2010 13:42:49 +0000 (13:42 +0000)
committerGabor Greif <ggreif@gmail.com>
Thu, 24 Jun 2010 13:42:49 +0000 (13:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106743 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstCombineCalls.cpp

index f3025dc5ebc3e276331768a14f71a365cabf0d62..c9ab176d83c54ec3573ef6dfbf54cc8e457363c9 100644 (file)
@@ -289,11 +289,10 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
         if (GVSrc->isConstant()) {
           Module *M = CI.getParent()->getParent()->getParent();
           Intrinsic::ID MemCpyID = Intrinsic::memcpy;
-          const Type *Tys[3] = { CI.getOperand(1)->getType(),
-                                 CI.getOperand(2)->getType(),
-                                 CI.getOperand(3)->getType() };
-          CI.setCalledFunction( 
-                        Intrinsic::getDeclaration(M, MemCpyID, Tys, 3));
+          const Type *Tys[3] = { CI.getArgOperand(0)->getType(),
+                                 CI.getArgOperand(1)->getType(),
+                                 CI.getArgOperand(2)->getType() };
+          CI.setCalledFunction(Intrinsic::getDeclaration(M, MemCpyID, Tys, 3));
           Changed = true;
         }
     }
@@ -313,7 +312,7 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
       if (Instruction *I = SimplifyMemSet(MSI))
         return I;
     }
-          
+
     if (Changed) return II;
   }