diff options
| author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2019-07-13 00:29:03 +0000 |
|---|---|---|
| committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2019-07-13 00:29:03 +0000 |
| commit | 41c22b4390c763f6fc36ec984f3786d465c434b5 (patch) | |
| tree | ca0e42bc9f58d905a4d89d9a4496a4ba4df16e4c /llvm/lib/IR/AttributeImpl.h | |
| parent | 0291d309291f69525fdf61072b6790fd5e1d67bf (diff) | |
| download | bcm5719-llvm-41c22b4390c763f6fc36ec984f3786d465c434b5.tar.gz bcm5719-llvm-41c22b4390c763f6fc36ec984f3786d465c434b5.zip | |
Extend function attributes bitset size from 64 to 96.
Summary: We are going to add a function attribute number 64.
Reviewers: pcc, jdoerfert, lebedev.ri
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64663
llvm-svn: 365980
Diffstat (limited to 'llvm/lib/IR/AttributeImpl.h')
| -rw-r--r-- | llvm/lib/IR/AttributeImpl.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/IR/AttributeImpl.h b/llvm/lib/IR/AttributeImpl.h index f6898476382..f989fa3b910 100644 --- a/llvm/lib/IR/AttributeImpl.h +++ b/llvm/lib/IR/AttributeImpl.h @@ -179,9 +179,9 @@ class AttributeSetNode final private TrailingObjects<AttributeSetNode, Attribute> { friend TrailingObjects; - /// Bitset with a bit for each available attribute Attribute::AttrKind. - uint64_t AvailableAttrs; unsigned NumAttrs; ///< Number of attributes in this node. + /// Bitset with a bit for each available attribute Attribute::AttrKind. + uint8_t AvailableAttrs[12] = {}; AttributeSetNode(ArrayRef<Attribute> Attrs); @@ -200,7 +200,7 @@ public: unsigned getNumAttributes() const { return NumAttrs; } bool hasAttribute(Attribute::AttrKind Kind) const { - return AvailableAttrs & ((uint64_t)1) << Kind; + return AvailableAttrs[Kind / 8] & ((uint64_t)1) << (Kind % 8); } bool hasAttribute(StringRef Kind) const; bool hasAttributes() const { return NumAttrs != 0; } @@ -244,10 +244,10 @@ class AttributeListImpl final friend TrailingObjects; private: - /// Bitset with a bit for each available attribute Attribute::AttrKind. - uint64_t AvailableFunctionAttrs; LLVMContext &Context; unsigned NumAttrSets; ///< Number of entries in this set. + /// Bitset with a bit for each available attribute Attribute::AttrKind. + uint8_t AvailableFunctionAttrs[12] = {}; // Helper fn for TrailingObjects class. size_t numTrailingObjects(OverloadToken<AttributeSet>) { return NumAttrSets; } @@ -267,7 +267,7 @@ public: /// Return true if the AttributeSet or the FunctionIndex has an /// enum attribute of the given kind. bool hasFnAttribute(Attribute::AttrKind Kind) const { - return AvailableFunctionAttrs & ((uint64_t)1) << Kind; + return AvailableFunctionAttrs[Kind / 8] & ((uint64_t)1) << (Kind % 8); } using iterator = const AttributeSet *; |

