14 #ifndef LLVM_CLANG_AST_ATTRITERATOR_H 15 #define LLVM_CLANG_AST_ATTRITERATOR_H 18 #include "llvm/ADT/SmallVector.h" 19 #include "llvm/Support/Casting.h" 33 size_t Alignment = 8);
53 template <
typename SpecificAttr,
typename Container = AttrVec>
55 using Iterator =
typename Container::const_iterator;
64 mutable Iterator Current;
66 void AdvanceToNext()
const {
67 while (!isa<SpecificAttr>(*Current))
71 void AdvanceToNext(Iterator I)
const {
72 while (Current != I && !isa<SpecificAttr>(*Current))
88 return cast<SpecificAttr>(*Current);
92 return cast<SpecificAttr>(*Current);
107 assert((Left.Current ==
nullptr) == (Right.Current ==
nullptr));
108 if (Left.Current < Right.Current)
109 Left.AdvanceToNext(Right.Current);
111 Right.AdvanceToNext(Left.Current);
112 return Left.Current == Right.Current;
116 return !(Left == Right);
120 template <
typename SpecificAttr,
typename Container>
125 template <
typename SpecificAttr,
typename Container>
131 template <
typename SpecificAttr,
typename Container>
133 return specific_attr_begin<SpecificAttr>(container) !=
134 specific_attr_end<SpecificAttr>(container);
136 template <
typename SpecificAttr,
typename Container>
139 specific_attr_begin<SpecificAttr>(container);
140 if (i != specific_attr_end<SpecificAttr>(container))
148 #endif // LLVM_CLANG_AST_ATTRITERATOR_H specific_attr_iterator operator++(int)
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
specific_attr_iterator - Iterates over a subrange of an AttrVec, only providing attributes that are o...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
SpecificAttr * value_type
specific_attr_iterator(Iterator i)
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
specific_attr_iterator()=default
specific_attr_iterator & operator++()
std::forward_iterator_tag iterator_category
SpecificAttr * getSpecificAttr(const Container &container)
specific_attr_iterator< SpecificAttr, Container > specific_attr_begin(const Container &container)
__PTRDIFF_TYPE__ ptrdiff_t
A signed integer type that is the result of subtracting two pointers.
pointer operator->() const
Dataflow Directional Tag Classes.
bool hasSpecificAttr(const Container &container)
reference operator*() const
friend bool operator!=(specific_attr_iterator Left, specific_attr_iterator Right)
std::ptrdiff_t difference_type
friend bool operator==(specific_attr_iterator Left, specific_attr_iterator Right)
specific_attr_iterator< SpecificAttr, Container > specific_attr_end(const Container &container)