14 #ifndef LLVM_CLANG_AST_CXXINHERITANCE_H
15 #define LLVM_CLANG_AST_CXXINHERITANCE_H
22 #include "llvm/ADT/MapVector.h"
23 #include "llvm/ADT/SmallSet.h"
24 #include "llvm/ADT/SmallVector.h"
31 class CXXBaseSpecifier;
123 std::list<CXXBasePath> Paths;
131 llvm::SmallDenseMap<QualType, std::pair<bool, unsigned>, 8> ClassSubobjects;
136 bool FindAmbiguities;
159 unsigned NumDeclsFound;
163 void ComputeDeclsFound();
177 bool RecordPaths =
true,
178 bool DetectVirtual =
true)
179 : FindAmbiguities(FindAmbiguities), RecordPaths(RecordPaths),
180 DetectVirtual(DetectVirtual), DetectedVirtual(nullptr),
181 DeclsFound(nullptr), NumDeclsFound(0) { }
216 return DetectedVirtual;
240 : Method(Method), Subobject(Subobject),
241 InVirtualSubobject(InVirtualSubobject) { }
276 typedef llvm::MapVector<unsigned, ValuesT> MapType;
287 unsigned size()
const {
return Overrides.size(); }
361 :
public llvm::MapVector<const CXXMethodDecl *, OverridingMethods> { };
365 :
public llvm::SmallSet<const CXXRecordDecl*, 32> { };
const RecordType * getDetectedVirtual() const
The virtual base discovered on the path (if we are merely detecting virtuals).
void setOrigin(CXXRecordDecl *Rec)
void swap(CXXBasePaths &Other)
Swap this data structure's contents with another CXXBasePaths object.
MapType::iterator 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...
DeclContext::lookup_result Decls
The set of declarations found inside this base class subobject.
void clear()
Clear the base-paths results.
MapType::const_iterator const_iterator
std::list< CXXBasePath >::const_iterator const_paths_iterator
bool isFindingAmbiguities() const
Whether we are finding multiple paths to detect ambiguities.
friend bool operator!=(const UniqueVirtualMethod &X, const UniqueVirtualMethod &Y)
void setRecordingPaths(bool RP)
Specify whether we should be recording paths or not.
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. This is either a single result (with no stable stora...
bool isRecordingPaths() const
Whether we are recording paths.
void add(unsigned OverriddenSubobject, UniqueVirtualMethod Overriding)
CXXMethodDecl * Method
The overriding virtual method.
The set of methods that override a given virtual method in each subobject where it occurs...
bool isDetectingVirtual() const
Whether we are detecting virtual bases.
UniqueVirtualMethod(CXXMethodDecl *Method, unsigned Subobject, const CXXRecordDecl *InVirtualSubobject)
const_paths_iterator end() const
Allows QualTypes to be sorted and hence used in maps and sets.
const CXXBasePath & front() const
NamedDecl ** decl_iterator
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...
const CXXBaseSpecifier * Base
The base specifier that states the link from a derived class to a base class, which will be followed ...
SmallVectorImpl< UniqueVirtualMethod >::const_iterator overriding_const_iterator
A set of all the primary bases for a class.
bool BaseMatchesCallback(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *UserData)
Function type used by lookupInBases() to determine whether a specific base class subobject matches th...
Represents a static or instance method of a struct/union/class.
const_paths_iterator begin() const
Represents an element in a path from a derived class to a base class.
SmallVectorImpl< UniqueVirtualMethod >::iterator overriding_iterator
unsigned Subobject
The subobject in which the overriding virtual method resides.
A mapping from each virtual member function to its set of final overriders.
const_iterator begin() const
bool isAmbiguous(CanQualType BaseType)
Determine whether the path from the most-derived type to the given base type is ambiguous (i...
friend bool operator==(const UniqueVirtualMethod &X, const UniqueVirtualMethod &Y)
CXXRecordDecl * getOrigin() const
Retrieve the type from which this base-paths search began.
llvm::iterator_range< decl_iterator > decl_range
Represents a base class of a C++ class.
CXXBasePaths(bool FindAmbiguities=true, bool RecordPaths=true, bool DetectVirtual=true)
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.
AccessSpecifier Access
The access along this inheritance path. This is only calculated when recording paths. AS_none is a special value used to indicate a path which permits no legal access.
const CXXRecordDecl * InVirtualSubobject
The virtual base class subobject of which this overridden virtual method is a part. Note that this records the closest derived virtual base class subobject.
void replaceAll(UniqueVirtualMethod Overriding)
const CXXRecordDecl * Class
The record decl of the class that the base is a base of.
std::list< CXXBasePath >::iterator paths_iterator
const_iterator end() const