[LLVMdev] Ideas for annotating types?

Talin viridia at gmail.com
Sun Jul 10 12:11:53 PDT 2011


On Sun, Jul 10, 2011 at 11:59 AM, Renato Golin <rengolin at systemcall.org>wrote:

> On 10 July 2011 19:47, Talin <viridia at gmail.com> wrote:
> > However, I would imagine other uses for this facility. What this
> effectively
> > is "metadata for types", although unlike metadata nodes this data would
> be
> > immutable.
>
> Hi Talin,
>
> The new type system allows you to name types and, if I got it rght,
> that's unique and immutable.
>
> You could use that fact, plus some metadata, to group your values and
> use one annotation per group.
>
> Should be easy to iterate through all values in a given function
> testing for a given (unique) type.
>

So essentially use a dummy named type as a container to hold other types
that share a common annotation? That's an interesting idea. And then I
presume that on loading the module you'd use that to build a map of unique
type pointer to annotation pointer.

So basically you'd have a pair of utility classes in LLVM that would read
and write this data structure into a module. Then on top of that you'd build
the GC primitives that annotate a given type and retrieve the annotation.

Hmmmm...

>
> cheers,
> --renato
>



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


More information about the llvm-dev mailing list