This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Use proper ID for attribute lookup
ClosedPublic

Authored by jdoerfert on Aug 3 2019, 9:42 PM.

Details

Summary

The new scheme is similar to the pass manager and dyn_cast scheme where
we identify classes by the address of a static member. This is better
than the old scheme in which we had to "invent" new Attributor enums if
there was no corresponding one.

Event Timeline

jdoerfert created this revision.Aug 3 2019, 9:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2019, 9:42 PM
uenoku accepted this revision.Aug 4 2019, 4:19 AM

To use the address as their id seems very reasonable.
I think we need to modify some comments which refer to AAType::ID.

Otherwise, LGTM.

llvm/include/llvm/Transforms/IPO/Attributor.h
226

"default attribute kind" to "attribute id" or something like that.

281

"attribute kinds(Attribute::AttrKind) " to "attribute id(AAType::ID)" or something like that.

This revision is now accepted and ready to land.Aug 4 2019, 4:19 AM
This revision was automatically updated to reflect the committed changes.