jesusgumbau
jesusgumbau

Reputation: 108

LLVM backend without jumps (no goto)

I need to write a LLVM backend for a language that doesn't support jumps (conditional or unconditional). The only flow control structures I can use are if-then-else and while loops (plus break and continue).

Is there any way (or utility) to convert from LLVM jump-based+phi-node based to this?

Upvotes: 2

Views: 297

Answers (1)

yichun
yichun

Reputation: 121

You can refer to the relooper algorithm in the Emscripten, which was targeting LLVM IR to javascript, and there's no "goto" statement.

https://kripken.github.io/emscripten-site/docs/introducing_emscripten/Talks-and-Publications.html

Upvotes: 1

Related Questions