[PATCH] D108788: [NFC] Rename attribute methods that work with indexes

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 26 14:23:49 PDT 2021


aeubanks created this revision.
Herald added subscribers: dexonsmith, jdoerfert, arphaman, hiraditya.
aeubanks requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108788

Files:
  llvm/include/llvm/IR/Attributes.h
  llvm/include/llvm/IR/Function.h
  llvm/include/llvm/IR/InstrTypes.h
  llvm/lib/IR/Attributes.cpp
  llvm/lib/IR/Function.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108788.368982.patch
Type: text/x-patch
Size: 33816 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210826/31664322/attachment.bin>


More information about the llvm-commits mailing list