[PATCH] D32819: [IR] Switch AttributeList to use an array for O(1) access

Javed Absar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 9 05:24:14 PDT 2017


javed.absar added inline comments.


================
Comment at: llvm/include/llvm/IR/Attributes.h:287
 public:
   enum AttrIndex : unsigned {
+    FunctionIndex = 0,
----------------
Yes, make the code much neater.  Unfortunately, because of legacy stuff, as you mention, adjustments are needed in lot of places. I think encapsulating the index change inside AttributeList might be neater (less pervasive change).


================
Comment at: llvm/include/llvm/IR/Attributes.h:303
   /// the empty attributes list.
   AttributeListImpl *pImpl = nullptr;
 
----------------
Should pImpl also have 'private' access-specifier, given getImpl is moved to there?


https://reviews.llvm.org/D32819





More information about the llvm-commits mailing list