[LLVMdev] Unique shape and types

Nicolas Geoffray nicolas.geoffray at lip6.fr
Thu Jun 21 00:38:43 PDT 2007


Chris Lattner wrote:
> If you control the front-end, you have many options available to you.  For 
> example, you could emit your own tables along the same lines as debug 
> info but specialized to capture the metadata you need.
>
>   

Yes, but this always turns into having two representations for one type: 
the LLVM representation for its layout,
and a personal representation for inheritance. Consider this example 
from a dynamic language which creates
a new list of size four:

(define a (new List 4))

If LLVM had type inheritance integrated, all that would be needed is to 
emit the (new List 4) into LLVM instructions,
get the returned type, and set it to the GlobalVariable a. This would 
simplify a lot of things (for me! :))
>> This leads to another question of type inference for dynamic languages
>>     
>
> I don't propose to do that analysis on the LLVM IR itself. :)
>
>   

Ah, OK. So you propose to do type inference in (all) front-ends? Or 
maybe on a higher IR?

Again, wouldn't it be easier for dynamic language front-end 
implementations if type inference was just a pass on the LLVM IR? I 
would surely _love_ to have thins kind of feature :)

Nicolas



More information about the llvm-dev mailing list