clang  7.0.0svn
Public Types | Public Member Functions | Static Public Member Functions | List of all members
clang::ConstructionContextLayer Class Reference

Construction context is a linked list of multiple layers. More...

#include "clang/Analysis/ConstructionContext.h"

Public Types

typedef llvm::PointerUnion< Stmt *, CXXCtorInitializer * > TriggerTy
 

Public Member Functions

const ConstructionContextLayergetParent () const
 
bool isLast () const
 
const StmtgetTriggerStmt () const
 
const CXXCtorInitializergetTriggerInit () const
 
bool isSameLayer (const ConstructionContextLayer *Other) const
 Returns true if these layers are equal as individual layers, even if their parents are different. More...
 
bool isStrictlyMoreSpecificThan (const ConstructionContextLayer *Other) const
 See if Other is a proper initial segment of this construction context in terms of the parent chain - i.e. More...
 

Static Public Member Functions

static const ConstructionContextLayercreate (BumpVectorContext &C, TriggerTy Trigger, const ConstructionContextLayer *Parent=nullptr)
 

Detailed Description

Construction context is a linked list of multiple layers.

Layers are created gradually while traversing the AST, and layers that represent the outmost AST nodes are built first, while the node that immediately contains the constructor would be built last and capture the previous layers as its parents. Construction context captures the last layer (which has links to the previous layers) and classifies the seemingly arbitrary chain of layers into one of the possible ways of constructing an object in C++ for user-friendly experience.

Definition at line 33 of file ConstructionContext.h.

Member Typedef Documentation

◆ TriggerTy

Definition at line 35 of file ConstructionContext.h.

Member Function Documentation

◆ create()

const ConstructionContextLayer * ConstructionContextLayer::create ( BumpVectorContext C,
TriggerTy  Trigger,
const ConstructionContextLayer Parent = nullptr 
)
static

◆ getParent()

const ConstructionContextLayer* clang::ConstructionContextLayer::getParent ( ) const
inline

Definition at line 67 of file ConstructionContext.h.

Referenced by isStrictlyMoreSpecificThan().

◆ getTriggerInit()

const CXXCtorInitializer* clang::ConstructionContextLayer::getTriggerInit ( ) const
inline

Definition at line 74 of file ConstructionContext.h.

◆ getTriggerStmt()

const Stmt* clang::ConstructionContextLayer::getTriggerStmt ( ) const
inline

Definition at line 70 of file ConstructionContext.h.

◆ isLast()

bool clang::ConstructionContextLayer::isLast ( ) const
inline

Definition at line 68 of file ConstructionContext.h.

◆ isSameLayer()

bool clang::ConstructionContextLayer::isSameLayer ( const ConstructionContextLayer Other) const
inline

Returns true if these layers are equal as individual layers, even if their parents are different.

Definition at line 80 of file ConstructionContext.h.

References isStrictlyMoreSpecificThan().

Referenced by isStrictlyMoreSpecificThan().

◆ isStrictlyMoreSpecificThan()

bool ConstructionContextLayer::isStrictlyMoreSpecificThan ( const ConstructionContextLayer Other) const

See if Other is a proper initial segment of this construction context in terms of the parent chain - i.e.

a few first parents coincide and then the other context terminates but our context goes further - i.e., we are providing the same context that the other context provides, and a bit more above that.

Definition at line 29 of file ConstructionContext.cpp.

References getParent(), and isSameLayer().

Referenced by isSameLayer().


The documentation for this class was generated from the following files: