[LLVMdev] 'Implementing a language with LLVM' tutorial
Vikram S. Adve
vadve at uiuc.edu
Mon Nov 5 08:47:59 PST 2007
Nice work, Chris! This is a much needed tutorial. Some comments:
-- It would be helpful to add some navigation links at the top and
bottom of the pages.
-- Not clear why PrototypeAST::Codegen returns a Function* instead of
a Value* like the other CodeGen methods?
-- It can be convenient to use Visitor methods on the AST classes for
code generation, instead of hard-coding the CodeGen methods into the
AST classes. Many languages will need other traversals besides the
CodeGen operations, e.g., for type checking, class layout, etc.
-- In the optimization section, how much code size reduction have you
seen in practice by doing constant folding in the LLVMFoldingBuilder
(instead of just letting the later optimization pass take care of it)?
-- One of the harder parts is generating type declarations correctly
for recursively connected types (e.g., for classes). Without
extending Kaleidoscope, it would be be helpful to add a link to the
Programmers Manual section on recursive type construction.
On Nov 5, 2007, at 1:14 AM, Chris Lattner wrote:
> Hi All,
> LLVM has long needed a tutorial for people who are interested in using
> it to implement their favorite language and to demonstrate how to use
> the JIT. To help solve this, I've put together a little tutorial that
> runs through the implementation and extension of a toy language here:
> At this point, the tutorial is feature complete, but might still need
> some final editing. Before I try to get other sites to link to it, I
> thought it would be good to get some more eyeballs on it and get some
> thoughts and feedback from you.
> Anyone have thoughts or feedback? :)
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev