search for: createcall2

Displaying 18 results from an estimated 18 matches for "createcall2".

Did you mean: createcall
2010 Jun 26
2
[LLVMdev] IRBuilder<>::CreateCall, CreateCall2, CreateCall3, ...
Hey guys, Whys are there like 5 variants of CreateCall in IRBuilder<> with numbers appended to them? The only difference I can see is the number of arguments. Aren't C++ function overloads be suited for this? Félix
2010 Jun 26
0
[LLVMdev] IRBuilder<>::CreateCall, CreateCall2, CreateCall3, ...
On Jun 25, 2010, at 6:24 PM, Félix Cloutier wrote: > Hey guys, > > Whys are there like 5 variants of CreateCall in IRBuilder<> with numbers appended to them? The only difference I can see is the number of arguments. Aren't C++ function overloads be suited for this? An overload could work, but this sort of API makes it more obvious which one you're trying to call and
2011 Jan 18
2
[LLVMdev] compiling a call to function in compiler
...sting.h, line 202. Code snippets... id testfunc(id a, id b) { ... } ... FunctionType *fn_type = FunctionType::get(id_type, argtypes, false); Value *fn = ConstantExpr::getIntToPtr(ConstantInt::get(int64_type, reinterpret_cast<int64_t>(testfunc)), fn_type); return builder.CreateCall2(fn, arg0val, arg1val); // <-- assertion fails here What am I doing wrong? I can paste more code if needed. thanks, Rob
2011 Apr 05
3
[LLVMdev] inserting a print statement into IR
...errs() << "printf function not in symbol table\n"; exit(1); } Function *f = cast<Function>(temp); f->setCallingConv(CallingConv::C); const char *str = "value: %d\n"; Value *intparam = ... Value *strPtr = builder.CreateGlobalStringPtr(str,""); builder.CreateCall2(PrintF, strPtr, intparam,"tmp6"); -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110404/1ba75642/attachment.html>
2011 Jan 18
0
[LLVMdev] compiling a call to function in compiler
...ets... > > id testfunc(id a, id b) { ... } > ... > FunctionType *fn_type = FunctionType::get(id_type, argtypes, false); > Value *fn = ConstantExpr::getIntToPtr(ConstantInt::get(int64_type, > reinterpret_cast<int64_t>(testfunc)), fn_type); > return builder.CreateCall2(fn, arg0val, arg1val); // <-- > assertion fails here > > What am I doing wrong? I can paste more code if needed. One of the types doesn't match the types of what you are trying to pass. You should debug which one it is and why the types aren't matching what you think they...
2011 Jan 18
1
[LLVMdev] compiling a call to function in compiler
...; wrote: > >    id testfunc(id a, id b) { ... } >    ... >    FunctionType *fn_type = FunctionType::get(id_type, argtypes, false); >    Value *fn = ConstantExpr::getIntToPtr(ConstantInt::get(int64_type, > reinterpret_cast<int64_t>(testfunc)), fn_type); >    return builder.CreateCall2(fn, arg0val, arg1val);   // <-- > assertion fails here > > What am I doing wrong?  I can paste more code if needed. > > One of the types doesn't match the types of what you are trying to pass. > You should debug which one it is and why the types aren't matching what &gt...
2015 Jan 05
2
[LLVMdev] LLVM linkage error - Program used external function 'foo' which could not be resolved!
Hi, All I got a linkage error as indicated in the subject line. Any suggestion? I created a call builder.CreateCall2(foo, p1, p2) in a module. foo is a Function* generated by module->getOrInsertFunction("foo", prototype). foo is defined outside of this module, and in the dump of the module, I see "declare i64 @foo(xxx, xxx)". The error happens during link time, it seems like my jitted funct...
2011 Apr 05
0
[LLVMdev] inserting a print statement into IR
...n symbol table\n"; > exit(1); > } > Function *f = cast<Function>(temp); > f->setCallingConv(CallingConv::C); > > const char *str = "value: %d\n"; > Value *intparam = ... > Value *strPtr = builder.CreateGlobalStringPtr(str,""); > builder.CreateCall2(PrintF, strPtr, intparam,"tmp6"); -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110404/4e4c363d/attachment.html>
2011 Apr 01
3
[LLVMdev] insert printf into IR
...ion("printf",fType); if(!temp){ errs() << "printf function not in symbol table\n"; exit(1); } Function *f = cast<Function>(temp); f->setCallingConv(CallingConv::C); Value *intparam = ... Value *strPtr = builder.CreateGlobalStringPtr(str,""); builder.CreateCall2(PrintF, strPtr, intparam,"tmp6"); -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110401/cecae798/attachment.html>
2013 Nov 04
0
[LLVMdev] Implementing an llvm.setreturnaddress intrinsic
...LVM has an llvm.returnaddress intrinsic, but for a specific project, I need to be able to modify the return address of a function as well, so I'm implementing a new intrinsic: def int_setreturnaddress : Intrinsic<[], [llvm_i32_ty, llvm_ptr_ty], []>; And I'm using it as follows: B.CreateCall2( Intrinsic::getDeclaration(M, Intrinsic::setreturnaddress), ConstantInt::get(Type::getInt32Ty(RI->getContext()), 0), B.CreateIntToPtr(ConstantInt::get(IntPtrTy, 0 /* testing */)), RA->getReturnType())); The problem I'm facing is that for some reason, my following line inside X86Tar...
2013 Dec 20
0
[LLVMdev] A problem about convert a string to a *i8 pointer
...ntegerType::getInt32Ty(ctx)); // what's the function of the three line code below? std::vector<llvm::Constant*> indices; indices.push_back(zero); indices.push_back(zero); Constant *test_var = ConstantExpr::getGetElementPtr(g_print,indices); and then I use CallInst *call = builder.CreateCall2(call_print_ptr,var_ref,test_var); to create the instruction and insert it. The method works well .But I didn't know the function of the std::vector<llvm::Constant*> indices; indices.push_back(zero); indices.push_back(zero); is that just create a arrayRef that can be the parameter of...
2008 Jun 19
1
[LLVMdev] Constant function pointers and inlining
...cated: Value* handler = ConstantExpr::getIntToPtr( ConstantInt::get(Type::Int32Ty, (unsigned int) engine->runFunction(get_handler, args).PointerVal), PointerType::get(handler_type, 0)); /* ^^^^^ Is there a better way to do the conversion? ^^^^^^ */ Value* result = builder.CreateCall2(handler, execute_data, tsrlm_ref, "execute_result"); And as a result I get handler calls like this: %execute_result9 = tail call i32 inttoptr (i32 54000728 to i32 (%struct.zend_execute_data*, i8***)*)( %struct.zend_execute_data* %execute_data, i8*** %1 ) However, I haven&...
2011 Sep 22
2
[LLVMdev] Need help in converting int to double
...s); > > //return the value > mBuilder.CreateRet(mBuilder.CreateLoad(returnValue)); > > > /* > * create call to SHL function > */ > mCurrentFunction = previousFunction; > mBuilder.SetInsertPoint(previousBlock); > > return mBuilder.CreateCall2(shlFunction, aLHS, aRHS); > > > > On Thu, Sep 22, 2011 at 3:40 PM, James Molloy <James.Molloy at arm.com>wrote: > >> Hi Sarath, >> >> Your example will break. >> >> If the values are held internally as doubles casted to void* (which >> incide...
2015 Aug 05
2
[BUG] Incorrect ASCII escape characters on Mac
On Wed, 2015-08-05 at 10:02 -0400, Ramkumar Ramachandra wrote: > > - at 5 = internal global [10 x i8] c"\22\D0\12\F4!\00\15\F9\EC\E1" > - at 6 = internal global [10 x i8] c"\D0\19\FB+\FD\F8#\03\E2\11" > + at 5 = internal global [10 x i8] c"\22Ð\12ô!\00\15ùìá" > + at 6 = internal global [10 x i8] c"Ð\19û+ýø#\03â\11" > > The diff
2011 Sep 22
0
[LLVMdev] Need help in converting int to double
...AssignDoubleTypeVar(mBuilder.CreateLoad(returnValue), lhs); //return the value mBuilder.CreateRet(mBuilder.CreateLoad(returnValue)); /* * create call to SHL function */ mCurrentFunction = previousFunction; mBuilder.SetInsertPoint(previousBlock); return mBuilder.CreateCall2(shlFunction, aLHS, aRHS); On Thu, Sep 22, 2011 at 3:40 PM, James Molloy <James.Molloy at arm.com<mailto:James.Molloy at arm.com>> wrote: Hi Sarath, Your example will break. If the values are held internally as doubles casted to void* (which incidentally will only work on 64-bit syst...
2011 Sep 22
3
[LLVMdev] Need help in converting int to double
Hi, I'm pursuing M.Tech course. As a part of the project work i'm using LLVM as back-end. My project area is "Enhancing the performance of V8 javascript engine using LLVM as a back-end". Now i'm writing code for shift left(SHL) operator. I had my own Value Structure .. it's like this Struct Value { void *val ; char type; } The "char type" holds
2011 Sep 22
1
[LLVMdev] Need help in converting int to double
...s); > > //return the value > mBuilder.CreateRet(mBuilder.CreateLoad(returnValue)); > > > /* > * create call to SHL function > */ > mCurrentFunction = previousFunction; > mBuilder.SetInsertPoint(previousBlock); > > return mBuilder.CreateCall2(shlFunction, aLHS, aRHS);**** > > > > **** > > On Thu, Sep 22, 2011 at 3:40 PM, James Molloy <James.Molloy at arm.com> > wrote:**** > > Hi Sarath, > > Your example will break. > > If the values are held internally as doubles casted to void* (which > i...
2011 Apr 05
2
[LLVMdev] inserting a print statement into IR
...ymbol table\n"; > exit(1); > } > Function *f = cast<Function>(temp); > f->setCallingConv(CallingConv::C); > > const char *str = "value: %d\n"; > Value *intparam = ... > Value *strPtr = builder.CreateGlobalStringPtr(str,""); > builder.CreateCall2(PrintF, strPtr, intparam,"tmp6"); > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > -------------- next part ---...