diff options
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/IR/Attributes.h | 5 | ||||
| -rw-r--r-- | llvm/lib/IR/Attributes.cpp | 12 | 
2 files changed, 17 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/Attributes.h b/llvm/include/llvm/IR/Attributes.h index 508277c1306..49ef884b702 100644 --- a/llvm/include/llvm/IR/Attributes.h +++ b/llvm/include/llvm/IR/Attributes.h @@ -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; 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  //===----------------------------------------------------------------------===//  | 

