clang 19.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
clang::ConstructionContextItem Class Reference

Represents a single point (AST node) in the program that requires attention during construction of an object. More...

#include "clang/Analysis/ConstructionContext.h"

Public Types

enum  ItemKind {
  VariableKind , NewAllocatorKind , ReturnKind , MaterializationKind ,
  TemporaryDestructorKind , ElidedDestructorKind , ElidableConstructorKind , ArgumentKind ,
  LambdaCaptureKind , STATEMENT_WITH_INDEX_KIND_BEGIN = ArgumentKind , STATEMENT_WITH_INDEX_KIND_END = LambdaCaptureKind , STATEMENT_KIND_BEGIN = VariableKind ,
  STATEMENT_KIND_END = LambdaCaptureKind , InitializerKind , INITIALIZER_KIND_BEGIN = InitializerKind , INITIALIZER_KIND_END = InitializerKind
}
 

Public Member Functions

 ConstructionContextItem (const DeclStmt *DS)
 
 ConstructionContextItem (const CXXNewExpr *NE)
 
 ConstructionContextItem (const ReturnStmt *RS)
 
 ConstructionContextItem (const MaterializeTemporaryExpr *MTE)
 
 ConstructionContextItem (const CXXBindTemporaryExpr *BTE, bool IsElided=false)
 
 ConstructionContextItem (const CXXConstructExpr *CE)
 
 ConstructionContextItem (const CallExpr *CE, unsigned Index)
 
 ConstructionContextItem (const CXXConstructExpr *CE, unsigned Index)
 
 ConstructionContextItem (const CXXInheritedCtorInitExpr *CE, unsigned Index)
 
 ConstructionContextItem (const ObjCMessageExpr *ME, unsigned Index)
 
 ConstructionContextItem (const Expr *E, unsigned Index)
 
 ConstructionContextItem (const CXXCtorInitializer *Init)
 
 ConstructionContextItem (const LambdaExpr *LE, unsigned Index)
 
ItemKind getKind () const
 
LLVM_DUMP_METHOD StringRef getKindAsString () const
 
const StmtgetStmt () const
 The construction site - the statement that triggered the construction for one of its parts.
 
const StmtgetStmtOrNull () const
 
const CXXCtorInitializergetCXXCtorInitializer () const
 The construction site is not necessarily a statement.
 
unsigned getIndex () const
 If a single trigger statement triggers multiple constructors, they are usually being enumerated.
 
void Profile (llvm::FoldingSetNodeID &ID) const
 
bool operator== (const ConstructionContextItem &Other) const
 
bool operator< (const ConstructionContextItem &Other) const
 

Static Public Member Functions

static LLVM_DUMP_METHOD StringRef getKindAsString (ItemKind K)
 

Detailed Description

Represents a single point (AST node) in the program that requires attention during construction of an object.

ConstructionContext would be represented as a list of such items.

Definition at line 28 of file ConstructionContext.h.

Member Enumeration Documentation

◆ ItemKind

Enumerator
VariableKind 
NewAllocatorKind 
ReturnKind 
MaterializationKind 
TemporaryDestructorKind 
ElidedDestructorKind 
ElidableConstructorKind 
ArgumentKind 
LambdaCaptureKind 
STATEMENT_WITH_INDEX_KIND_BEGIN 
STATEMENT_WITH_INDEX_KIND_END 
STATEMENT_KIND_BEGIN 
STATEMENT_KIND_END 
InitializerKind 
INITIALIZER_KIND_BEGIN 
INITIALIZER_KIND_END 

Definition at line 30 of file ConstructionContext.h.

Constructor & Destructor Documentation

◆ ConstructionContextItem() [1/13]

clang::ConstructionContextItem::ConstructionContextItem ( const DeclStmt DS)
inline

Definition at line 90 of file ConstructionContext.h.

References Data.

◆ ConstructionContextItem() [2/13]

clang::ConstructionContextItem::ConstructionContextItem ( const CXXNewExpr NE)
inline

Definition at line 93 of file ConstructionContext.h.

References Data.

◆ ConstructionContextItem() [3/13]

clang::ConstructionContextItem::ConstructionContextItem ( const ReturnStmt RS)
inline

Definition at line 96 of file ConstructionContext.h.

References Data.

◆ ConstructionContextItem() [4/13]

clang::ConstructionContextItem::ConstructionContextItem ( const MaterializeTemporaryExpr MTE)
inline

Definition at line 99 of file ConstructionContext.h.

References Data.

◆ ConstructionContextItem() [5/13]

clang::ConstructionContextItem::ConstructionContextItem ( const CXXBindTemporaryExpr BTE,
bool  IsElided = false 
)
inline

