aboutsummaryrefslogtreecommitdiff
path: root/lib/IR
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-31 23:53:05 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-31 23:53:05 +0000
commit16c4b3cf2943ae2327752cf3de39769d14cfcece (patch)
tree1bbb475c858240f8c52496ba3ad2bb19f82428c3 /lib/IR
parentac08785edaac826afe11a4e596a46fc693848848 (diff)
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
Diffstat (limited to 'lib/IR')
-rw-r--r--lib/IR/Attributes.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index 14aba080ab..9d5f53bfdc 100644
--- a/lib/IR/Attributes.cpp
+++ b/lib/IR/Attributes.cpp
@@ -740,6 +740,18 @@ AttributeSetNode *AttributeSet::getAttributes(unsigned Idx) const {
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
//===----------------------------------------------------------------------===//