Add iterators to the AttributeSet class so that we can access the Attributes in a nice way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174120 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index 14aba08..9d5f53b 100644
--- a/lib/IR/Attributes.cpp
+++ b/lib/IR/Attributes.cpp
@@ -740,6 +740,18 @@
   return 0;
 }
 
+AttributeSet::iterator AttributeSet::begin(unsigned Idx) {
+  if (!pImpl)
+    return ArrayRef<Attribute>().begin();
+  return pImpl->begin(Idx);
+}
+
+AttributeSet::iterator AttributeSet::end(unsigned Idx) {
+  if (!pImpl)
+    return ArrayRef<Attribute>().end();
+  return pImpl->begin(Idx);
+}
+
 //===----------------------------------------------------------------------===//
 // AttributeSet Introspection Methods
 //===----------------------------------------------------------------------===//