This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Rename attribute methods that work with indexes
ClosedPublic

Authored by aeubanks on Aug 26 2021, 2:23 PM.

Details

Summary

This is part one of a couple of patches to fully rename these methods.

I've made the mistake of assuming that these indexes are for parameters
multiple times, but actually they're based off of a weird indexing
scheme AttributeList::AttrIndex where 0 is the return value and ~0 is
the function. Hopefully renaming these methods will make this clearer.
Ideally users should use more specific methods like
AttributeList::getFnAttr().

This patch simply adds the name that we want in the end. This is so the
removal of the methods with the original names happens in a separate
change to make it easier for downstream users.

This touches all relevant methods in AttributeList, CallBase, and Function.

Diff Detail

Event Timeline

aeubanks created this revision.Aug 26 2021, 2:23 PM
aeubanks requested review of this revision.Aug 26 2021, 2:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 26 2021, 2:23 PM
rnk accepted this revision.Sep 1 2021, 10:31 AM

lgtm

I held off in case Duncan or the others he added to the other patch had thoughts, but I think this is inline what they had in mind.

This revision is now accepted and ready to land.Sep 1 2021, 10:31 AM
This revision was landed with ongoing or failed builds.Sep 1 2021, 10:44 AM
This revision was automatically updated to reflect the committed changes.
zsrkmyn added inline comments.
llvm/include/llvm/IR/Attributes.h
475

The 4th argument is missing here.

zsrkmyn added inline comments.Sep 1 2021, 10:52 PM
llvm/include/llvm/IR/Attributes.h
475

Drafted a patch at D109132