search for: labelblock

Displaying 6 results from an estimated 6 matches for "labelblock".

2010 May 28
4
[LLVMdev] Manipulating basic blocks with the C bindings
...e 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
...e 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, LLVMBasicBlock BB); &gt...
2010 May 28
0
[LLVMdev] Manipulating basic blocks with the C bindings
...gt; >> 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 unintuitive about it...
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
2009 Aug 06
0
[LLVMdev] code-altering Passes for llc
On Aug 6, 2009, at 5:45 AM, Artjom Kochtchi wrote: > So I was searching for a possibility to include an additional > (Machine)BasicBlock (or rather a MachineFunction?) somewhere in the > program > that contains the program termination and that I can jump to on check > failure. Can't I do that during a Pass in llc? If you just have a magic block of instructions you want to
2009 Aug 06
2
[LLVMdev] code-altering Passes for llc
Kenneth Uildriks wrote: > > Does the error function *have* to be auto-generated in your pass? > Perhaps the original code should use invokes, and your pass insert the > error check with a jne to the "unwind" block. > If I understand correctly, unwind is some kind of exception handling in LLVM IR? I'm not sure if this is the right thing. First, I include runtime