summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/AttributeImpl.h
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-25 21:30:53 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-25 21:30:53 +0000
commit25e65a61ccc6a68b522ef841f949755fab5bb263 (patch)
tree631e2fabe7728ebea9ea78223ddcdeedcf5b04c7 /llvm/lib/IR/AttributeImpl.h
parenta520a7dcf3c681b75373357c6fec65b4d4aa7440 (diff)
downloadbcm5719-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/AttributeImpl.h')
-rw-r--r--llvm/lib/IR/AttributeImpl.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/IR/AttributeImpl.h b/llvm/lib/IR/AttributeImpl.h
index b35e5e0f0b3..ebd90e29e21 100644
--- a/llvm/lib/IR/AttributeImpl.h
+++ b/llvm/lib/IR/AttributeImpl.h
@@ -122,6 +122,10 @@ public:
LLVMContext &getContext() { return Context; }
ArrayRef<AttributeWithIndex> getAttributes() const { return AttrList; }
unsigned getNumAttributes() const { return AttrList.size(); }
+ unsigned getSlotIndex(unsigned Slot) const {
+ // FIXME: This needs to use AttrNodes instead.
+ return AttrList[Slot].Index;
+ }
void Profile(FoldingSetNodeID &ID) const {
Profile(ID, AttrList);
OpenPOWER on IntegriCloud