On Sat, Feb 26, 2011 at 1:25 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com">clattner@apple.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

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:<br>
<a href="http://nondot.org/sabre/LLVMNotes/TypeSystemRewrite.txt" target="_blank">http://nondot.org/sabre/LLVMNotes/TypeSystemRewrite.txt</a><br>
<br>
Comments welcome!<br><br></blockquote><div>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.</div>

<div><br></div><div>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 want.</div><div><br></div><div>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.</div>

<div><br></div></div>-- <br>-- Talin<br>