class CXXBasePaths

Declaration

class CXXBasePaths { /* full declaration omitted */ };

Description

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.

Declared at: clang/include/clang/AST/CXXInheritance.h:117

Member Variables

private const clang::CXXRecordDecl* Origin = nullptr
The type from which this search originated.
private std::list<CXXBasePath> Paths
Paths - The actual set of paths that can be taken from the derived class to the same base class.
private llvm::SmallDenseMap< QualType, IsVirtBaseAndNumberNonVirtBases, 8> ClassSubobjects
private llvm::SmallPtrSet<const CXXRecordDecl*, 4> VisitedDependentRecords
VisitedDependentRecords - Records the dependent records that have been already visited.
private const clang::RecordType* DetectedVirtual = nullptr
DetectedVirtual - The base class that is virtual.
private clang::CXXBasePath ScratchPath
ScratchPath - A BasePath that is used by Sema::lookupInBases to help build the set of paths.
private bool FindAmbiguities
FindAmbiguities - Whether Sema::IsDerivedFrom should try find ambiguous paths while it is looking for a path from a derived type to a base type.
private bool RecordPaths
RecordPaths - Whether Sema::IsDerivedFrom should record paths while it is determining whether there are paths from a derived type to a base type.
private bool DetectVirtual
DetectVirtual - Whether Sema::IsDerivedFrom should abort the search if it finds a path that goes across a virtual base. The virtual class is also recorded.

Method Overview

  • public CXXBasePaths(bool FindAmbiguities = true, bool RecordPaths = true, bool DetectVirtual = true)
  • public clang::CXXBasePaths::paths_iterator begin()
  • public clang::CXXBasePaths::const_paths_iterator begin() const
  • public void clear()
  • public clang::CXXBasePaths::paths_iterator end()
  • public clang::CXXBasePaths::const_paths_iterator end() const
  • public clang::CXXBasePath & front()
  • public const clang::CXXBasePath & front() const
  • public const clang::RecordType * getDetectedVirtual() const
  • public const clang::CXXRecordDecl * getOrigin() const
  • public bool isAmbiguous(clang::CanQualType BaseType)
  • public bool isDetectingVirtual() const
  • public bool isFindingAmbiguities() const
  • public bool isRecordingPaths() const
  • private bool lookupInBases(clang::ASTContext & Context, const clang::CXXRecordDecl * Record, CXXRecordDecl::BaseMatchesCallback BaseMatches, bool LookupInDependent = false)
  • public void setOrigin(const clang::CXXRecordDecl * Rec)
  • public void setRecordingPaths(bool RP)
  • public void swap(clang::CXXBasePaths & Other)

Methods

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

Description

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

Declared at: clang/include/clang/AST/CXXInheritance.h:177

Parameters

bool FindAmbiguities = true
bool RecordPaths = true
bool DetectVirtual = true

clang::CXXBasePaths::paths_iterator begin()

Declared at: clang/include/clang/AST/CXXInheritance.h:182

clang::CXXBasePaths::const_paths_iterator begin()
    const

Declared at: clang/include/clang/AST/CXXInheritance.h:184

void clear()

Description

Clear the base-paths results.

Declared at: clang/include/clang/AST/CXXInheritance.h:221

clang::CXXBasePaths::paths_iterator end()

Declared at: clang/include/clang/AST/CXXInheritance.h:183

clang::CXXBasePaths::const_paths_iterator end()
    const

Declared at: clang/include/clang/AST/CXXInheritance.h:185

clang::CXXBasePath& front()

Declared at: clang/include/clang/AST/CXXInheritance.h:187

const clang::CXXBasePath& front() const

Declared at: clang/include/clang/AST/CXXInheritance.h:188

const clang::RecordType* getDetectedVirtual()
    const

Description

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

Declared at: clang/include/clang/AST/CXXInheritance.h:211

const clang::CXXRecordDecl* getOrigin() const

Description

Retrieve the type from which this base-paths search began

Declared at: clang/include/clang/AST/CXXInheritance.h:217

bool isAmbiguous(clang::CanQualType BaseType)

Description

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).

Declared at: clang/include/clang/AST/CXXInheritance.h:195

Parameters

clang::CanQualType BaseType

bool isDetectingVirtual() const

Description

Whether we are detecting virtual bases.

Declared at: clang/include/clang/AST/CXXInheritance.h:207

bool isFindingAmbiguities() const

Description

Whether we are finding multiple paths to detect ambiguities.

Declared at: clang/include/clang/AST/CXXInheritance.h:198

bool isRecordingPaths() const

Description

Whether we are recording paths.

Declared at: clang/include/clang/AST/CXXInheritance.h:201

bool lookupInBases(
    clang::ASTContext& Context,
    const clang::CXXRecordDecl* Record,
    CXXRecordDecl::BaseMatchesCallback
        BaseMatches,
    bool LookupInDependent = false)

Declared at: clang/include/clang/AST/CXXInheritance.h:166

Parameters

clang::ASTContext& Context
const clang::CXXRecordDecl* Record
CXXRecordDecl::BaseMatchesCallback BaseMatches
bool LookupInDependent = false

void setOrigin(const clang::CXXRecordDecl* Rec)

Declared at: clang/include/clang/AST/CXXInheritance.h:218

Parameters

const clang::CXXRecordDecl* Rec

void setRecordingPaths(bool RP)

Description

Specify whether we should be recording paths or not.

Declared at: clang/include/clang/AST/CXXInheritance.h:204

Parameters

bool RP

void swap(clang::CXXBasePaths& Other)

Description

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

Declared at: clang/include/clang/AST/CXXInheritance.h:225

Parameters

clang::CXXBasePaths& Other