clang: include/clang/AST/UnresolvedSet.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_CLANG_AST_UNRESOLVEDSET_H

15#define LLVM_CLANG_AST_UNRESOLVEDSET_H

16

20#include "llvm/ADT/ArrayRef.h"

21#include "llvm/ADT/SmallVector.h"

22#include "llvm/ADT/iterator.h"

23#include

24#include

25

27

28class NamedDecl;

29

30

31

33 UnresolvedSetIterator, DeclAccessPair *,

34 std::random_access_iterator_tag, NamedDecl *,

35 std::ptrdiff_t, NamedDecl *, NamedDecl *> {

39

41 : iterator_adaptor_base(Iter) {}

44

45public:

46

47

49

50 uint64_t getDeclID() const { return I->getDeclID(); }

56

59};

60

61

64

65

66

67private:

69

73

74

77

78public:

79

80

83

86

89

91

94 }

95

98 }

99

100

101

102

104 for (DeclsTy::iterator I = decls().begin(), E = decls().end(); I != E; ++I)

105 if (I->getDecl() == Old)

106 return (I->setDecl(New), true);

107 return false;

108 }

109

110

111

113

115 I.I->set(New, AS);

116 }

117

119 auto val = decls().pop_back_val();

120 if (I < size())

121 decls()[I] = val;

122 }

123

125 auto val = decls().pop_back_val();

126 if (I != end())

127 *I.I = val;

128 }

129

131

132 void clear() { decls().clear(); }

133 void truncate(unsigned N) { decls().truncate(N); }

134

135 bool empty() const { return decls().empty(); }

136 unsigned size() const { return decls().size(); }

137

139

140 template void assign(Iter I, Iter E) { decls().assign(I, E); }

141

144

145private:

146

147

148 DeclsTy &decls() {

149 return *reinterpret_cast<DeclsTy*>(this);

150 }

151 const DeclsTy &decls() const {

152 return *reinterpret_cast<const DeclsTy*>(this);

153 }

154};

155

156

160};

161

162

163}

164

165#endif

Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.

Defines various enumerations that describe declaration and type specifiers.

An UnresolvedSet-like class which uses the ASTContext's allocator.

A POD class for pairing a NamedDecl* with an access specifier.

static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)

void setAccess(AccessSpecifier AS)

This represents a decl that may have a name.

A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.

A set of unresolved declarations.

bool replace(const NamedDecl *Old, NamedDecl *New)

Replaces the given declaration with the new one, once.

DeclAccessPair & operator[](unsigned I)

const_iterator end() const

void addDecl(NamedDecl *D, AccessSpecifier AS)

const DeclAccessPair & operator[](unsigned I) const

void replace(iterator I, NamedDecl *New, AccessSpecifier AS)

void setAccess(iterator I, AccessSpecifier AS)

void replace(iterator I, NamedDecl *New)

Replaces the declaration at the given iterator with the new one, preserving the original access bits.

const_iterator begin() const

void assign(Iter I, Iter E)

ArrayRef< DeclAccessPair > pairs() const

UnresolvedSetIterator iterator

void append(iterator I, iterator E)

void truncate(unsigned N)

void addDecl(NamedDecl *D)

UnresolvedSetIterator const_iterator

The iterator over UnresolvedSets.

NamedDecl * operator->() const

NamedDecl * getDecl() const

const DeclAccessPair & getPair() const

AccessSpecifier getAccess() const

void setDecl(NamedDecl *ND) const

void setAccess(AccessSpecifier AS)

uint64_t getDeclID() const

NamedDecl * operator*() const

A set of unresolved declarations.

The JSON file list parser is used to communicate input to InstallAPI.

AccessSpecifier

A C++ access specifier (public, private, protected), plus the special value "none" which means differ...