diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-01-25 21:30:53 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-01-25 21:30:53 +0000 |
commit | 25e65a61ccc6a68b522ef841f949755fab5bb263 (patch) | |
tree | 631e2fabe7728ebea9ea78223ddcdeedcf5b04c7 /llvm/lib/IR/Attributes.cpp | |
parent | a520a7dcf3c681b75373357c6fec65b4d4aa7440 (diff) | |
download | bcm5719-llvm-25e65a61ccc6a68b522ef841f949755fab5bb263.tar.gz bcm5719-llvm-25e65a61ccc6a68b522ef841f949755fab5bb263.zip |
Add an accessor method to get the slot's index. This will limit the use of AttributeWithIndex.
llvm-svn: 173495
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r-- | llvm/lib/IR/Attributes.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index cbbf4848f6d..b09d55db902 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -682,6 +682,12 @@ unsigned AttributeSet::getNumSlots() const { return AttrList ? AttrList->getNumAttributes() : 0; } +unsigned AttributeSet::getSlotIndex(unsigned Slot) const { + assert(AttrList && Slot < AttrList->getNumAttributes() && + "Slot # out of range!"); + return AttrList->getSlotIndex(Slot); +} + /// getSlot - Return the AttributeWithIndex at the specified slot. This /// holds a number plus a set of attributes. const AttributeWithIndex &AttributeSet::getSlot(unsigned Slot) const { |