[llvm-commits] [poolalloc] r137079 - in /poolalloc/trunk: include/assistDS/ArgCast.h include/assistDS/Devirt.h include/assistDS/FuncSimplify.h include/assistDS/FuncSpec.h lib/AssistDS/Devirt.cpp lib/AssistDS/DynCount.cpp lib/AssistDS/FuncSpec.cpp

Arushi Aggarwal aggarwa4 at illinois.edu
Mon Aug 8 17:18:22 PDT 2011


Author: aggarwa4
Date: Mon Aug  8 19:18:22 2011
New Revision: 137079

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

Modified:
    poolalloc/trunk/include/assistDS/ArgCast.h
    poolalloc/trunk/include/assistDS/Devirt.h
    poolalloc/trunk/include/assistDS/FuncSimplify.h
    poolalloc/trunk/include/assistDS/FuncSpec.h
    poolalloc/trunk/lib/AssistDS/Devirt.cpp
    poolalloc/trunk/lib/AssistDS/DynCount.cpp
    poolalloc/trunk/lib/AssistDS/FuncSpec.cpp

Modified: poolalloc/trunk/include/assistDS/ArgCast.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/ArgCast.h?rev=137079&r1=137078&r2=137079&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/ArgCast.h (original)
+++ poolalloc/trunk/include/assistDS/ArgCast.h Mon Aug  8 19:18:22 2011
@@ -14,6 +14,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Instructions.h"
+#include "llvm/Constants.h"
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
 
@@ -27,7 +28,7 @@
   class ArgCast : public ModulePass {
   public:
     static char ID;
-    ArgCast() : ModulePass(&ID) {}
+    ArgCast() : ModulePass(ID) {}
     virtual bool runOnModule(Module& M);
   };
 }

Modified: poolalloc/trunk/include/assistDS/Devirt.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/Devirt.h?rev=137079&r1=137078&r2=137079&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/Devirt.h (original)
+++ poolalloc/trunk/include/assistDS/Devirt.h Mon Aug  8 19:18:22 2011
@@ -57,7 +57,7 @@
 
     public:
       static char ID;
-      Devirtualize() : ModulePass(&ID), CTF(0) {}
+      Devirtualize() : ModulePass(ID), CTF(0) {}
 
       virtual bool runOnModule(Module & M);
 

Modified: poolalloc/trunk/include/assistDS/FuncSimplify.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/FuncSimplify.h?rev=137079&r1=137078&r2=137079&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/FuncSimplify.h (original)
+++ poolalloc/trunk/include/assistDS/FuncSimplify.h Mon Aug  8 19:18:22 2011
@@ -23,7 +23,7 @@
   class FuncSimplify : public ModulePass {
   public:
     static char ID;
-    FuncSimplify() : ModulePass(&ID) {}
+    FuncSimplify() : ModulePass(ID) {}
     virtual bool runOnModule(Module& M);
   };
 }

Modified: poolalloc/trunk/include/assistDS/FuncSpec.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/FuncSpec.h?rev=137079&r1=137078&r2=137079&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/FuncSpec.h (original)
+++ poolalloc/trunk/include/assistDS/FuncSpec.h Mon Aug  8 19:18:22 2011
@@ -28,7 +28,7 @@
   class FuncSpec : public ModulePass {
   public:
     static char ID;
-    FuncSpec() : ModulePass(&ID) {}
+    FuncSpec() : ModulePass(ID) {}
     virtual bool runOnModule(Module& M);
   };
 }

Modified: poolalloc/trunk/lib/AssistDS/Devirt.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/Devirt.cpp?rev=137079&r1=137078&r2=137079&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/Devirt.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/Devirt.cpp Mon Aug  8 19:18:22 2011
@@ -42,7 +42,7 @@
 //
 static inline
 PointerType * getVoidPtrType (LLVMContext & C) {
-  const Type * Int8Type  = IntegerType::getInt8Ty(C);
+  Type * Int8Type  = IntegerType::getInt8Ty(C);
   return PointerType::getUnqual(Int8Type);
 }
 
@@ -53,7 +53,7 @@
 //  Given an LLVM value, insert a cast instruction to make it a given type.
 //
 static inline Value *
