Displaying 7 results from an estimated 7 matches for "llvmappendbasicblockincontext".
2011 Jun 18
1
[LLVMdev] loop only executes once
...l so it can utilize tail
call
LLVMSetFunctionCallConv(Fib2,#LLVMFastCallConv)
//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 = LLVMBui...
2010 May 28
4
[LLVMdev] Manipulating basic blocks with the C bindings
...ace when I hit the label (or error out appropriately if I
>> never find it). It looks like the C++ API allows one to do what I'm
>> describing, 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.
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
...t in
> the right place when I hit the label (or error out appropriately if I
> never find it). It looks like the C++ API allows one to do what I'm
> describing, 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...
2010 May 28
0
[LLVMdev] Manipulating basic blocks with the C bindings
...abel (or error out appropriately if I
>>> never find it). It looks like the C++ API allows one to do what I'm
>>> describing, 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.
> That would work. It just seems like there ought to be a better way....
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
...c, 0);
LLVMSetValueName(mParam, "m");
LLVMValueRef xParam = LLVMGetParam(func, 1);
LLVMSetValueName(xParam, "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(b...
2012 Apr 25
0
[LLVMdev] Crash in JIT
...Param(func, 0);
LLVMSetValueName(mParam, "m");
LLVMValueRef xParam = LLVMGetParam(func, 1);
LLVMSetValueName(xParam, "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, m...