diff options
| author | Bill Wendling <isanbard@gmail.com> | 2013-01-31 23:53:05 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2013-01-31 23:53:05 +0000 |
| commit | a91748602a0a08a52a633c8f3516ac546445ac07 (patch) | |
| tree | 0273d1150c27996e3d427eaa0b5d0773ac014335 /llvm/lib | |
| parent | 995d40e1e29c85dbe301ab9fc44de1f2c0c52d72 (diff) | |
| download | bcm5719-llvm-a91748602a0a08a52a633c8f3516ac546445ac07.tar.gz bcm5719-llvm-a91748602a0a08a52a633c8f3516ac546445ac07.zip | |
Add iterators to the AttributeSet class so that we can access the Attributes in a nice way.
llvm-svn: 174120
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/IR/Attributes.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index 14aba080abe..9d5f53bfdcd 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/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 //===----------------------------------------------------------------------===// |

