Add an accessor method to get the slot's index. This will limit the use of AttributeWithIndex.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173495 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/IR/AttributeImpl.h b/lib/IR/AttributeImpl.h
index b35e5e0..ebd90e2 100644
--- a/lib/IR/AttributeImpl.h
+++ b/lib/IR/AttributeImpl.h
@@ -122,6 +122,10 @@
   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);