diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h
index 30129b4..29246f3 100644
--- a/include/llvm/IR/Attributes.h
+++ b/include/llvm/IR/Attributes.h
@@ -339,6 +339,9 @@
   /// function itself).
   unsigned getNumSlots() const;
 
+  /// \brief Return the index for the given slot.
+  unsigned getSlotIndex(unsigned Slot) const;
+
   /// \brief Return the AttributeWithIndex at the specified slot.  This holds a
   /// index number plus a set of attributes.
   const AttributeWithIndex &getSlot(unsigned Slot) const;
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);
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index cbbf484..b09d55d 100644
--- a/lib/IR/Attributes.cpp
+++ b/lib/IR/Attributes.cpp
@@ -682,6 +682,12 @@
   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 {
diff --git a/lib/IR/Verifier.cpp b/lib/IR/Verifier.cpp
index b263bbe..9a482f1 100644
--- a/lib/IR/Verifier.cpp
+++ b/lib/IR/Verifier.cpp
@@ -718,25 +718,25 @@
   bool SawNest = false;
 
   for (unsigned i = 0, e = Attrs.getNumSlots(); i != e; ++i) {
-    const AttributeWithIndex &Attr = Attrs.getSlot(i);
+    unsigned Index = Attrs.getSlotIndex(i);
 
     Type *Ty;
-    if (Attr.Index == 0)
+    if (Index == 0)
       Ty = FT->getReturnType();
-    else if (Attr.Index-1 < FT->getNumParams())
-      Ty = FT->getParamType(Attr.Index-1);
+    else if (Index-1 < FT->getNumParams())
+      Ty = FT->getParamType(Index-1);
     else
       break;  // VarArgs attributes, verified elsewhere.
 
-    VerifyParameterAttrs(Attrs, Attr.Index, Ty, Attr.Index == 0, V);
+    VerifyParameterAttrs(Attrs, Index, Ty, Index == 0, V);
 
-    if (Attrs.hasAttribute(Attr.Index, Attribute::Nest)) {
+    if (Attrs.hasAttribute(i, Attribute::Nest)) {
       Assert1(!SawNest, "More than one parameter has attribute nest!", V);
       SawNest = true;
     }
 
-    if (Attrs.hasAttribute(Attr.Index, Attribute::StructRet))
-      Assert1(Attr.Index == 1, "Attribute sret is not on first parameter!", V);
+    if (Attrs.hasAttribute(Index, Attribute::StructRet))
+      Assert1(Index == 1, "Attribute sret is not on first parameter!", V);
   }
 
   if (!Attrs.hasAttributes(AttributeSet::FunctionIndex))
@@ -801,12 +801,12 @@
     return true;
 
   unsigned LastSlot = Attrs.getNumSlots() - 1;
-  unsigned LastIndex = Attrs.getSlot(LastSlot).Index;
+  unsigned LastIndex = Attrs.getSlotIndex(LastSlot);
   if (LastIndex <= Params
-      || (LastIndex == (unsigned)~0
-          && (LastSlot == 0 || Attrs.getSlot(LastSlot - 1).Index <= Params)))  
+      || (LastIndex == AttributeSet::FunctionIndex
+          && (LastSlot == 0 || Attrs.getSlotIndex(LastSlot - 1) <= Params)))
     return true;
-
+ 
   return false;
 }
 
