search for: func_consum

Displaying 9 results from an estimated 9 matches for "func_consum".

Did you mean: func_consume
2011 Apr 26
1
[LLVMdev] inserting a fucntion call at the end of basic bloc
...FunctionType* FuncTy_3 = FunctionType::get( /*Result=*/Type::getVoidTy(M.getContext()), /*Params=*/FuncTy_3_args, /*isVarArg=*/false); Constant *consum = M.getOrInsertFunction("consume", FuncTy_3); llvm::Function* func_consume = llvm::cast<llvm::Function > (consum); func_consume ->setLinkage(GlobalValue::ExternalLinkage); func_consume->setCallingConv(CallingConv::C); AttrListPtr func_consume_PAL; func_consume->setAttributes(func_consume_PAL); i have tried t...
2011 Apr 26
2
[LLVMdev] inserting a fucntion call at the end of basic bloc
...> (i->size()); >> ConstantInt* inValue = ConstantInt::get(Type::getInt32Ty(Context), n); >> std::vector<Value*> int32_16_params; >> int32_16_params.push_back(inValue); >> int32_16_params.push_back(gvar_int32_y); >> CallInst* int32_16 = CallInst::Create(func_consume, >> int32_16_params.begin(), >> int32_16_params.end(), "", ii); >> > > where did the "noalias" attribute and "tail call" (rather than "call") come > from? Are you setting these yourself or running some optimization pass > after...
2011 Apr 26
0
[LLVMdev] inserting a fucntion call at the end of basic bloc
Hi Nabila, > where did the "noalias" attribute and "tail call" (rather than "call") come > from? Are you setting these yourself or running some optimization pass after > your pass? > > > i have written a module pass and i have compiled it and then you didn't answer my questions, you just repeated what you said before. Ciao,
2011 Apr 26
2
[LLVMdev] inserting a fucntion call at the end of basic bloc
...etTerminator(); const int n = cast <int> (i->size()); ConstantInt* inValue = ConstantInt::get(Type::getInt32Ty(Context), n); std::vector<Value*> int32_16_params; int32_16_params.push_back(inValue); int32_16_params.push_back(gvar_int32_y); CallInst* int32_16 = CallInst::Create(func_consume, int32_16_params.begin(), int32_16_params.end(), "", ii); -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110426/401ffb3b/attachment.html>
2011 Apr 26
0
[LLVMdev] inserting a fucntion call at the end of basic bloc
...= cast <int> (i->size()); > ConstantInt* inValue = ConstantInt::get(Type::getInt32Ty(Context), n); > std::vector<Value*> int32_16_params; > int32_16_params.push_back(inValue); > int32_16_params.push_back(gvar_int32_y); > CallInst* int32_16 = CallInst::Create(func_consume, int32_16_params.begin(), > int32_16_params.end(), "", ii); where did the "noalias" attribute and "tail call" (rather than "call") come from? Are you setting these yourself or running some optimization pass after your pass? Ciao, Duncan.
2011 Apr 26
2
[LLVMdev] inserting a fucntion call at the end of basic bloc
...cntion in another object file and linked it to the in fact the fucntion is : void consume(int , int * ); std::vector<Value*> int32_16_params; int32_16_params.push_back(inValue);//inValue is ConstantInt* inValue int32_16_params.push_back(gvar_int32_y); CallInst* int32_16 = CallInst::Create(func_consume, int32_16_params.begin(), int32_16_params.end(), "", ii); compilation without errors Now when i tried this pass an error says: Wrong type for attribute noalias tail call void @consume(i32 noalias 3, i32* @y) nounwind Wrong type for attribute noalias tail call void @consume(i32 noalias...
2011 Apr 26
0
[LLVMdev] inserting a fucntion call at the end of basic bloc
Hi Nabila, > Now when i tried this pass an error says: > Wrong type for attribute noalias > tail call void @consume(i32 noalias 3, i32* @y) nounwind noalias is only for arguments of pointer type. You probably meant it to be on the second argument rather than the first. I suggest you correct your code that adds the attribute. Ciao, Duncan.
2011 Apr 25
0
[LLVMdev] inserting a fucntion call at the end of basic bloc
Hi Nabila, > My problem is how to call a method > suppose this fucntion > void A(int x) > { > x=x+1; > > } > > should i define this function and declare it at the beginig of the module and > create for it a basic bloc? you can just declare the function (i.e. no need to give it a body), and call it. You can then link with an object file that defines it. This is
2011 Apr 25
2
[LLVMdev] inserting a fucntion call at the end of basic bloc
2011/4/25 Duncan Sands <baldrick at free.fr> > Hi Nabila, > > > i would like insert a fucntion call at the end of each basic bloc > > you can't, because only terminators are allowed at the end of a basic > block. > However you can try to insert the call before the terminator. > Yes, i mean before the termininator, My problem is how to call a method suppose