[PATCH] D83172: [Attributor] Create getter function for the ID of the abstract attribute
Kuter Dinel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 5 05:19:49 PDT 2020
kuter added a comment.
In D83172#2131783 <https://reviews.llvm.org/D83172#2131783>, @sstefan1 wrote:
> In D83172#2131779 <https://reviews.llvm.org/D83172#2131779>, @bbn wrote:
>
> > > Attributes are going to be decleared outside of the Attributor soon.
> >
> > Do you mean that there might be other abstract attributes defined outside the AttributorAttributes.cpp ?
>
>
> As of yesterday, there is an AA outside of AttributorAttributes :). You should rebase.
>
> >
> >
> >> so I think we can have a macro like this:
> >>
> >> #define ATTRIBUTE_BOILER(CLASS) \
> >> const char *getIdAddr() { return &ID} \
> >> const std::string getName() { return #CLASS;} \
> >> static const char ID;
> >
> > Yes this could work, but I am still unsure about it..... I'd also like to hear what others think about this.
>
> I mean it is not that much code. Maybe I'm missing something, but why not just use `ID` directly?
You can't access `ID` when you have a `AbstactAttribute&`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83172/new/
https://reviews.llvm.org/D83172
More information about the llvm-commits
mailing list