13#ifndef LLVM_CLANG_AST_ATTRITERATOR_H
14#define LLVM_CLANG_AST_ATTRITERATOR_H
17#include "llvm/ADT/SmallVector.h"
18#include "llvm/Support/Casting.h"
32template <
typename SpecificAttr,
typename Container = AttrVec>
34 using Iterator =
typename Container::const_iterator;
43 mutable Iterator Current;
45 void AdvanceToNext()
const {
46 while (!isa<SpecificAttr>(*Current))
50 void AdvanceToNext(Iterator I)
const {
51 while (Current != I && !isa<SpecificAttr>(*Current))
67 return cast<SpecificAttr>(*Current);
71 return cast<SpecificAttr>(*Current);
86 assert((Left.Current ==
nullptr) == (Right.Current ==
nullptr));
87 if (Left.Current < Right.Current)
88 Left.AdvanceToNext(Right.Current);
90 Right.AdvanceToNext(Left.Current);
91 return Left.Current == Right.Current;
95 return !(Left == Right);
99template <
typename SpecificAttr,
typename Container>
100inline specific_attr_iterator<SpecificAttr, Container>
104template <
typename SpecificAttr,
typename Container>
105inline specific_attr_iterator<SpecificAttr, Container>
110template <
typename SpecificAttr,
typename Container>
112 return specific_attr_begin<SpecificAttr>(container) !=
113 specific_attr_end<SpecificAttr>(container);
115template <
typename SpecificAttr,
typename Container>
118 specific_attr_begin<SpecificAttr>(container);
119 if (i != specific_attr_end<SpecificAttr>(container))
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
specific_attr_iterator - Iterates over a subrange of an AttrVec, only providing attributes that are o...
friend bool operator!=(specific_attr_iterator Left, specific_attr_iterator Right)
reference operator*() const
SpecificAttr * value_type
std::ptrdiff_t difference_type
std::forward_iterator_tag iterator_category
friend bool operator==(specific_attr_iterator Left, specific_attr_iterator Right)
specific_attr_iterator()=default
pointer operator->() const
specific_attr_iterator(Iterator i)
specific_attr_iterator & operator++()
specific_attr_iterator operator++(int)
The JSON file list parser is used to communicate input to InstallAPI.
SpecificAttr * getSpecificAttr(const Container &container)
bool hasSpecificAttr(const Container &container)
specific_attr_iterator< SpecificAttr, Container > specific_attr_end(const Container &container)
specific_attr_iterator< SpecificAttr, Container > specific_attr_begin(const Container &container)