My language doesn't really have traditional variables and is conceptually stack-based. So can I safely ignore def_var
and just work with a manually managed stack of Values
?
Yes. def_var/use_var are helpers to construct SSA form. You are free to not use them if you don't need them.
How do I set the name of a function? Can't seem to find any relevant functions on FunctionBuilder or ctx.func.
Sorry i'm dumb, that's what module.declare_function is for Or maybe it isn't, since there's still no symbol named _start in the .o file.
Oh, i see. I first declare the function, then define it (i assume AFTER i'm done compiling it)
After you have generated clif ir for the function you define it. The defining itself will compile it down to machine code.
Last updated: Dec 23 2024 at 12:05 UTC