clang
9.0.0svn
|
BasePaths - Represents the set of paths from a derived class to one of its (direct or indirect) bases. More...
#include "clang/AST/CXXInheritance.h"
Public Types | |
using | paths_iterator = std::list< CXXBasePath >::iterator |
using | const_paths_iterator = std::list< CXXBasePath >::const_iterator |
using | decl_iterator = NamedDecl ** |
using | decl_range = llvm::iterator_range< decl_iterator > |
Public Member Functions | |
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. More... | |
paths_iterator | begin () |
paths_iterator | end () |
const_paths_iterator | begin () const |
const_paths_iterator | end () const |
CXXBasePath & | front () |
const CXXBasePath & | front () const |
decl_range | found_decls () |
bool | isAmbiguous (CanQualType BaseType) |
Determine whether the path from the most-derived type to the given base type is ambiguous (i.e., it refers to multiple subobjects of the same base type). More... | |
bool | isFindingAmbiguities () const |
Whether we are finding multiple paths to detect ambiguities. More... | |
bool | isRecordingPaths () const |
Whether we are recording paths. More... | |
void | setRecordingPaths (bool RP) |
Specify whether we should be recording paths or not. More... | |
bool | isDetectingVirtual () const |
Whether we are detecting virtual bases. More... | |
const RecordType * | getDetectedVirtual () const |
The virtual base discovered on the path (if we are merely detecting virtuals). More... | |
CXXRecordDecl * | getOrigin () const |
Retrieve the type from which this base-paths search began. More... | |
void | setOrigin (CXXRecordDecl *Rec) |
void | clear () |
Clear the base-paths results. More... | |
void | swap (CXXBasePaths &Other) |
Swap this data structure's contents with another CXXBasePaths object. More... | |
Friends | |
class | CXXRecordDecl |
BasePaths - Represents the set of paths from a derived class to one of its (direct or indirect) bases.
For example, given the following class hierarchy:
There are two potential BasePaths to represent paths from D to a base subobject of type A. One path is (D,0) -> (B,0) -> (A,0) and another is (D,0)->(C,0)->(A,1). These two paths actually refer to two different base class subobjects of the same type, so the BasePaths object refers to an ambiguous path. On the other hand, consider the following class hierarchy:
Here, there are two potential BasePaths again, (D, 0) -> (B, 0) -> (A,v) and (D, 0) -> (C, 0) -> (A, v), but since both of them refer to the same base class subobject of type A (the virtual one), there is no ambiguity.
Definition at line 118 of file CXXInheritance.h.
using clang::CXXBasePaths::const_paths_iterator = std::list<CXXBasePath>::const_iterator |
Definition at line 181 of file CXXInheritance.h.
using clang::CXXBasePaths::decl_iterator = NamedDecl ** |
Definition at line 182 of file CXXInheritance.h.
using clang::CXXBasePaths::decl_range = llvm::iterator_range<decl_iterator> |
Definition at line 199 of file CXXInheritance.h.
using clang::CXXBasePaths::paths_iterator = std::list<CXXBasePath>::iterator |
Definition at line 180 of file CXXInheritance.h.
|
inlineexplicit |
BasePaths - Construct a new BasePaths structure to record the paths for a derived-to-base search.
Definition at line 186 of file CXXInheritance.h.
|
inline |
Definition at line 191 of file CXXInheritance.h.
Referenced by DiagnoseReinterpretUpDownCast(), and clang::OverridingMethods::replaceAll().
|
inline |
Definition at line 193 of file CXXInheritance.h.
void CXXBasePaths::clear | ( | ) |
Clear the base-paths results.
clear - Clear out all prior path information.
Definition at line 70 of file CXXInheritance.cpp.
References clang::CXXBasePath::clear().
|
inline |
Definition at line 192 of file CXXInheritance.h.
Referenced by DiagnoseReinterpretUpDownCast(), and clang::OverridingMethods::replaceAll().
|
inline |
Definition at line 194 of file CXXInheritance.h.
CXXBasePaths::decl_range CXXBasePaths::found_decls | ( | ) |
Definition at line 51 of file CXXInheritance.cpp.
|
inline |
Definition at line 196 of file CXXInheritance.h.
|
inline |
Definition at line 197 of file CXXInheritance.h.
|
inline |
The virtual base discovered on the path (if we are merely detecting virtuals).
Definition at line 222 of file CXXInheritance.h.
|
inline |
Retrieve the type from which this base-paths search began.
Definition at line 228 of file CXXInheritance.h.
bool CXXBasePaths::isAmbiguous | ( | CanQualType | BaseType | ) |
Determine whether the path from the most-derived type to the given base type is ambiguous (i.e., it refers to multiple subobjects of the same base type).
isAmbiguous - Determines whether the set of paths provided is ambiguous, i.e., there are two or more paths that refer to different base class subobjects of the same type.
BaseType must be an unqualified, canonical class type.
Definition at line 63 of file CXXInheritance.cpp.
References clang::CanQual< T >::getUnqualifiedType().
|
inline |
Whether we are detecting virtual bases.
Definition at line 218 of file CXXInheritance.h.
|
inline |
Whether we are finding multiple paths to detect ambiguities.
Definition at line 209 of file CXXInheritance.h.
Referenced by clang::CXXRecordDecl::lookupInBases().
|
inline |
Whether we are recording paths.
Definition at line 212 of file CXXInheritance.h.
Referenced by clang::CXXRecordDecl::lookupInBases().
|
inline |
Definition at line 229 of file CXXInheritance.h.
References clang::CodeGen::clear().
Referenced by clang::CXXRecordDecl::isDerivedFrom(), and clang::CXXRecordDecl::isVirtuallyDerivedFrom().
|
inline |
Specify whether we should be recording paths or not.
Definition at line 215 of file CXXInheritance.h.
void CXXBasePaths::swap | ( | CXXBasePaths & | Other | ) |
Swap this data structure's contents with another CXXBasePaths object.
Swaps the contents of this CXXBasePaths structure with the contents of Other.
Definition at line 80 of file CXXInheritance.cpp.
Referenced by clang::LookupResult::setAmbiguousBaseSubobjects(), and clang::LookupResult::setAmbiguousBaseSubobjectTypes().
|
friend |
Definition at line 119 of file CXXInheritance.h.