[PATCH] D117921: Attributes: add a new allocalign() attribute

Augie Fackler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 25 07:04:36 PST 2022


durin42 added a comment.

In D117921#3262394 <https://reviews.llvm.org/D117921#3262394>, @nikic wrote:

> Might it make more sense to implement this as an argument attribute? Would be a bit simpler I think, and I don't really see a disadvantage.

I don't have any idea. @reames any opinion? I confess I'm not sure what this means for me.

> If you do want this to be a function int attribute, then the parameter reference should be zero-based, not one-based, for consistency with allocsize.

I can't do it zero-based, because there's no way to store a zero in an int attribute. I can go to the work of adding getters and setters everywhere and then pretend it's 0-based for the public API, but internally you'll fail assertions if you try to carry 0 as the payload of an int attr. If you want the getters and setters let me know, I guess? This will matter for one other attribute we need too (`mustfree(N)` - to indicate a pointer will be freed).

In D117921#3262397 <https://reviews.llvm.org/D117921#3262397>, @reames wrote:

> Cannot review without LangRef changes.

Done.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117921/new/

https://reviews.llvm.org/D117921



More information about the llvm-commits mailing list