[LLVMdev] Directly emit LLVM IR?
Neil Booth
neil at daikokuya.co.uk
Fri Feb 22 21:32:26 PST 2008
Jan Rehders wrote:-
> Hi,
>
> >? Emit LLVM assembly from your compiler's native language.
> >for: very straightforward to get started
> >against: the .ll parser is slower than the bitcode reader when
> >interfacing to the middle end
> >against: you'll have to re-engineer the LLVM IR object model and asm
> >writer in your language
> >against: it may be harder to track changes to the IR
>
> One more problem with this: in order to emit float constants you have
> to convert them to hexadecimal notation which I found nontrivial. My
> pet language is still lacking proper float support because of this.
> I'm not aware whether there are more pitfalls like this lurking
> around. (Time to finally move to the ocaml bindings.. :))
APFloat can emit hex representation of any float to desired precision
and rounding method.
Neil.
More information about the llvm-dev
mailing list