Definition at line 102 of file ConstructionContext.h.

References Data.

◆ ConstructionContextItem() [6/13]

clang::ConstructionContextItem::ConstructionContextItem ( const CXXConstructExpr CE)
inline

Definition at line 107 of file ConstructionContext.h.

References Data.

◆ ConstructionContextItem() [7/13]

clang::ConstructionContextItem::ConstructionContextItem ( const CallExpr CE,
unsigned  Index 
)
inline

Definition at line 110 of file ConstructionContext.h.

References Data.

◆ ConstructionContextItem() [8/13]

clang::ConstructionContextItem::ConstructionContextItem ( const CXXConstructExpr CE,
unsigned  Index 
)
inline

Definition at line 113 of file ConstructionContext.h.

References Data.

◆ ConstructionContextItem() [9/13]

clang::ConstructionContextItem::ConstructionContextItem ( const CXXInheritedCtorInitExpr CE,
unsigned  Index 
)
inline

Definition at line 116 of file ConstructionContext.h.

References Data.

◆ ConstructionContextItem() [10/13]

clang::ConstructionContextItem::ConstructionContextItem ( const ObjCMessageExpr ME,
unsigned  Index 
)
inline

Definition at line 119 of file ConstructionContext.h.

References Data.

◆ ConstructionContextItem() [11/13]

clang::ConstructionContextItem::ConstructionContextItem ( const Expr E,
unsigned  Index 
)
inline

Definition at line 123 of file ConstructionContext.h.

References Data.

◆ ConstructionContextItem() [12/13]

clang::ConstructionContextItem::ConstructionContextItem ( const CXXCtorInitializer Init)
inline

Definition at line 130 of file ConstructionContext.h.

References Data.

◆ ConstructionContextItem() [13/13]

clang::ConstructionContextItem::ConstructionContextItem ( const LambdaExpr LE,
unsigned  Index 
)
inline

Definition at line 133 of file ConstructionContext.h.

References Data.

Member Function Documentation

◆ getCXXCtorInitializer()

const CXXCtorInitializer * clang::ConstructionContextItem::getCXXCtorInitializer ( ) const
inline

The construction site is not necessarily a statement.

It may also be a CXXCtorInitializer, which means that a member variable is being constructed during initialization of the object that contains it.

Definition at line 158 of file ConstructionContext.h.

References Data.

Referenced by clang::ConstructionContext::createFromLayers().

◆ getIndex()

unsigned clang::ConstructionContextItem::getIndex ( ) const
inline

If a single trigger statement triggers multiple constructors, they are usually being enumerated.

This covers function argument constructors triggered by a call-expression and items in an initializer list triggered by an init-list-expression.

Definition at line 167 of file ConstructionContext.h.

Referenced by clang::ConstructionContext::createFromLayers().

◆ getKind()

ItemKind clang::ConstructionContextItem::getKind ( ) const
inline

◆ getKindAsString() [1/2]

LLVM_DUMP_METHOD StringRef clang::ConstructionContextItem::getKindAsString ( ) const
inline

Definition at line 138 of file ConstructionContext.h.

References getKind(), and getKindAsString().

Referenced by getKindAsString().

◆ getKindAsString() [2/2]

static LLVM_DUMP_METHOD StringRef clang::ConstructionContextItem::getKindAsString ( ItemKind  K)
inlinestatic

◆ getStmt()

const Stmt * clang::ConstructionContextItem::getStmt ( ) const
inline

The construction site - the statement that triggered the construction for one of its parts.

For instance, stack variable declaration statement triggers construction of itself or its elements if it's an array, new-expression triggers construction of the newly allocated object(s).

Definition at line 146 of file ConstructionContext.h.

References Data.

Referenced by clang::ConstructionContext::createFromLayers(), and getStmtOrNull().

◆ getStmtOrNull()

const Stmt * clang::ConstructionContextItem::getStmtOrNull ( ) const
inline

Definition at line 151 of file ConstructionContext.h.

References getStmt().

◆ operator<()

bool clang::ConstructionContextItem::operator< ( const ConstructionContextItem Other) const
inline

Definition at line 188 of file ConstructionContext.h.

References Data, and clang::Other.

◆ operator==()

bool clang::ConstructionContextItem::operator== ( const ConstructionContextItem Other) const
inline

Definition at line 180 of file ConstructionContext.h.

References Data, and clang::Other.

◆ Profile()

void clang::ConstructionContextItem::Profile ( llvm::FoldingSetNodeID &  ID) const
inline

Definition at line 174 of file ConstructionContext.h.

References Data, and ID.


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