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

1

2

3

4

5

6

7

8

9

10

11

12

13#ifndef LLVM_CLANG_AST_CXXINHERITANCE_H

14#define LLVM_CLANG_AST_CXXINHERITANCE_H

15

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

23#include "llvm/ADT/MapVector.h"

24#include "llvm/ADT/SmallSet.h"

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

26#include "llvm/ADT/iterator_range.h"

27#include

28#include

29#include

30

32

35

36

37

38

39

40

41

42

44

45

46

48

49

51

52

53

54

55

56

57

59};

60

61

62

63

64

65

66

67

68

70public:

71

72

73

75

77

78

80

85};

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

118

119

121

122

123

124 std::list Paths;

125

126

127

128

129

130

131

132 struct IsVirtBaseAndNumberNonVirtBases {

133 LLVM_PREFERRED_TYPE(bool)

134 unsigned IsVirtBase : 1;

135 unsigned NumberOfNonVirtBases : 31;

136 };

137 llvm::SmallDenseMap<QualType, IsVirtBaseAndNumberNonVirtBases, 8>

138 ClassSubobjects;

139

140

141

143

144

145 const RecordType *DetectedVirtual = nullptr;

146

147

148

150

151

152

153

154 bool FindAmbiguities;

155

156

157

158

159 bool RecordPaths;

160

161

162

163

164 bool DetectVirtual;

165

168 bool LookupInDependent = false);

169

170public:

174

175

176

177 explicit CXXBasePaths(bool FindAmbiguities = true, bool RecordPaths = true,

178 bool DetectVirtual = true)

179 : FindAmbiguities(FindAmbiguities), RecordPaths(RecordPaths),

180 DetectVirtual(DetectVirtual) {}

181

186

189

190 using decl_range = llvm::iterator_range<decl_iterator>;

191

192

193

194

196

197

199

200

202

203

205

206

208

209

210

212 return DetectedVirtual;

213 }

214

215

216

219

220

222

223

224

226};

227

228

229

231

233

234

235

237

238

239

240

242

244

249

255

258 return !(X == Y);

259 }

260};

261

262

263

264

265

266

267

268

271 using MapType = llvm::MapVector<unsigned, ValuesT>;

272

273 MapType Overrides;

274

275public:

276

279

284 unsigned size() const { return Overrides.size(); }

285

286

287

292

293

295

296

297

298

300

301

302

304};

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

348

349

350

351

352

353

354

355

356

358 : public llvm::MapVector<const CXXMethodDecl *, OverridingMethods> {};

359

360

363

364inline bool

368

369

370

375

376inline bool

380

383 if (IsMemberFunction)

386}

387

388}

389

390#endif

Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....

llvm::MachO::Record Record

Defines various enumerations that describe declaration and type specifiers.

Allows QualTypes to be sorted and hence used in maps and sets.

C Language Family Type Representation.

Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...

Represents a path from a specific derived class (which is not represented as part of the path) to a p...

Definition CXXInheritance.h:69

DeclContext::lookup_iterator Decls

The declarations found inside this base class subobject.

Definition CXXInheritance.h:79

AccessSpecifier Access

The access along this inheritance path.

Definition CXXInheritance.h:74

void clear()

Definition CXXInheritance.h:81

BasePaths - Represents the set of paths from a derived class to one of its (direct or indirect) bases...

Definition CXXInheritance.h:116

const RecordType * getDetectedVirtual() const

The virtual base discovered on the path (if we are merely detecting virtuals).

Definition CXXInheritance.h:211

const CXXRecordDecl * getOrigin() const

Retrieve the type from which this base-paths search began.

Definition CXXInheritance.h:217

CXXBasePaths(bool FindAmbiguities=true, bool RecordPaths=true, bool DetectVirtual=true)

BasePaths - Construct a new BasePaths structure to record the paths for a derived-to-base search.

Definition CXXInheritance.h:177

CXXBasePath & front()

Definition CXXInheritance.h:187

bool isRecordingPaths() const

Whether we are recording paths.

Definition CXXInheritance.h:201

paths_iterator begin()

Definition CXXInheritance.h:182

paths_iterator end()

Definition CXXInheritance.h:183

void setRecordingPaths(bool RP)

Specify whether we should be recording paths or not.

Definition CXXInheritance.h:204

NamedDecl ** decl_iterator

Definition CXXInheritance.h:173

void setOrigin(const CXXRecordDecl *Rec)

Definition CXXInheritance.h:218

llvm::iterator_range< decl_iterator > decl_range

Definition CXXInheritance.h:190

bool isDetectingVirtual() const

Whether we are detecting virtual bases.

Definition CXXInheritance.h:207

