search for: llvmfunctiontyp

Displaying 16 results from an estimated 16 matches for "llvmfunctiontyp".

Did you mean: llvmfunctiontype
2010 Aug 12
3
[LLVMdev] LLVM-C: Calling functions contained in other libraries
...Ref i8Ptr(void) { return LLVMPointerType(LLVMInt8Type(), 0); } LLVMValueRef d(LLVMModuleRef module) { LLVMValueRef result; LLVMBasicBlockRef block; LLVMBuilderRef builder = LLVMCreateBuilder(); LLVMValueRef fullUsername = LLVMAddFunction(module, "NSFullUserName", LLVMFunctionType(LLVMPointerType(LLVMInt8Type(), 0), NULL, 0, 0)); LLVMSetLinkage(fullUsername, LLVMExternalLinkage); result = LLVMAddFunction(module, "MyFunction", LLVMFunctionType(i8Ptr(), NULL, 0, 0)); block = LLVMAppendBasicBlock(result, "entrypoint"); LLVMPositionBuild...
2012 Sep 27
0
[LLVMdev] Possible bug or misunderstanding of feature LLVMConstIntOfString
...eRef modCEx = LLVMModuleCreateWithNameInContext(moduleName, context); // "main" function type definition: LLVMTypeRef ppInt8 = LLVMPointerType(LLVMPointerType(LLVMInt8Type(), 0), 0); LLVMTypeRef vpMainFuncTypes[] = { LLVMInt32Type(), ppInt8 }; LLVMTypeRef rMainFuncType = LLVMFunctionType(LLVMInt32Type(), vpMainFuncTypes, 2, 0); LLVMValueRef vFnMain = LLVMAddFunction(modCEx, "main", rMainFuncType); LLVMSetFunctionCallConv(vFnMain, LLVMCCallConv); LLVMBasicBlockRef bEntry = LLVMAppendBasicBlock(vFnMain, "entry"); LLVMBuilderRef bldr = LLVMCreate...
2009 Nov 05
2
[LLVMdev] Strange error for libLLVMCore.a
...o -o fac fac.o: In function `main': c:\Work\llvm//fac.c:20: undefined reference to `LLVMModuleCreateWithName' c:\Work\llvm//fac.c:21: undefined reference to `LLVMInt32Type' c:\Work\llvm//fac.c:22: undefined 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...
2017 Aug 17
3
How do set 'nest' addribute in an indirect call?
I need to set the 'next' attribute on a parameter. If the function is to be directly called, i.e., a function constant, I am getting what I want as follows (using the C 'Core.h' binding) 1) Build a function type, using LLVMFunctionType. 2) Build a function value, passing the result of 1) to LLVMAddFunction 3) Go through the formal parameters of 2), using LLVMGet[First|Next]Param, which give me a value for each formal 4) For the desired formal, pass it to LLVMAddAttribute. This results in compiled code that passes my paramet...
2015 Feb 19
4
[LLVMdev] Parameter names in IR and debug info
...for a function type and a function (value), in particular, how to supply the names of the formal parameters? To create a function in llvm IR and give names to its formal parameters, I must: 1. Build a LLVMTypeRef for the type of each 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 LLVMSetValueNam...
2012 Apr 25
2
[LLVMdev] Crash in JIT
...out(module, "i686-apple-darwin11"); <-- is needed? What is correct? LLVMSetTarget(module, "i686-apple-darwin11"); LLVMTypeRef 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(xPa...
2009 Nov 05
0
[LLVMdev] Strange error for libLLVMCore.a
you want to use the execution engine and JIT but do not put them in the llvm-config line?? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091106/d26a0a02/attachment.html>
2017 Sep 18
0
Counterintuitive use of LLVMBool in C-API?
Okay after translating the headers to Delphi, i found more inconsistencies: > LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType, > LLVMTypeRef *ParamTypes, unsigned ParamCount, > LLVMBool IsVarArg); > In this case it is the other way around. 0 means False and anything else means true :/ (so it acts more like a "traditional"...
2012 Apr 25
0
[LLVMdev] Crash in JIT
...ataLayout(module, "i686-apple-darwin11"); <-- is needed? What is correct? LLVMSetTarget(module, "i686-apple-darwin11"); LLVMTypeRef 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, &...
2016 Sep 12
1
Counterintuitive use of LLVMBool in C-API?
Of course, this is normal for C-APIs. But maybe change the name to LLVMResult to propagate the real use? I am not arguing about the results themself. They are standard. But the name is missguiding. As long as it's consistent i know that i have to write an extra record operator in Delphi to reflect this. 2016-09-12 11:11 GMT+02:00 David Chisnall <David.Chisnall at cl.cam.ac.uk>: > On
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!
...for the function or create it. if((function = LLVMGetNamedFunction(module, methodName)) == NULL) { LLVMTypeRef paramTypes [] = { dstType, srcType, lengthType, LLVMInt32TypeInContext(context), LLVMInt1TypeInContext(context), }; functionType = LLVMFunctionType(LLVMVoidTypeInContext(context), paramTypes, numberOfArguments, false); function = LLVMAddFunction(module, methodName, functionType); LLVMRemoveAttribute(LLVMGetParam(function, 0), LLVMNoCaptureAttribute); LLVMRemoveAttribute(LLVMGetParam(functio...
2017 Jan 25
2
mcjit C interface problems
....0, and it doesn't seem to work. This code is derived from Paul Smith's example code: int main(int argc, char const* argv[]) { LLVMModuleRef mod = LLVMModuleCreateWithName("my_module"); LLVMTypeRef param_types[] = {LLVMInt32Type(), LLVMInt32Type()}; LLVMTypeRef ret_type = LLVMFunctionType(LLVMInt32Type(), param_types, 2, 0); LLVMValueRef sum = LLVMAddFunction(mod, "sum", ret_type); LLVMBasicBlockRef entry = LLVMAppendBasicBlock(sum, "entry"); LLVMBuilderRef builder = LLVMCreateBuilder(); LLVMPositionBuilderAtEnd(builder, entry); LLVMValueRef tmp = LL...
2011 Jun 18
1
[LLVMdev] loop only executes once
...label %Else ewhile: ; preds = %Else %CR = load i32* %C ret i32 %CR } Source of function Procedure CreateFibFunction(M.i,Context.i) intType = LLVMInt32Type() //Function returns an int And takes an int As the only parameter. FunctionReturnType = LLVMFunctionType(IntType, at IntType,1,0) //Create the fib function definition And insert it into the module M. Fib2 = LLVMAddFunction(M, "fib2",FunctionReturnType) //Set the function call convention To FastCall so it can utilize tail call LLVMSetFunctionCallConv(Fib2,#LLVMFastCallConv) //Get a pointe...
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*,
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