[LLVMdev] Indirect Branch Representation

Eli Friedman eli.friedman at gmail.com
Wed Jul 23 19:36:07 PDT 2008


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



More information about the llvm-dev mailing list