-castTo (Value * V, const Type * Ty, std::string Name, Instruction * InsertPt) {
+castTo (Value * V, Type * Ty, std::string Name, Instruction * InsertPt) {
   //
   // Don't bother creating a cast if it's already the correct type.
   //
@@ -147,7 +147,7 @@
   // will be the function to call.
   //
   Value* ptr = CS.getCalledValue();
-  std::vector<const Type *> TP;
+  std::vector<Type *> TP;
   TP.insert (TP.begin(), ptr->getType());
   for (CallSite::arg_iterator i = CS.arg_begin();
        i != CS.arg_end();
@@ -155,7 +155,7 @@
     TP.push_back ((*i)->getType());
   }
 
-  const FunctionType* NewTy = FunctionType::get(CS.getType(), TP, false);
+  FunctionType* NewTy = FunctionType::get(CS.getType(), TP, false);
   Module * M = CS.getInstruction()->getParent()->getParent()->getParent();
   Function* F = Function::Create (NewTy,
                                   GlobalValue::InternalLinkage,
@@ -193,8 +193,7 @@
     targets[FL] = BL;
     // Create the direct function call
     Value* directCall = CallInst::Create ((Value *)FL,
-                                          fargs.begin(),
-                                          fargs.end(),
+                                          fargs,
                                           "",
                                           BL);
 
@@ -224,7 +223,7 @@
   // Create basic blocks which will test the value of the incoming function
   // pointer and branch to the appropriate basic block to call the function.
   //
-  const Type * VoidPtrType = getVoidPtrType (M->getContext());
+  Type * VoidPtrType = getVoidPtrType (M->getContext());
   Value * FArg = castTo (F->arg_begin(), VoidPtrType, "", InsertPt);
   BasicBlock * tailBB = failBB;
   for (unsigned index = 0; index < Targets.size(); ++index) {
@@ -265,8 +264,9 @@
   //
   // Make the entry basic block branch to the first comparison basic block.
   //
-  InsertPt->setUnconditionalDest (tailBB);
-
+  //InsertPt->setUnconditionalDest (tailBB);
+  InsertPt->setSuccessor(0, tailBB);
+  InsertPt->setSuccessor(1, tailBB);
   //
   // Return the newly created bounce function.
   //
@@ -323,8 +323,7 @@
       std::vector<Value*> Params (CI->op_begin(), CI->op_end());
       std::string name = CI->hasName() ? CI->getNameStr() + ".dv" : "";
       CallInst* CN = CallInst::Create ((Value *) NF,
-                                       Params.begin(),
-                                       Params.end(),
+                                       Params,
                                        name,
                                        CI);
       CI->replaceAllUsesWith(CN);
@@ -335,8 +334,7 @@
       InvokeInst* CN = InvokeInst::Create((Value *) NF,
                                           CI->getNormalDest(),
                                           CI->getUnwindDest(),
-                                          Params.begin(),
-                                          Params.end(),
+                                          Params,
                                           name,
                                           CI);
       CI->replaceAllUsesWith(CN);

Modified: poolalloc/trunk/lib/AssistDS/DynCount.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/DynCount.cpp?rev=137079&r1=137078&r2=137079&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/DynCount.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/DynCount.cpp Mon Aug  8 19:18:22 2011
@@ -15,6 +15,7 @@
 #include "llvm/Pass.h"
 #include "llvm/Module.h"
 #include "llvm/Instructions.h"
+#include "llvm/Constants.h"
 #include "llvm/Target/TargetData.h"
 #include "dsa/TypeSafety.h"
 
@@ -27,7 +28,7 @@
 
 public:
   static char ID;
-  Dyncount () : ModulePass ((intptr_t) &ID) { }
+  Dyncount () : ModulePass (ID) { }
   const char *getPassName() const {
     return "Count safe/unsafe load/store";
   }
@@ -132,7 +133,7 @@
   std::vector<Value *> args;
   args.push_back (Total);
   args.push_back (Safe);
-  CallInst::Create (Setup, args.begin(), args.end(), "", BB.getFirstNonPHI());
+  CallInst::Create (Setup, args, "", BB.getFirstNonPHI());
 
 
   return true;

Modified: poolalloc/trunk/lib/AssistDS/FuncSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/FuncSpec.cpp?rev=137079&r1=137078&r2=137079&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/FuncSpec.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/FuncSpec.cpp Mon Aug  8 19:18:22 2011
@@ -71,7 +71,7 @@
       // Now find all call sites that it is called from
       for(Value::use_iterator ui = I->use_begin(), ue = I->use_end();
           ui != ue; ++ui) {
-        if (CallInst* CI = dyn_cast<CallInst>(ui)) {
+        if (CallInst* CI = dyn_cast<CallInst>(*ui)) {
           // Check that it is the called value (and not an argument)
           if(CI->getCalledValue()->stripPointerCasts() == I) {
             std::vector<std::pair<unsigned, Constant*> > Consts;





More information about the llvm-commits mailing list