clang  8.0.0svn
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,
  STATEMENT_WITH_INDEX_KIND_BEGIN =ArgumentKind, STATEMENT_WITH_INDEX_KIND_END =ArgumentKind, STATEMENT_KIND_BEGIN = VariableKind, STATEMENT_KIND_END = ArgumentKind,
  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 ObjCMessageExpr *ME, unsigned Index)
 
 ConstructionContextItem (const Expr *E, unsigned Index)
 
 ConstructionContextItem (const CXXCtorInitializer *Init)
 
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. More...
 
const StmtgetStmtOrNull () const
 
const CXXCtorInitializergetCXXCtorInitializer () const
 The construction site is not necessarily a statement. More...
 
unsigned getIndex () const
 If a single trigger statement triggers multiple constructors, they are usually being enumerated. More...
 
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 
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/11]

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

Definition at line 87 of file ConstructionContext.h.

◆ ConstructionContextItem() [2/11]

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

Definition at line 90 of file ConstructionContext.h.

◆ ConstructionContextItem() [3/11]

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

Definition at line 93 of file ConstructionContext.h.

◆ ConstructionContextItem() [4/11]

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

Definition at line 96 of file ConstructionContext.h.

◆ ConstructionContextItem() [5/11]

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

Definition at line 99 of file ConstructionContext.h.

◆ ConstructionContextItem() [6/11]

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

Definition at line 104 of file ConstructionContext.h.

◆ ConstructionContextItem() [7/11]

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

Definition at line 107 of file ConstructionContext.h.

◆ ConstructionContextItem() [8/11]

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

Definition at line 110 of file ConstructionContext.h.

◆ ConstructionContextItem() [9/11]

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

Definition at line 113 of file ConstructionContext.h.

◆ ConstructionContextItem() [10/11]

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

Definition at line 117 of file ConstructionContext.h.

◆ ConstructionContextItem() [11/11]

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

Definition at line 123 of file ConstructionContext.h.

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 148 of file ConstructionContext.h.

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 157 of file ConstructionContext.h.

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

◆ getKind()

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

◆ getKindAsString() [1/2]

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

◆ getKindAsString() [2/2]

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

Definition at line 128 of file ConstructionContext.h.

References getKind().

◆ 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 136 of file ConstructionContext.h.

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

◆ getStmtOrNull()

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

Definition at line 141 of file ConstructionContext.h.

References getStmt().

◆ operator<()

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

Definition at line 178 of file ConstructionContext.h.

◆ operator==()

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

Definition at line 170 of file ConstructionContext.h.

◆ Profile()

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

Definition at line 164 of file ConstructionContext.h.


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