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" 126 std::list<CXXBasePath> Paths;
134 struct IsVirtBaseAndNumberNonVirtBases {
135 unsigned IsVirtBase : 1;
136 unsigned NumberOfNonVirtBases : 31;
138 llvm::SmallDenseMap<QualType, IsVirtBaseAndNumberNonVirtBases, 8>
143 llvm::SmallPtrSet<const CXXRecordDecl *, 4> VisitedDependentRecords;
155 std::unique_ptr<NamedDecl *[]> DeclsFound;
156 unsigned NumDeclsFound = 0;
161 bool FindAmbiguities;
173 void ComputeDeclsFound();
177 bool LookupInDependent =
false);
186 explicit CXXBasePaths(
bool FindAmbiguities =
true,
bool RecordPaths =
true,
187 bool DetectVirtual =
true)
188 : FindAmbiguities(FindAmbiguities), RecordPaths(RecordPaths),
189 DetectVirtual(DetectVirtual) {}
223 return DetectedVirtual;
247 unsigned Subobject = 0;
258 : Method(Method), Subobject(Subobject),
259 InVirtualSubobject(InVirtualSubobject) {}
282 using MapType = llvm::MapVector<unsigned, ValuesT>;
295 unsigned size()
const {
return Overrides.size(); }
369 :
public llvm::MapVector<const CXXMethodDecl *, OverridingMethods> {};
373 :
public llvm::SmallSet<const CXXRecordDecl*, 32> {};
394 if (IsMemberFunction)
401 #endif // LLVM_CLANG_AST_CXXINHERITANCE_H void setOrigin(CXXRecordDecl *Rec)
llvm::iterator_range< decl_iterator > decl_range
C Language Family Type Representation.
SmallVectorImpl< UniqueVirtualMethod >::const_iterator overriding_const_iterator
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Represents a path from a specific derived class (which is not represented as part of the path) to a p...
std::list< CXXBasePath >::iterator paths_iterator
DeclContext::lookup_result Decls
The set of declarations found inside this base class subobject.
bool isRecordingPaths() const
Whether we are recording paths.
friend bool operator!=(const UniqueVirtualMethod &X, const UniqueVirtualMethod &Y)
void setRecordingPaths(bool RP)
Specify whether we should be recording paths or not.
bool isFindingAmbiguities() const
Whether we are finding multiple paths to detect ambiguities.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
The results of name lookup within a DeclContext.
bool inheritanceModelHasOnlyOneField(bool IsMemberFunction, MSInheritanceModel Inheritance)
CXXMethodDecl * Method
The overriding virtual method.
The set of methods that override a given virtual method in each subobject where it occurs...
MSInheritanceModel
Assigned inheritance model for a class in the MS C++ ABI.
const_iterator end() const
const RecordType * getDetectedVirtual() const
The virtual base discovered on the path (if we are merely detecting virtuals).
const_paths_iterator end() const
bool inheritanceModelHasVBTableOffsetField(MSInheritanceModel Inheritance)
UniqueVirtualMethod(CXXMethodDecl *Method, unsigned Subobject, const CXXRecordDecl *InVirtualSubobject)
Allows QualTypes to be sorted and hence used in maps and sets.
int SubobjectNumber
Identifies which base class subobject (of type Base->getType()) this base path element refers to...
Uniquely identifies a virtual method within a class hierarchy by the method itself and a class subobj...
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...
const CXXBaseSpecifier * Base
The base specifier that states the link from a derived class to a base class, which will be followed ...
A set of all the primary bases for a class.
Represents a static or instance method of a struct/union/class.
bool isDetectingVirtual() const
Whether we are detecting virtual bases.
const_paths_iterator begin() const
CXXRecordDecl * getOrigin() const
Retrieve the type from which this base-paths search began.
Defines various enumerations that describe declaration and type specifiers.
Represents an element in a path from a derived class to a base class.
const_iterator begin() const
std::list< CXXBasePath >::const_iterator const_paths_iterator
Dataflow Directional Tag Classes.
unsigned Subobject
The subobject in which the overriding virtual method resides.
A mapping from each virtual member function to its set of final overriders.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
MapType::const_iterator const_iterator
friend bool operator==(const UniqueVirtualMethod &X, const UniqueVirtualMethod &Y)
Represents a base class of a C++ class.
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...
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
Represents a C++ struct/union/class.
SmallVectorImpl< UniqueVirtualMethod >::iterator overriding_iterator
bool inheritanceModelHasNVOffsetField(bool IsMemberFunction, MSInheritanceModel Inheritance)
const CXXBasePath & front() const
BasePaths - Represents the set of paths from a derived class to one of its (direct or indirect) bases...
const CXXRecordDecl * InVirtualSubobject
The virtual base class subobject of which this overridden virtual method is a part.
This represents a decl that may have a name.
const CXXRecordDecl * Class
The record decl of the class that the base is a base of.
bool inheritanceModelHasVBPtrOffsetField(MSInheritanceModel Inheritance)