search for: llvmpositionbuilderatend

Displaying 12 results from an estimated 12 matches for "llvmpositionbuilderatend".

2011 Jun 18
1
[LLVMdev] loop only executes once
...//Get a pointer To the ArgX.i And add To function... ArgX = LLVMGetFirstParam(Fib2) // Get the arg. LLVMSetValueName(ArgX, "ArgX") // Give it a symbolic name. Builder = LLVMCreateBuilderInContext(Context) BB = LLVMAppendBasicBlockInContext(Context, Fib2, "EntryBlock") //Entry LLVMPositionBuilderAtEnd(Builder, BB) //Protected a,b,c //a=1:b=1:c=0:d=argx A = LLVMBuildAlloca(Builder, IntType,"A")// B = LLVMBuildAlloca(Builder, IntType,"B")// C = LLVMBuildAlloca(Builder, IntType,"C")// D = LLVMBuildAlloca(Builder, IntType,"D")// One = LLVMConstInt(IntType,...
2009 Nov 05
2
[LLVMdev] Strange error for libLLVMCore.a
...ce to `LLVMAppendBasicBlock' c:\Work\llvm//fac.c:28: undefined reference to `LLVMAppendBasicBlock' c:\Work\llvm//fac.c:29: undefined reference to `LLVMAppendBasicBlock' c:\Work\llvm//fac.c:30: undefined reference to `LLVMCreateBuilder' c:\Work\llvm//fac.c:32: undefined reference to `LLVMPositionBuilderAtEnd' c:\Work\llvm//fac.c:33: undefined reference to `LLVMInt32Type' c:\Work\llvm//fac.c:33: undefined reference to `LLVMConstInt' c:\Work\llvm//fac.c:33: undefined reference to `LLVMBuildICmp' c:\Work\llvm//fac.c:34: undefined reference to `LLVMBuildCondBr' c:\Work\llvm//fac.c:36: u...
2010 May 28
4
[LLVMdev] Manipulating basic blocks with the C bindings
...ee a way to do it with the C bindings.\ > > When you hit the "goto", create an empty basic block with > LLVMAppendBasicBlockInContext and put in an unconditional branch to > it.  Later, when you hit the label, put another unconditional branch > to that same block, then call LLVMPositionBuilderAtEnd(labelBlock) and > continue on your way. That would work. It just seems like there ought to be a better way. Thanks. - Evan
2010 May 27
0
[LLVMdev] Manipulating basic blocks with the C bindings
...ibing, but I don't see a way to do it with the C bindings.\ When you hit the "goto", create an empty basic block with LLVMAppendBasicBlockInContext and put in an unconditional branch to it. Later, when you hit the label, put another unconditional branch to that same block, then call LLVMPositionBuilderAtEnd(labelBlock) and continue on your way. > > I'd like to add the following functions. Hopefully my intent is clear. > I'm very open to name suggestions, as these are a mouthful: > > void LLVMAppendExistingBasicBlockInContext(LLVMContextRef C, > LLVMValueRef Fn, LLVMBasicBlo...
2010 May 28
0
[LLVMdev] Manipulating basic blocks with the C bindings
...th the C bindings.\ >> >> When you hit the "goto", create an empty basic block with >> LLVMAppendBasicBlockInContext and put in an unconditional branch to >> it.  Later, when you hit the label, put another unconditional branch >> to that same block, then call LLVMPositionBuilderAtEnd(labelBlock) and >> continue on your way. > That would work. It just seems like there ought to be a better way. Thanks. > > - Evan > If you keep in mind that blocks (other than the entry) aren't really ordered by anything other than branches, I can't see anything unintuiti...
2010 May 27
2
[LLVMdev] Manipulating basic blocks with the C bindings
I'm writing a frontend with the LLVM C bindings for a language that has a goto statement, similar to C's. I'm having some trouble figuring out what to do for the case where the label is declared after the goto, like this: goto label; ... label: ... When I generate the code for the goto, I'd like to create a basic block that's not inserted anywhere in particular and then put
2012 Apr 25
2
[LLVMdev] Crash in JIT
...); LLVMValueRef bParam = LLVMGetParam(func, 2); LLVMSetValueName(bParam, "b"); LLVMBasicBlockRef entryBB; entryBB = LLVMAppendBasicBlockInContext(llvm, func, "entry"); LLVMBuilderRef builder; builder = LLVMCreateBuilderInContext(llvm); LLVMPositionBuilderAtEnd(builder, entryBB); LLVMValueRef mx; mx = LLVMBuildMul(builder, mParam, xParam, "mx"); LLVMValueRef y; y = LLVMBuildAdd(builder, mx, bParam, "y"); LLVMValueRef retInst; retInst = LLVMBuildRet(builder, y); (void) retInst; LL...
2012 Apr 25
0
[LLVMdev] Crash in JIT
...t;x"); LLVMValueRef bParam = LLVMGetParam(func, 2); LLVMSetValueName(bParam, "b"); LLVMBasicBlockRef entryBB; entryBB = LLVMAppendBasicBlockInContext(llvm, func, "entry"); LLVMBuilderRef builder; builder = LLVMCreateBuilderInContext(llvm); LLVMPositionBuilderAtEnd(builder, entryBB); LLVMValueRef mx; mx = LLVMBuildMul(builder, mParam, xParam, "mx"); LLVMValueRef y; y = LLVMBuildAdd(builder, mx, bParam, "y"); LLVMValueRef retInst; retInst = LLVMBuildRet(builder, y); (void) retInst; LLVMDisposeBuilde...
2010 Aug 12
3
[LLVMdev] LLVM-C: Calling functions contained in other libraries
..., LLVMFunctionType(LLVMPointerType(LLVMInt8Type(), 0), NULL, 0, 0)); LLVMSetLinkage(fullUsername, LLVMExternalLinkage); result = LLVMAddFunction(module, "MyFunction", LLVMFunctionType(i8Ptr(), NULL, 0, 0)); block = LLVMAppendBasicBlock(result, "entrypoint"); LLVMPositionBuilderAtEnd(builder, block); LLVMValueRef returnVal = LLVMBuildCall(builder, fullUsername, NULL, 0, "myCall"); LLVMBuildRet(builder, returnVal); LLVMDisposeBuilder(builder); return result; } int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAuto...
2012 Sep 27
0
[LLVMdev] Possible bug or misunderstanding of feature LLVMConstIntOfString
...(), vpMainFuncTypes, 2, 0); LLVMValueRef vFnMain = LLVMAddFunction(modCEx, "main", rMainFuncType); LLVMSetFunctionCallConv(vFnMain, LLVMCCallConv); LLVMBasicBlockRef bEntry = LLVMAppendBasicBlock(vFnMain, "entry"); LLVMBuilderRef bldr = LLVMCreateBuilder(); LLVMPositionBuilderAtEnd(bldr, bEntry); // "C" printf function; LLVMTypeRef vpFnPrintfArgsType[] = { LLVMPointerType(LLVMInt8Type(), 0) }; LLVMTypeRef vFnPrintfType = LLVMFunctionType(LLVMInt32Type(), vpFnPrintfArgsType, 1, 1); LLVMValueRef vFnPrintf = LLVMAddFunction(modCEx, "printf",...
2017 Jan 25
2
mcjit C interface problems
...ype(), 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 = LLVMBuildAdd(builder, LLVMGetParam(sum, 0), LLVMGetParam(sum, 1), "tmp"); LLVMBuildRet(builder, tmp); char* error = NULL; LLVMVerifyModule(mod, LLVMAbortProcessAction, &error); LLVMDisposeMessage(error); LLVMExecutionEngineRef engine;...
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