[LLVMdev] Indirect Branch Representation

David Greene dag at cray.com
Thu Jul 24 09:06:14 PDT 2008


On Thursday 24 July 2008 01:47, Chris Lattner wrote:
> On Jul 23, 2008, at 8:47 PM, kapil anand wrote:
> > 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.
>
> No, and there never will be a way.  In the future, we will probably
> extend the CFG to better model the GCC "address of label + indirect
> goto" extension.  However, even with that, all the possible
> destinations of an indirect goto must be explicitly known.

This would also help with Fortran assigned gotos.

                                              -Dave



More information about the llvm-dev mailing list