Go to the documentation of this file.
13 #ifndef LLVM_CLANG_AST_CXXINHERITANCE_H
14 #define LLVM_CLANG_AST_CXXINHERITANCE_H
22 #include "llvm/ADT/DenseMap.h"
23 #include "llvm/ADT/DenseSet.h"
24 #include "llvm/ADT/MapVector.h"
25 #include "llvm/ADT/SmallSet.h"
26 #include "llvm/ADT/SmallVector.h"
27 #include "llvm/ADT/iterator_range.h"
125 std::list<CXXBasePath> Paths;
133 struct IsVirtBaseAndNumberNonVirtBases {
134 unsigned IsVirtBase : 1;
135 unsigned NumberOfNonVirtBases : 31;
137 llvm::SmallDenseMap<QualType, IsVirtBaseAndNumberNonVirtBases, 8>
154 bool FindAmbiguities;
168 bool LookupInDependent =
false);
177 explicit CXXBasePaths(
bool FindAmbiguities =
true,
bool RecordPaths =
true,
178 bool DetectVirtual =
true)
179 : FindAmbiguities(FindAmbiguities), RecordPaths(RecordPaths),
180 DetectVirtual(DetectVirtual) {}
212 return DetectedVirtual;
271 using MapType = llvm::MapVector<unsigned, ValuesT>;
284 unsigned size()
const {
return Overrides.size(); }
358 :
public llvm::MapVector<const CXXMethodDecl *, OverridingMethods> {};
362 :
public llvm::SmallSet<const CXXRecordDecl*, 32> {};
383 if (IsMemberFunction)
390 #endif // LLVM_CLANG_AST_CXXINHERITANCE_H
void clear()
Clear the base-paths results.
const CXXRecordDecl * getOrigin() const
Retrieve the type from which this base-paths search began.
A mapping from each virtual member function to its set of final overriders.
void swap(CXXBasePaths &Other)
Swap this data structure's contents with another CXXBasePaths object.
DeclContext::lookup_iterator Decls
The declarations found inside this base class subobject.
This represents a decl that may have a name.
bool isDetectingVirtual() const
Whether we are detecting virtual bases.
friend bool operator!=(const UniqueVirtualMethod &X, const UniqueVirtualMethod &Y)
MapType::const_iterator const_iterator
int SubobjectNumber
Identifies which base class subobject (of type Base->getType()) this base path element refers to.
void setRecordingPaths(bool RP)
Specify whether we should be recording paths or not.
CXXMethodDecl * Method
The overriding virtual method.
The set of methods that override a given virtual method in each subobject where it occurs.
std::list< CXXBasePath >::const_iterator const_paths_iterator
const_paths_iterator begin() const
void setOrigin(const CXXRecordDecl *Rec)
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
MapType::iterator iterator
const_iterator begin() const
bool inheritanceModelHasVBTableOffsetField(MSInheritanceModel Inheritance)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
bool isAmbiguous(CanQualType BaseType)
Determine whether the path from the most-derived type to the given base type is ambiguous (i....
const RecordType * getDetectedVirtual() const
The virtual base discovered on the path (if we are merely detecting virtuals).
void replaceAll(UniqueVirtualMethod Overriding)
Represents an element in a path from a derived class to a base class.
UniqueVirtualMethod(CXXMethodDecl *Method, unsigned Subobject, const CXXRecordDecl *InVirtualSubobject)
A set of all the primary bases for a class.
Uniquely identifies a virtual method within a class hierarchy by the method itself and a class subobj...
SmallVectorImpl< UniqueVirtualMethod >::iterator overriding_iterator
std::list< CXXBasePath >::iterator paths_iterator
llvm::iterator_range< decl_iterator > decl_range
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Represents a C++ struct/union/class.
bool inheritanceModelHasNVOffsetField(bool IsMemberFunction, MSInheritanceModel Inheritance)
const_iterator end() const
bool inheritanceModelHasVBPtrOffsetField(MSInheritanceModel Inheritance)
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.
bool inheritanceModelHasOnlyOneField(bool IsMemberFunction, MSInheritanceModel Inheritance)
Represents a path from a specific derived class (which is not represented as part of the path) to a p...
friend bool operator==(const UniqueVirtualMethod &X, const UniqueVirtualMethod &Y)
unsigned Subobject
The subobject in which the overriding virtual method resides.
bool isRecordingPaths() const
Whether we are recording paths.
Represents a base class of a C++ class.
const CXXBaseSpecifier * Base
The base specifier that states the link from a derived class to a base class, which will be followed ...
MSInheritanceModel
Assigned inheritance model for a class in the MS C++ ABI.
AccessSpecifier Access
The access along this inheritance path.
const_paths_iterator end() const
BasePaths - Represents the set of paths from a derived class to one of its (direct or indirect) bases...
const CXXBasePath & front() const
void add(unsigned OverriddenSubobject, UniqueVirtualMethod Overriding)
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...
SmallVectorImpl< UniqueVirtualMethod >::const_iterator overriding_const_iterator
UniqueVirtualMethod()=default
bool isFindingAmbiguities() const
Whether we are finding multiple paths to detect ambiguities.
const CXXRecordDecl * InVirtualSubobject
The virtual base class subobject of which this overridden virtual method is a part.
const CXXRecordDecl * Class
The record decl of the class that the base is a base of.
Represents a static or instance method of a struct/union/class.