[PATCH] D83172: [Attributor] Create getter function for the ID of the abstract attribute

Stefan Stipanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 5 05:19:48 PDT 2020


sstefan1 added a comment.

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?


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

https://reviews.llvm.org/D83172





More information about the llvm-commits mailing list