clang 20.0.0git
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
clang::CFGElement Class Reference

Represents a top-level expression in a basic block. More...

#include "clang/Analysis/CFG.h"

Inheritance diagram for clang::CFGElement:
Inheritance graph
[legend]

Public Types

enum  Kind {
  Initializer , ScopeBegin , ScopeEnd , NewAllocator ,
  LifetimeEnds , LoopExit , Statement , Constructor ,
  CXXRecordTypedCall , STMT_BEGIN = Statement , STMT_END = CXXRecordTypedCall , AutomaticObjectDtor ,
  DeleteDtor , BaseDtor , MemberDtor , TemporaryDtor ,
  DTOR_BEGIN = AutomaticObjectDtor , DTOR_END = TemporaryDtor , CleanupFunction
}
 

Public Member Functions

template<typename T >
T castAs () const
 Convert to the specified CFGElement type, asserting that this CFGElement is of the desired type.
 
template<typename T >
std::optional< TgetAs () const
 Convert to the specified CFGElement type, returning std::nullopt if this CFGElement is not of the desired type.
 
Kind getKind () const
 
void dumpToStream (llvm::raw_ostream &OS) const
 
void dump () const
 

Protected Member Functions

 CFGElement (Kind kind, const void *Ptr1, const void *Ptr2=nullptr)
 
 CFGElement ()=default
 

Protected Attributes

llvm::PointerIntPair< void *, 2 > Data1
 
llvm::PointerIntPair< void *, 2 > Data2
 

Detailed Description

Represents a top-level expression in a basic block.

Definition at line 55 of file CFG.h.

Member Enumeration Documentation

◆ Kind

Enumerator
Initializer 
ScopeBegin 
ScopeEnd 
NewAllocator 
LifetimeEnds 
LoopExit 
Statement 
Constructor 
CXXRecordTypedCall 
STMT_BEGIN 
STMT_END 
AutomaticObjectDtor 
DeleteDtor 
BaseDtor 
MemberDtor 
TemporaryDtor 
DTOR_BEGIN 
DTOR_END 
CleanupFunction 

Definition at line 57 of file CFG.h.

Constructor & Destructor Documentation

◆ CFGElement() [1/2]

clang::CFGElement::CFGElement ( Kind  kind,
const void *  Ptr1,
const void *  Ptr2 = nullptr 
)
inlineprotected

Definition at line 87 of file CFG.h.

References getKind().

◆ CFGElement() [2/2]

clang::CFGElement::CFGElement ( )
protecteddefault

Member Function Documentation

◆ castAs()

template<typename T >
T clang::CFGElement::castAs ( ) const
inline

◆ dump()

void clang::CFGElement::dump ( ) const
inline

Definition at line 127 of file CFG.h.

References dumpToStream().

◆ dumpToStream()

void CFGElement::dumpToStream ( llvm::raw_ostream &  OS) const

Definition at line 5756 of file CFG.cpp.

References print_elem().

Referenced by dump().

◆ getAs()

template<typename T >
std::optional< T > clang::CFGElement::getAs ( ) const
inline

Convert to the specified CFGElement type, returning std::nullopt if this CFGElement is not of the desired type.

Definition at line 109 of file CFG.h.

References clang::T.

Referenced by Accumulate(), CheckFallThrough(), clang::ento::CallEvent::getConstructionContext(), clang::CFGBlock::getLastCondition(), isBuiltinAssumeFalse(), and isImmediateSinkBlock().

◆ getKind()

Kind clang::CFGElement::getKind ( ) const
inline

Member Data Documentation

◆ Data1

llvm::PointerIntPair<void *, 2> clang::CFGElement::Data1
protected

◆ Data2

llvm::PointerIntPair<void *, 2> clang::CFGElement::Data2
protected

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