[llvm-commits] [poolalloc] r137076 - /poolalloc/trunk/lib/AssistDS/ArgCast.cpp

Arushi Aggarwal aggarwa4 at illinois.edu
Mon Aug 8 16:48:15 PDT 2011


Author: aggarwa4
Date: Mon Aug  8 18:48:15 2011
New Revision: 137076

URL: http://llvm.org/viewvc/llvm-project?rev=137076&view=rev
Log:
Allow file to compile with mainline.

Modified:
    poolalloc/trunk/lib/AssistDS/ArgCast.cpp

Modified: poolalloc/trunk/lib/AssistDS/ArgCast.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/ArgCast.cpp?rev=137076&r1=137075&r2=137076&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/ArgCast.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/ArgCast.cpp Mon Aug  8 18:48:15 2011
@@ -58,7 +58,7 @@
     // Find all uses of this function
     for(Value::use_iterator ui = I->use_begin(), ue = I->use_end(); ui != ue; ) {
       // check if is ever casted to a different function type
-      ConstantExpr *CE = dyn_cast<ConstantExpr>(ui++);
+      ConstantExpr *CE = dyn_cast<ConstantExpr>(*ui++);
       if(!CE)
         continue;
       if (CE->getOpcode() != Instruction::BitCast)
@@ -82,7 +82,7 @@
           uee = CE->use_end(); uii != uee; ++uii) {
         // Find all uses of the casted value, and check if it is 
         // used in a Call Instruction
-        if (CallInst* CI = dyn_cast<CallInst>(uii)) {
+        if (CallInst* CI = dyn_cast<CallInst>(*uii)) {
           // Check that it is the called value, and not an argument
           if(CI->getCalledValue() != CE) 
             continue;
@@ -113,8 +113,8 @@
     SmallVector<Value*, 8> Args;
     unsigned i =0;
     for(i =0; i< FTy->getNumParams(); ++i) {
-      const Type *ArgType = CI->getOperand(i+1)->getType();
-      const Type *FormalType = FTy->getParamType(i);
+      Type *ArgType = CI->getOperand(i+1)->getType();
+      Type *FormalType = FTy->getParamType(i);
       // If the types for this argument match, just add it to the
       // parameter list. No cast needs to be inserted.
       if(ArgType == FormalType) {
@@ -171,7 +171,7 @@
     }
 
     // else replace the call instruction
-    CallInst *CINew = CallInst::Create(F, Args.begin(), Args.end(), "", CI);
+    CallInst *CINew = CallInst::Create(F, Args, "", CI);
     CINew->setCallingConv(CI->getCallingConv());
     CINew->setAttributes(CI->getAttributes());
     if(!CI->use_empty()) {





More information about the llvm-commits mailing list