search for: llvmgetparam

Displaying 14 results from an estimated 14 matches for "llvmgetparam".

2010 Dec 21
2
[LLVMdev] the optional function return attribute and the llvm-c bindings
...index ~0U. Yes, that's what the documentation seems to say is the proper mode for indexing the return parameter, but when I set an attribute on the parameter with index zero, it gets applied to the first function argument and not the return parameter. I believe the reason for this to be that LLVMGetParams() [and its cognates] all use Function::arg_iterator, which begins with the first function *argument* parameter and not the return parameter. The index argument to LLVMGetParams() is actually incremented by one when it's mapped to the index used for the Function::AttributeList member. There a...
2012 Apr 25
2
[LLVMdev] Crash in JIT
...= LLVMInt32TypeInContext(llvm); LLVMTypeRef funcType; LLVMTypeRef threeInts[] = {int32, int32, int32}; funcType = LLVMFunctionType(int32, threeInts, 3, 0); LLVMValueRef func; func = LLVMAddFunction(module, "functionName", funcType); LLVMValueRef mParam = LLVMGetParam(func, 0); LLVMSetValueName(mParam, "m"); LLVMValueRef xParam = LLVMGetParam(func, 1); LLVMSetValueName(xParam, "x"); LLVMValueRef bParam = LLVMGetParam(func, 2); LLVMSetValueName(bParam, "b"); LLVMBasicBlockRef entryBB; entryB...
2012 Apr 25
0
[LLVMdev] Crash in JIT
...int32 = LLVMInt32TypeInContext(llvm); LLVMTypeRef funcType; LLVMTypeRef threeInts[] = {int32, int32, int32}; funcType = LLVMFunctionType(int32, threeInts, 3, 0); LLVMValueRef func; func = LLVMAddFunction(module, "functionName", funcType); LLVMValueRef mParam = LLVMGetParam(func, 0); LLVMSetValueName(mParam, "m"); LLVMValueRef xParam = LLVMGetParam(func, 1); LLVMSetValueName(xParam, "x"); LLVMValueRef bParam = LLVMGetParam(func, 2); LLVMSetValueName(bParam, "b"); LLVMBasicBlockRef entryBB; entryBB = LLVMA...
2010 Dec 22
0
[LLVMdev] the optional function return attribute and the llvm-c bindings
...t; Yes, that's what the documentation seems to say is the proper mode for indexing the return parameter, but when I set an attribute on the parameter with index zero, it gets applied to the first function argument and not the return parameter. > > I believe the reason for this to be that LLVMGetParams() [and its cognates] all use Function::arg_iterator, which begins with the first function *argument* parameter and not the return parameter. The index argument to LLVMGetParams() is actually incremented by one when it's mapped to the index used for the Function::AttributeList member. There a...
2010 Dec 21
2
[LLVMdev] the optional function return attribute and the llvm-c bindings
everyone-- Is it my imagination, or is there no way in LLVM 2.8 (or current trunk) to use the facilities defined in <llvm-c/Core.h> to get or set the optional return parameter attribute on a function value? All the functions in the "Operations on parameters" parameters section actually seem to work only on the function arguments and not the return parameter. Is this intentional?
2010 Dec 21
0
[LLVMdev] the optional function return attribute and the llvm-c bindings
Hi James, > Is it my imagination, or is there no way in LLVM 2.8 (or current trunk) to use the facilities defined in<llvm-c/Core.h> to get or set the optional return parameter attribute on a function value? > > All the functions in the "Operations on parameters" parameters section actually seem to work only on the function arguments and not the return parameter. Is this
2010 Sep 07
0
[LLVMdev] Intrinsic prototype has incorrect number of arguments!
On Sep 7, 2010, at 8:03 AM, F van der Meeren wrote: > Hello, > > I have a question, what is wrong with the following code? > > declare void @llvm.memcpy.p0i64.p0i64.i8(i64*, i64*, i8, i32, i1) nounwind > > ... > > call void @llvm.memcpy.p0i64.p0i64.i8(i64* %19, i64* %21, i8 %17, i32 0, i1 false) > > ... > > > According to the compiler this is the
2010 Sep 07
2
[LLVMdev] Intrinsic prototype has incorrect number of arguments!
...context), LLVMInt1TypeInContext(context), }; functionType = LLVMFunctionType(LLVMVoidTypeInContext(context), paramTypes, numberOfArguments, false); function = LLVMAddFunction(module, methodName, functionType); LLVMRemoveAttribute(LLVMGetParam(function, 0), LLVMNoCaptureAttribute); LLVMRemoveAttribute(LLVMGetParam(function, 1), LLVMNoCaptureAttribute); } And then invoked it with this: LLVMValueRef args[] = { sourcePtr, destinationPtr, lengthInteger, LLVMConstInt(LLVMInt32TypeInContext(context), 0, tr...
2017 Jan 25
2
mcjit C interface problems
...aram_types, 2, 0); LLVMValueRef sum = LLVMAddFunction(mod, "sum", ret_type); LLVMBasicBlockRef entry = LLVMAppendBasicBlock(sum, "entry"); LLVMBuilderRef builder = LLVMCreateBuilder(); LLVMPositionBuilderAtEnd(builder, entry); LLVMValueRef tmp = LLVMBuildAdd(builder, LLVMGetParam(sum, 0), LLVMGetParam(sum, 1), "tmp"); LLVMBuildRet(builder, tmp); char* error = NULL; LLVMVerifyModule(mod, LLVMAbortProcessAction, &error); LLVMDisposeMessage(error); LLVMExecutionEngineRef engine; error = NULL; LLVMLinkInMCJIT(); LLVMInitializeNativeTarget(); LL...
2010 Sep 07
4
[LLVMdev] Intrinsic prototype has incorrect number of arguments!
Hello, I have a question, what is wrong with the following code? declare void @llvm.memcpy.p0i64.p0i64.i8(i64*, i64*, i8, i32, i1) nounwind ... call void @llvm.memcpy.p0i64.p0i64.i8(i64* %19, i64* %21, i8 %17, i32 0, i1 false) ... According to the compiler this is the error, but I seem to miss where exactly my fault is. Intrinsic prototype has incorrect number of arguments! void (i64*,
2015 Feb 19
4
[LLVMdev] Parameter names in IR and debug info
...h formal and the function result. 2. Build a function type using LLVMFunctionType, from the results of 1. 3. Build a function (an LLVMValueRef), using LLVMAddFunction, from the result of 2. 4. Get the LLVMValueRef for each formal (apparently, these are constructed inside LLVMAddFunction), using LLVMGetParam, from the result of 3. 5. Set the formal name using LLVMSetValueName, from each result of 5. Which appears to imply that the formal names are part of the function, not the function type, and thus the function type could be reused for another function whose signature differs only in the names of th...
2010 Aug 18
0
[LLVMdev] a typo in OCaml bindings
Hi, revision 111418 binding/ocaml/llvm/llvm_ocaml.c /* llvalue -> int -> llvalue */ CAMLprim value llvm_params(LLVMValueRef Fn, value Index) { value Params = alloc(LLVMCountParams(Fn), 0); LLVMGetParams(Fn, (LLVMValueRef *) Op_val(Params)); return Params; } does not match the interface at binding/ocaml/llvm/llvm.ml external params : llvalue -> llvalue array = "llvm_params" It should be /* llvalue -> llvalue */ CAMLprim value llvm_params(LLVMValueRef Fn) { ... This cannot be...
2009 Nov 05
2
[LLVMdev] Strange error for libLLVMCore.a
...ed reference to `LLVMInt32Type' c:\Work\llvm//fac.c:22: undefined reference to `LLVMFunctionType' c:\Work\llvm//fac.c:22: undefined reference to `LLVMAddFunction' c:\Work\llvm//fac.c:23: undefined reference to `LLVMSetFunctionCallConv' c:\Work\llvm//fac.c:24: undefined reference to `LLVMGetParam' c:\Work\llvm//fac.c:26: undefined reference to `LLVMAppendBasicBlock' c:\Work\llvm//fac.c:27: undefined reference to `LLVMAppendBasicBlock' c:\Work\llvm//fac.c:28: undefined reference to `LLVMAppendBasicBlock' c:\Work\llvm//fac.c:29: undefined reference to `LLVMAppendBasicBlock'...
2013 Sep 30
1
[LLVMdev] RFC: llvm-shlib-test (Was: [llvm] r191029 - llvm-c: Make LLVMGetFirstTarget a proper prototype)
Attached is what I got thus far. What I'm struggling with is proper integration in build system. What is in there is just wild guesses from my side, both on autoconf and cmake variants. It would be great if someone with proper knowledge of the buildsystems could have a look. Also I'm not sure how to properly handle compilation on msvc - clearly "-std=c11 -Wstrict-prototypes" is