bool isAmbiguous(CanQualType BaseType)

Determine whether the path from the most-derived type to the given base type is ambiguous (i....

void clear()

Clear the base-paths results.

friend class CXXRecordDecl

Definition CXXInheritance.h:117

std::list< CXXBasePath >::iterator paths_iterator

Definition CXXInheritance.h:171

const_paths_iterator end() const

Definition CXXInheritance.h:185

const CXXBasePath & front() const

Definition CXXInheritance.h:188

std::list< CXXBasePath >::const_iterator const_paths_iterator

Definition CXXInheritance.h:172

bool isFindingAmbiguities() const

Whether we are finding multiple paths to detect ambiguities.

Definition CXXInheritance.h:198

void swap(CXXBasePaths &Other)

Swap this data structure's contents with another CXXBasePaths object.

const_paths_iterator begin() const

Definition CXXInheritance.h:184

Represents a base class of a C++ class.

A mapping from each virtual member function to its set of final overriders.

Definition CXXInheritance.h:358

A set of all the primary bases for a class.

Definition CXXInheritance.h:362

Represents a static or instance method of a struct/union/class.

Represents a C++ struct/union/class.

llvm::function_ref< bool(const CXXBaseSpecifier *Specifier, CXXBasePath &Path)> BaseMatchesCallback

Function type used by lookupInBases() to determine whether a specific base class subobject matches th...

lookup_result::iterator lookup_iterator

This represents a decl that may have a name.

The set of methods that override a given virtual method in each subobject where it occurs.

Definition CXXInheritance.h:269

iterator end()

Definition CXXInheritance.h:282

void replaceAll(UniqueVirtualMethod Overriding)

const_iterator begin() const

Definition CXXInheritance.h:281

MapType::iterator iterator

Definition CXXInheritance.h:277

SmallVectorImpl< UniqueVirtualMethod >::iterator overriding_iterator

Definition CXXInheritance.h:288

unsigned size() const

Definition CXXInheritance.h:284

MapType::const_iterator const_iterator

Definition CXXInheritance.h:278

iterator begin()

Definition CXXInheritance.h:280

void add(unsigned OverriddenSubobject, UniqueVirtualMethod Overriding)

SmallVectorImpl< UniqueVirtualMethod >::const_iterator overriding_const_iterator

Definition CXXInheritance.h:290

const_iterator end() const

Definition CXXInheritance.h:283

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

CanQual< Type > CanQualType

Represents a canonical, potentially-qualified type.

bool inheritanceModelHasNVOffsetField(bool IsMemberFunction, MSInheritanceModel Inheritance)

Definition CXXInheritance.h:371

AccessSpecifier

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

bool inheritanceModelHasOnlyOneField(bool IsMemberFunction, MSInheritanceModel Inheritance)

Definition CXXInheritance.h:381

bool inheritanceModelHasVBPtrOffsetField(MSInheritanceModel Inheritance)

Definition CXXInheritance.h:365

bool inheritanceModelHasVBTableOffsetField(MSInheritanceModel Inheritance)

Definition CXXInheritance.h:377

MSInheritanceModel

Assigned inheritance model for a class in the MS C++ ABI.

@ Other

Other implicit parameter.

Represents an element in a path from a derived class to a base class.

Definition CXXInheritance.h:43

int SubobjectNumber

Identifies which base class subobject (of type Base->getType()) this base path element refers to.

Definition CXXInheritance.h:58

const CXXRecordDecl * Class

The record decl of the class that the base is a base of.

Definition CXXInheritance.h:50

const CXXBaseSpecifier * Base

The base specifier that states the link from a derived class to a base class, which will be followed ...

Definition CXXInheritance.h:47

Uniquely identifies a virtual method within a class hierarchy by the method itself and a class subobj...

Definition CXXInheritance.h:230

friend bool operator==(const UniqueVirtualMethod &X, const UniqueVirtualMethod &Y)

Definition CXXInheritance.h:250

UniqueVirtualMethod(CXXMethodDecl *Method, unsigned Subobject, const CXXRecordDecl *InVirtualSubobject)

Definition CXXInheritance.h:245

CXXMethodDecl * Method

The overriding virtual method.

Definition CXXInheritance.h:232

UniqueVirtualMethod()=default

unsigned Subobject

The subobject in which the overriding virtual method resides.

Definition CXXInheritance.h:236

friend bool operator!=(const UniqueVirtualMethod &X, const UniqueVirtualMethod &Y)

Definition CXXInheritance.h:256

const CXXRecordDecl * InVirtualSubobject

The virtual base class subobject of which this overridden virtual method is a part.

Definition CXXInheritance.h:241