similar to: [LLVMdev] Inserting a varargs function declaration with getOrInsertFunction()?

Displaying 20 results from an estimated 7000 matches similar to: "[LLVMdev] Inserting a varargs function declaration with getOrInsertFunction()?"

2014 Aug 31
2
[LLVMdev] Inserting Calls to var args Functions
Hi All, I am using code similar to giri instrumentation <https://github.com/liuml07/giri> framework to insert my instrumentation code. It works for normal functions for example to insert recordInt32 function below. void recordInt32(int32_t val){ printf("%d, ", val); } I can get recodedInt32 function in my Module using getOrInsert Function. Function* RecordInt32 =
2012 May 09
2
[LLVMdev] Calling C-language variadic functions
Such as printf, etc., from IR created using the API (IRBuilder). Google hasn't provided much help, and I can't find anything relevant in the docs (the docs talk about how to do varargs in LLVM ASM, but not how to call an external vararg function that exists in a library that gets linked to the LLVM module). Is there something special I need to do? Simply calling
2015 Jan 19
2
[LLVMdev] [INCOMPLETE] [GC] Support wrapping vararg functions in statepoint
I actually need this feature quite badly in my untyped language compiler: since I support first-class functions, I've made the types of all functions a standard vararg (so I can box them). The implementation crashes when I try to read out the value of gc.result. Hints as to what might be wrong? Signed-off-by: Ramkumar Ramachandra <artagnon at gmail.com> ---
2011 Apr 01
3
[LLVMdev] insert printf into IR
Hi All, I am trying to insert printf ("%d", v), where v is an integer param, into the IR. I am doing something wrong because I keep getting segfaults. Below is my code. Thanks. vector<const Type *> params; params.push_back(Type::getInt8PtrTy(M.getContext())); params.push_back(Type::getInt32Ty(M.getContext())); FunctionType *fType =
2008 Sep 13
3
[LLVMdev] Duplicate Function with duplicated Arguments
I'm now writing a pass and I wanna ask a question about how to duplicate the function and add duplicated arguments in llvm, for example: func(int a, char *b) -> func(int a, char *b, int a1, char *b1) I'm now stuck at using "getOrInsertFunction" and how to handle "getArgumentList", please share your opinion, thanks a lot! James
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,
2013 Apr 16
2
[LLVMdev] creating and inserting a function with variable arguments
I have tried it, but I always end up with some kind of error. Can you explain how can I get a function type for function which returns void (nothing) and it's arguments are (int, int, int, void *, void *, ...) ?? Thanks in advance. On Tue, Apr 16, 2013 at 7:22 AM, Óscar Fuentes <ofv at wanadoo.es> wrote: > Akshay Jain <jivan.molu at gmail.com> writes: > > > I am
2004 Aug 17
4
[LLVMdev] JIT API example (fibonacci)
Hi LLVMers, the example attached I have used to prove that JIT and some visible optimizations are really invoked. Proved OK. I got 30% speed-up in comparison to gcc 3.3.3 on my Athlon XP 1500. Nice. P.S. guys, no fears, I don't plan to flood the cvs repository with my "brilliant" examples ;) --- Valery A.Khamenya -------------- next part -------------- An
2012 May 09
0
[LLVMdev] Calling C-language variadic functions
Gregory Junker <gjunker at dayark.com> writes: > Such as printf, etc., from IR created using the API (IRBuilder). > > Google hasn't provided much help, and I can't find anything relevant in > the docs (the docs talk about how to do varargs in LLVM ASM, but not how > to call an external vararg function that exists in a library that gets > linked to the LLVM
2013 Apr 16
2
[LLVMdev] creating and inserting a function with variable arguments
I am working on a pass in which I need to define and insert a function with variable arguments. Can I do it with the help of getOrInsertFunction()? If not can someone tell me any other method? It will be very helpful if anyone can help. Thanks in advance -- *Akshay Jain * -------------- next part -------------- An HTML attachment was scrubbed... URL:
2008 Nov 12
2
[LLVMdev] RefineAbstractType
Is there some reason that RefineAbstractType doesn't recurse down DerivedTypes and further resolve abstract types? In Fortran it is possible to have a routine that takes a function pointer to a routine with the same signature. This is not possible to express in C/C++. I'm not sure it's possible to express in LLVM either without using varargs (opinions welcome). In a simpler C++
2009 Jul 31
2
[LLVMdev] Inserting Instructions (pass)
Hi, I' am trying to insert an InlineAsm Instruction in my pass, which FunctionType do I need for Inlineasm? If I understand it right, I need a call instruction to insert the new produced InlineAsm? Thanks for help, Michael for (BasicBlock::iterator bi = i->begin(), be = i->end(); bi != be; ++bi){ std::vector<const Type*> asm_arguments;
2011 Apr 26
2
[LLVMdev] inserting a fucntion call at the end of basic bloc
2011/4/26 Duncan Sands <baldrick at free.fr> > 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
2013 Apr 16
0
[LLVMdev] creating and inserting a function with variable arguments
Akshay Jain <jivan.molu at gmail.com> writes: > I am working on a pass in which I need to define and insert a function with > variable arguments. Can I do it with the help of getOrInsertFunction()? Sure. There is an overload of getOrInsertFunction that takes a FunctionType, and there are FunctionType::get static methods where you say if the function type takes a variable number of
2007 Jul 20
5
[LLVMdev] Seg faulting on vector ops
Hola LLVMers, I'm looking to make use of the vectorization primitives in the Intel chip with the code we generate from LLVM and so I've started experimenting with it. What is the state of the machine code generated for vectors? In my tinkering, I seem to be getting some wonky machine instructions, but I'm most likely just doing something wrong and I'm hoping you can set me in
2011 Mar 31
3
[LLVMdev] inserting exit function into IR
Hi Joshua, I have a function foo and I want to insert exit(0) at the end of foo. The problem is M.getFunction returns null, which is understandable. I am not sure what to do. Below is the code snippet. void foo(int argc, char* argv[]) { printf("hello world\n"); exit(0); //***I want to insert this exit } My llvm code snippet is vector<const Type *> params =
2009 Jul 31
0
[LLVMdev] Inserting Instructions (pass)
On Jul 31, 2009, at 10:24 AM, Michael Graumann wrote: > Hi, > I’ am trying to insert an InlineAsm Instruction in my pass, which > FunctionType do I need for Inlineasm? > If I understand it right, I need a call instruction to insert the > new produced InlineAsm? > > Thanks for help Inline asm works like a "callee". So for: call void asm sideeffect
2011 Mar 31
0
[LLVMdev] inserting exit function into IR
On Thu, Mar 31, 2011 at 9:31 PM, George Baah <georgebaah at gmail.com> wrote: > Hi Joshua, >       I have a function foo and I want to insert exit(0) at the end of foo. > The problem is M.getFunction returns null, which is understandable. I am not > sure what to do. Below is the code snippet. > void foo(int argc, char* argv[]) { >   printf("hello world\n"); >
2011 Apr 05
3
[LLVMdev] inserting a print statement into IR
Hi Everyone, I am trying to construct the print statement : printf("value:%d\n", value); This is my llvm code. It is seg faulting at builder.CreateGlobalStringPtr(str,""). Thanks. George vector<const Type *> params; params.push_back(Type::getInt8PtrTy(M.getContext())); FunctionType *fType = FunctionType::get(Type::getInt32Ty(M.getContext()), params, true); Constant
2015 Jan 20
3
[LLVMdev] [INCOMPLETE] [GC] Support wrapping vararg functions in statepoint
Philip Reames wrote: > Any change outside of statepoint lowering is highly suspect. Notice that SelectionDAGBuilder::LowerCallTo (the one I'm modifying) has exactly one other caller: visitCall, which doesn't match vararg functions. Every other codepath directly calls TargetLowering::LowerCallTo, supplying CallLoweringInfo information explicity (it's a structure with a vararg