[LLVMdev] LLVM IR is a compiler IR

Chris Lattner clattner at apple.com
Tue Oct 4 16:36:35 PDT 2011


On Oct 4, 2011, at 4:31 PM, Talin wrote:

> 
> This sounds interesting. I did not get what is a ``rich type system to
> express all of the DWARF semantics''. Could you show an example
> program that the rich type system can define, but the current IR fails
> to present? And how does it improve the IR?
> 
> One thing you would need is the ability to assign names to struct members. Currently LLVM refers to struct members by numerical index, and I wouldn't want to change that. However, in order to be visible in the debugger, you also have to assign a name to each member. Note that this information doesn't need to take a lot of space in the module - names are highly compressible, especially fully qualified names (foo.bar.X.Y.Z) where you have a whole bunch of names that start with the same prefix. (In my own frontend, I sort names by frequency, so that the names that are used most often have the lowest assigned IDs. This allows the reference to the name to be stored in fewer bits.)

Talin, if you're trying to produce a "C virtual machine" you basically need everything in a C AST.  You're scratching the surface of the issues.

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111004/f7a6914c/attachment.html>


More information about the llvm-dev mailing list