If you'll search back a few months you will see that I've made pretty
much
the exact same complaint (although far less succinctly), for exactly the
same use case (apparently Rust and Tart are similar in their approach to
discriminated unions. :)
On Sun, Sep 4, 2011 at 5:26 PM, Patrick Walton <pwalton at mozilla.com>
wrote:
> Hi everyone,
>
> It'd be useful for our purposes if we could attach metadata to named
> structs. In particular, in Rust we're looking to use this information
to
> communicate information about our discriminated unions to the garbage
> collector. (We could, and are at the moment, using the metadata argument
> to the gcroot intrinsic, but this seems to inhibit optimizations and
> adds a fair amount of noise to the generated IR, so we'd like to
> transition to an addrspace-based GC solution at some point.)
>
> It seems to me that attaching metadata to named structs could generally
> be useful as a way to communicate additional ad-hoc type information to
> optimizers, codegen, etc., in much the same way as GCC and Clang use
> __attribute__ on structs.
>
> Does anyone have opinions as to whether this is a good idea?
>
> Thanks,
> Patrick
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
--
-- Talin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20110904/1109af1e/attachment.html>