[LLVMdev] [RFC] Overhauling Attributes

Chris Lattner clattner at apple.com
Wed Sep 19 23:33:41 PDT 2012

On Sep 19, 2012, at 4:09 PM, Chandler Carruth <chandlerc at google.com> wrote:

> // Building an Attribute
> Attributes A;
> A.addAlignAttr(4)
>  .addNoUnwindAttr()
>  .addStackProtectorAttr()
>  .addUnwindTableAttr()
>  .addReadNoneAttr();
> Personally, I would prefer to make the Attributes class be immutable, and the building happen in a helper.

Yep, that's the goal.  Eventually "Attributes" will be a pointer to a uniqued (and thus, immutable) object managed by llvmcontext.  Having a mutable builder is really important, because you don't want to be re-uniquing for each additional attribute crammed on in a chain.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120919/93e8a523/attachment.html>

More information about the llvm-dev mailing list