[LLVMdev] LLVM IR Type System Rewrite
viridia at gmail.com
Fri Apr 1 14:29:13 PDT 2011
On Sat, Feb 26, 2011 at 1:25 PM, Chris Lattner <clattner at apple.com> wrote:
> Several people have been proding me to write up my thoughts on how to fix
> the IR type system for LLVM 3.0. Here are some (fairly stream of
> conscious) thoughts on the matter:
> Comments welcome!
> Chris - some comments in the other thread about garbage collection roots
made me realize that I'd like to see the ability to associate metadata nodes
with a struct type. Right now it makes no sense to add any additional
traits, attributes, properties, or whatnot with a type, because the type may
get merged with a structurally identical type and the attributes would
thereby be lost. (Either that or the attribute has to become part of the
type's signature, which gets complicated.) Under your scheme, however, as
long as I can come up with a unique name for a struct, I can prevent the
merging from happening, which now means that I ought to be able to hang
attributes off the type and have them be preserved.
So basically what I want is to add a metadata node pointer for structs.
Metadata is open-ended enough to be able to represent anything we would
Of course, this feature only holds for struct types - what about hanging
metadata off of other types? Well, I think I can live with just structs,
since in the worst case I can always wrap the other type in a struct.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev