[LLVMdev] Indirect Branch Representation

kapil anand kapilanand2 at gmail.com
Wed Jul 23 20:47:22 PDT 2008


Specifically, I need a way to represent indirect branch instruction (in
binary) as an equivalent LLVM instruction. With switch instruction , I would
have to list all the possible targets and then initialize the corresponding
instruction. I was just thinking whether it might be possible to have some
kind of indirect branch where label is a "variable" and not an explicit
label present in module.

-Kapil
On Wed, Jul 23, 2008 at 10:36 PM, Eli Friedman <eli.friedman at gmail.com>
wrote:

>  On Wed, Jul 23, 2008 at 5:57 PM, kapil anand <kapilanand2 at gmail.com>
> wrote:
> > Hi,
> >
> > I was thinking about the ways to represent indirect branch in LLVM. It
> seems
> > that "Switch instruction" is the only way to logically represent indirect
> > branch inside LLVM.
> > Is there any other easier way to represent indirect branch in LLVM?
>
> Yeah, that's essentially it; the only forms of control flow LLVM
> supports are branches/switches, calls, and exceptions.  There's been
> some discussion that this makes it difficult to represent some
> constructs, like setjmp/longjmp and the gcc goto from nested function
> extension, but nobody has really proposed anything yet.
>
> LLVM supports turning functions with the fastcc calling convention
> into tail calls; that can be useful in some cases. Is there something
> in particular you're running into issues with?
>
> -Eli
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080723/3f56534f/attachment.html>


More information about the llvm-dev mailing list