Reputation: 108
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
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