mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +00:00
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
This commit is contained in:
parent
ac08785eda
commit
16c4b3cf29
@ -270,6 +270,11 @@ public:
|
||||
/// \brief Return the attributes at the index as a string.
|
||||
std::string getAsString(unsigned Index) const;
|
||||
|
||||
typedef ArrayRef<Attribute>::iterator iterator;
|
||||
|
||||
iterator begin(unsigned Idx);
|
||||
iterator end(unsigned Idx);
|
||||
|
||||
/// operator==/!= - Provide equality predicates.
|
||||
bool operator==(const AttributeSet &RHS) const {
|
||||
return pImpl == RHS.pImpl;
|
||||
|
@ -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
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Loading…
Reference in New Issue
Block a user