[LLVMdev] LLVM IR is a compiler IR

Talin viridia at gmail.com
Tue Oct 4 16:41:55 PDT 2011


On Tue, Oct 4, 2011 at 4:36 PM, Chris Lattner <clattner at apple.com> wrote:

>
> 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.
>
> I was trying to limit my response to just a few examples - I realize that
there's a ton of things I've left out. I guess what I am describing is the
same as Microsoft's "Managed C++" - the ability to compile C++ programs to
the CLR. Note that Managed C++ doesn't give you every possible feature of
C++, you can't take an arbitrary C++ program and expect to compile it in
managed mode.


> -Chris
>



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


More information about the llvm-dev mailing list