From: Chris Lattner Date: Sun, 31 Aug 2003 00:21:05 +0000 (+0000) Subject: Use the new interface, simplifies code X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=30aef423d16f351b311557743e12d2686b722243;p=oota-llvm.git Use the new interface, simplifies code Delete a bunch of commented out code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8240 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp b/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp index 9ba8731e92b..f2e0a57e48e 100644 --- a/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp +++ b/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp @@ -27,22 +27,16 @@ using std::vector; static void getTriggerCode(Module *M, BasicBlock *BB, int MethNo, Value *pathNo, Value *cnt, Instruction *rInst){ - vector args; - //args.push_back(PointerType::get(Type::SByteTy)); - args.push_back(Type::IntTy); - args.push_back(Type::IntTy); - //args.push_back(Type::IntTy); - args.push_back(PointerType::get(Type::IntTy)); - args.push_back(PointerType::get(Type::IntTy)); - const FunctionType *MTy = FunctionType::get(Type::VoidTy, args, false); - vector tmpVec; tmpVec.push_back(Constant::getNullValue(Type::LongTy)); tmpVec.push_back(Constant::getNullValue(Type::LongTy)); Instruction *Idx = new GetElementPtrInst(cnt, tmpVec, "");//, BB->getInstList().push_back(Idx); - Function *trigMeth = M->getOrInsertFunction("trigger", MTy); + const Type *PIntTy = PointerType::get(Type::IntTy); + Function *trigMeth = M->getOrInsertFunction("trigger", Type::VoidTy, + Type::IntTy, Type::IntTy, + PIntTy, PIntTy, 0); assert(trigMeth && "trigger method could not be inserted!"); vector trargs; @@ -277,39 +271,6 @@ void insertInTopBB(BasicBlock *front, //store uint 0, uint *%R new StoreInst(Int0, rVar, here); - - //insert initialize function for initializing - //vector inCountArgs; - //inCountArgs.push_back(PointerType::get(Type::IntTy)); - //inCountArgs.push_back(Type::IntTy); - - //const FunctionType *cFty = FunctionType::get(Type::VoidTy, inCountArgs, - // false); -//Function *inCountMth = front->getParent()->getParent()->getOrInsertFunction("llvmInitializeCounter", cFty); -//assert(inCountMth && "Initialize method could not be inserted!"); - -//vector iniArgs; -//iniArgs.push_back(countVar); -//iniArgs.push_back(ConstantSInt::get(Type::IntTy, k)); -//new CallInst(inCountMth, iniArgs, "", here); - -/* - if(front->getParent()->getName() == "main"){ - //intialize threshold - vector initialize_args; - initialize_args.push_back(PointerType::get(Type::IntTy)); - - const FunctionType *Fty = FunctionType::get(Type::VoidTy, initialize_args, - false); - Function *initialMeth = front->getParent()->getParent()->getOrInsertFunction("reoptimizerInitialize", Fty); - assert(initialMeth && "Initialize method could not be inserted!"); - - vector trargs; - trargs.push_back(threshold); - - new CallInst(initialMeth, trargs, "", here); - } -*/ }