clang 23.0.0git
clang::CFGBlock Class Reference

Represents a single basic block in a source-level CFG. More...

#include "clang/Analysis/CFG.h"

Classes

class  AdjacentBlock
 This class represents a potential adjacent block in the CFG. More...
class  FilteredCFGBlockIterator
class  FilterOptions

Public Types

using iterator = ElementList::iterator
using const_iterator = ElementList::const_iterator
using reverse_iterator = ElementList::reverse_iterator
using const_reverse_iterator = ElementList::const_reverse_iterator
using CFGElementRef = ElementRefImpl<false>
using ConstCFGElementRef = ElementRefImpl<true>
using ref_iterator = ElementRefIterator<false, false>
using ref_iterator_range = llvm::iterator_range<ref_iterator>
using const_ref_iterator = ElementRefIterator<false, true>
using const_ref_iterator_range = llvm::iterator_range<const_ref_iterator>
using reverse_ref_iterator = ElementRefIterator<true, false>
using reverse_ref_iterator_range = llvm::iterator_range<reverse_ref_iterator>
using const_reverse_ref_iterator = ElementRefIterator<true, true>
using const_reverse_ref_iterator_range
using pred_iterator = AdjacentBlocks::iterator
using const_pred_iterator = AdjacentBlocks::const_iterator
using pred_reverse_iterator = AdjacentBlocks::reverse_iterator
using const_pred_reverse_iterator = AdjacentBlocks::const_reverse_iterator
using pred_range = llvm::iterator_range<pred_iterator>
using pred_const_range = llvm::iterator_range<const_pred_iterator>
using succ_iterator = AdjacentBlocks::iterator
using const_succ_iterator = AdjacentBlocks::const_iterator
using succ_reverse_iterator = AdjacentBlocks::reverse_iterator
using const_succ_reverse_iterator = AdjacentBlocks::const_reverse_iterator
using succ_range = llvm::iterator_range<succ_iterator>
using succ_const_range = llvm::iterator_range<const_succ_iterator>
using filtered_pred_iterator
using filtered_succ_iterator

Public Member Functions

 CFGBlock (unsigned blockid, BumpVectorContext &C, CFG *parent)
size_t getIndexInCFG () const
CFGElement front () const
CFGElement back () const
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
reverse_iterator rbegin ()
reverse_iterator rend ()
const_reverse_iterator rbegin () const
const_reverse_iterator rend () const
ref_iterator ref_begin ()
ref_iterator ref_end ()
const_ref_iterator ref_begin () const
const_ref_iterator ref_end () const
reverse_ref_iterator rref_begin ()
reverse_ref_iterator rref_end ()
const_reverse_ref_iterator rref_begin () const
const_reverse_ref_iterator rref_end () const
ref_iterator_range refs ()
const_ref_iterator_range refs () const
reverse_ref_iterator_range rrefs ()
const_reverse_ref_iterator_range rrefs () const
unsigned size () const
bool empty () const
CFGElement operator[] (size_t i) const
pred_iterator pred_begin ()
pred_iterator pred_end ()
const_pred_iterator pred_begin () const
const_pred_iterator pred_end () const
pred_reverse_iterator pred_rbegin ()
pred_reverse_iterator pred_rend ()
const_pred_reverse_iterator pred_rbegin () const
const_pred_reverse_iterator pred_rend () const
pred_range preds ()
pred_const_range preds () const
succ_iterator succ_begin ()
succ_iterator succ_end ()
const_succ_iterator succ_begin () const
const_succ_iterator succ_end () const
succ_reverse_iterator succ_rbegin ()
succ_reverse_iterator succ_rend ()
const_succ_reverse_iterator succ_rbegin () const
const_succ_reverse_iterator succ_rend () const
succ_range succs ()
succ_const_range succs () const
unsigned succ_size () const
bool succ_empty () const
unsigned pred_size () const
bool pred_empty () const
filtered_pred_iterator filtered_pred_start_end (const FilterOptions &f) const
filtered_succ_iterator filtered_succ_start_end (const FilterOptions &f) const
void setTerminator (CFGTerminator Term)
void setLabel (Stmt *Statement)
void setLoopTarget (const Stmt *loopTarget)
void setHasNoReturnElement ()
bool isInevitablySinking () const
 Returns true if the block would eventually end with a sink (a noreturn node).
CFGTerminator getTerminator () const
StmtgetTerminatorStmt ()
const StmtgetTerminatorStmt () const
const ExprgetLastCondition () const
const StmtgetTerminatorCondition (bool StripParens=true) const
const StmtgetLoopTarget () const
StmtgetLabel ()
const StmtgetLabel () const
bool hasNoReturnElement () const
unsigned getBlockID () const
CFGgetParent () const
void dump () const
void dump (const CFG *cfg, const LangOptions &LO, bool ShowColors=false) const
 dump - A simply pretty printer of a CFGBlock that outputs to stderr.
void print (raw_ostream &OS, const CFG *cfg, const LangOptions &LO, bool ShowColors) const
 print - A simple pretty printer of a CFGBlock that outputs to an ostream.
void printTerminator (raw_ostream &OS, const LangOptions &LO) const
 printTerminator - A simple pretty printer of the terminator of a CFGBlock.
void printTerminatorJson (raw_ostream &Out, const LangOptions &LO, bool AddQuotes) const
 printTerminatorJson - Pretty-prints the terminator in JSON format.
void printAsOperand (raw_ostream &OS, bool)
void addSuccessor (AdjacentBlock Succ, BumpVectorContext &C)
 Adds a (potentially unreachable) successor block to the current block.
void appendStmt (Stmt *statement, BumpVectorContext &C)
void appendConstructor (CXXConstructExpr *CE, const ConstructionContext *CC, BumpVectorContext &C)
void appendCXXRecordTypedCall (Expr *E, const ConstructionContext *CC, BumpVectorContext &C)
void appendInitializer (CXXCtorInitializer *initializer, BumpVectorContext &C)
void appendNewAllocator (CXXNewExpr *NE, BumpVectorContext &C)
void appendScopeBegin (const VarDecl *VD, const Stmt *S, BumpVectorContext &C)
void appendScopeEnd (const VarDecl *VD, const Stmt *S, BumpVectorContext &C)
void appendBaseDtor (const CXXBaseSpecifier *BS, BumpVectorContext &C)
void appendMemberDtor (FieldDecl *FD, BumpVectorContext &C)
void appendTemporaryDtor (CXXBindTemporaryExpr *E, BumpVectorContext &C)
void appendAutomaticObjDtor (VarDecl *VD, Stmt *S, BumpVectorContext &C)
void appendCleanupFunction (const VarDecl *VD, BumpVectorContext &C)
void appendLifetimeEnds (VarDecl *VD, Stmt *S, BumpVectorContext &C)
void appendFullExprCleanup (BumpVector< const MaterializeTemporaryExpr * > *BV, const ExprWithCleanups *CleanupExpr, BumpVectorContext &C)
void appendLoopExit (const Stmt *LoopStmt, BumpVectorContext &C)
void appendDeleteDtor (CXXRecordDecl *RD, CXXDeleteExpr *DE, BumpVectorContext &C)

Static Public Member Functions

static bool FilterEdge (const FilterOptions &F, const CFGBlock *Src, const CFGBlock *Dst)

Public Attributes

ElementList Elements
 The set of statements in the basic block.
StmtLabel = nullptr
 An (optional) label that prefixes the executable statements in the block.
CFGTerminator Terminator
 The terminator for a basic block that indicates the type of control-flow that occurs between a block and its successors.
const StmtLoopTarget = nullptr
 Some blocks are used to represent the "loop edge" to the start of a loop from within the loop body.
unsigned BlockID
 A numerical ID assigned to a CFGBlock during construction of the CFG.

Detailed Description

Represents a single basic block in a source-level CFG.

It consists of:

(1) A set of statements/expressions (which may contain subexpressions). (2) A "terminator" statement (not in the set of statements). (3) A list of successors and predecessors.

Terminator: The terminator represents the type of control-flow that occurs at the end of the basic block. The terminator is a Stmt* referring to an AST node that has control-flow: if-statements, breaks, loops, etc. If the control-flow is conditional, the condition expression will appear within the set of statements in the block (usually the last statement).

Predecessors: the order in the set of predecessors is arbitrary.

Successors: the order in the set of successors is NOT arbitrary. We currently have the following orderings based on the terminator:

Terminator Successor Ordering
if Then Block; Else Block
? operator LHS expression; RHS expression
logical and/or expression that consumes the op, RHS
vbase inits already handled by the most derived class; not yet

But note that any of that may be NULL in case of optimized-out edges.

Definition at line 652 of file CFG.h.

Member Typedef Documentation

◆ CFGElementRef

using clang::CFGBlock::CFGElementRef = ElementRefImpl<false>

Definition at line 967 of file CFG.h.

◆ const_iterator

using clang::CFGBlock::const_iterator = ElementList::const_iterator

Definition at line 948 of file CFG.h.

◆ const_pred_iterator

◆ const_pred_reverse_iterator

◆ const_ref_iterator

using clang::CFGBlock::const_ref_iterator = ElementRefIterator<false, true>

Definition at line 972 of file CFG.h.

◆ const_ref_iterator_range

Definition at line 973 of file CFG.h.

◆ const_reverse_iterator

◆ const_reverse_ref_iterator

Definition at line 978 of file CFG.h.

◆ const_reverse_ref_iterator_range

Initial value:
llvm::iterator_range<const_reverse_ref_iterator>

Definition at line 979 of file CFG.h.

◆ const_succ_iterator

◆ const_succ_reverse_iterator

◆ ConstCFGElementRef

using clang::CFGBlock::ConstCFGElementRef = ElementRefImpl<true>

Definition at line 968 of file CFG.h.

◆ filtered_pred_iterator

◆ filtered_succ_iterator

◆ iterator

using clang::CFGBlock::iterator = ElementList::iterator

Definition at line 947 of file CFG.h.

◆ pred_const_range

Definition at line 1010 of file CFG.h.

◆ pred_iterator

◆ pred_range

using clang::CFGBlock::pred_range = llvm::iterator_range<pred_iterator>

Definition at line 1009 of file CFG.h.

◆ pred_reverse_iterator

◆ ref_iterator

using clang::CFGBlock::ref_iterator = ElementRefIterator<false, false>

Definition at line 970 of file CFG.h.

◆ ref_iterator_range

using clang::CFGBlock::ref_iterator_range = llvm::iterator_range<ref_iterator>

Definition at line 971 of file CFG.h.

◆ reverse_iterator

◆ reverse_ref_iterator

using clang::CFGBlock::reverse_ref_iterator = ElementRefIterator<true, false>

Definition at line 975 of file CFG.h.

◆ reverse_ref_iterator_range

Definition at line 976 of file CFG.h.

◆ succ_const_range

Definition at line 1017 of file CFG.h.

◆ succ_iterator

◆ succ_range

using clang::CFGBlock::succ_range = llvm::iterator_range<succ_iterator>

Definition at line 1016 of file CFG.h.

◆ succ_reverse_iterator

Constructor & Destructor Documentation

◆ CFGBlock()

Member Function Documentation

◆ addSuccessor()

void CFGBlock::addSuccessor ( AdjacentBlock Succ,
BumpVectorContext & C )

◆ appendAutomaticObjDtor()

void clang::CFGBlock::appendAutomaticObjDtor ( VarDecl * VD,
Stmt * S,
BumpVectorContext & C )
inline

Definition at line 1221 of file CFG.h.

References clang::C, and Elements.

◆ appendBaseDtor()

void clang::CFGBlock::appendBaseDtor ( const CXXBaseSpecifier * BS,
BumpVectorContext & C )
inline

Definition at line 1209 of file CFG.h.

References clang::C, and Elements.

◆ appendCleanupFunction()

void clang::CFGBlock::appendCleanupFunction ( const VarDecl * VD,
BumpVectorContext & C )
inline

Definition at line 1225 of file CFG.h.

References clang::C, and Elements.

◆ appendConstructor()

void clang::CFGBlock::appendConstructor ( CXXConstructExpr * CE,
const ConstructionContext * CC,
BumpVectorContext & C )
inline

Definition at line 1179 of file CFG.h.

References clang::C, and Elements.

◆ appendCXXRecordTypedCall()

void clang::CFGBlock::appendCXXRecordTypedCall ( Expr * E,
const ConstructionContext * CC,
BumpVectorContext & C )
inline

Definition at line 1184 of file CFG.h.

References clang::C, and Elements.

◆ appendDeleteDtor()

void clang::CFGBlock::appendDeleteDtor ( CXXRecordDecl * RD,
CXXDeleteExpr * DE,
BumpVectorContext & C )
inline

Definition at line 1243 of file CFG.h.

References clang::C, and Elements.

◆ appendFullExprCleanup()

void clang::CFGBlock::appendFullExprCleanup ( BumpVector< const MaterializeTemporaryExpr * > * BV,
const ExprWithCleanups * CleanupExpr,
BumpVectorContext & C )
inline

Definition at line 1233 of file CFG.h.

References clang::C, and Elements.

◆ appendInitializer()

void clang::CFGBlock::appendInitializer ( CXXCtorInitializer * initializer,
BumpVectorContext & C )
inline

Definition at line 1190 of file CFG.h.

References clang::C, and Elements.

◆ appendLifetimeEnds()

void clang::CFGBlock::appendLifetimeEnds ( VarDecl * VD,
Stmt * S,
BumpVectorContext & C )
inline

Definition at line 1229 of file CFG.h.

References clang::C, and Elements.

◆ appendLoopExit()

void clang::CFGBlock::appendLoopExit ( const Stmt * LoopStmt,
BumpVectorContext & C )
inline

Definition at line 1239 of file CFG.h.

References clang::C, and Elements.

◆ appendMemberDtor()

void clang::CFGBlock::appendMemberDtor ( FieldDecl * FD,
BumpVectorContext & C )
inline

Definition at line 1213 of file CFG.h.

References clang::C, and Elements.

◆ appendNewAllocator()

void clang::CFGBlock::appendNewAllocator ( CXXNewExpr * NE,
BumpVectorContext & C )
inline

Definition at line 1195 of file CFG.h.

References clang::C, and Elements.

◆ appendScopeBegin()

void clang::CFGBlock::appendScopeBegin ( const VarDecl * VD,
const Stmt * S,
BumpVectorContext & C )
inline

Definition at line 1200 of file CFG.h.

References clang::C, and Elements.

◆ appendScopeEnd()

void clang::CFGBlock::appendScopeEnd ( const VarDecl * VD,
const Stmt * S,
BumpVectorContext & C )
inline

Definition at line 1205 of file CFG.h.

References clang::C, and Elements.

◆ appendStmt()

void clang::CFGBlock::appendStmt ( Stmt * statement,
BumpVectorContext & C )
inline

Definition at line 1175 of file CFG.h.

References clang::C, and Elements.

◆ appendTemporaryDtor()

void clang::CFGBlock::appendTemporaryDtor ( CXXBindTemporaryExpr * E,
BumpVectorContext & C )
inline

Definition at line 1217 of file CFG.h.

References clang::C, and Elements.

◆ back()

CFGElement clang::CFGBlock::back ( ) const
inline

Definition at line 955 of file CFG.h.

References Elements.

Referenced by clang::CFG::back(), isBuiltinAssumeFalse(), and neverReturns().

◆ begin() [1/2]

iterator clang::CFGBlock::begin ( )
inline

Definition at line 957 of file CFG.h.

References Elements.

Referenced by clang::CFG::begin(), clang::CFG::begin(), print_block(), ref_begin(), and ref_begin().

◆ begin() [2/2]

const_iterator clang::CFGBlock::begin ( ) const
inline

Definition at line 959 of file CFG.h.

References Elements.

◆ dump() [1/2]

LLVM_DUMP_METHOD void CFGBlock::dump ( ) const

◆ dump() [2/2]

void CFGBlock::dump ( const CFG * cfg,
const LangOptions & LO,
bool ShowColors = false ) const

dump - A simply pretty printer of a CFGBlock that outputs to stderr.

Definition at line 6392 of file CFG.cpp.

References print().

◆ empty()

◆ end() [1/2]

iterator clang::CFGBlock::end ( )
inline

Definition at line 958 of file CFG.h.

References Elements.

Referenced by clang::CFG::end(), clang::CFG::end(), print_block(), ref_end(), and ref_end().

◆ end() [2/2]

const_iterator clang::CFGBlock::end ( ) const
inline

Definition at line 960 of file CFG.h.

References Elements.

◆ filtered_pred_start_end()

filtered_pred_iterator clang::CFGBlock::filtered_pred_start_end ( const FilterOptions & f) const
inline

Definition at line 1113 of file CFG.h.

References pred_begin(), and pred_end().

Referenced by CheckFallThrough().

◆ filtered_succ_start_end()

filtered_succ_iterator clang::CFGBlock::filtered_succ_start_end ( const FilterOptions & f) const
inline

Definition at line 1117 of file CFG.h.

References succ_begin(), and succ_end().

◆ FilterEdge()

◆ front()

CFGElement clang::CFGBlock::front ( ) const
inline

Definition at line 954 of file CFG.h.

References Elements.

Referenced by clang::CFG::front(), and clang::BlockEntrance::getFirstElement().

◆ getBlockID()

◆ getIndexInCFG()

size_t CFGBlock::getIndexInCFG ( ) const

Definition at line 6387 of file CFG.cpp.

References clang::CFG::begin(), and getParent().

◆ getLabel() [1/2]

Stmt * clang::CFGBlock::getLabel ( )
inline

Definition at line 1149 of file CFG.h.

References Label.

Referenced by DiagnoseSwitchLabelsFallthrough(), FilterEdge(), print_block(), and clang::ProgramPoint::printJson().

◆ getLabel() [2/2]

const Stmt * clang::CFGBlock::getLabel ( ) const
inline

Definition at line 1150 of file CFG.h.

References Label.

◆ getLastCondition()

const Expr * CFGBlock::getLastCondition ( ) const
Returns
the last (rbegin()) condition, e.g. observe the following code snippet: if (A && B && C) A block would be created for A, B, and C. For the latter, getTerminatorStmt() would retrieve the entire condition, rather than C itself, while this method would only return C.

Definition at line 6492 of file CFG.cpp.

References clang::cast(), clang::Cond, clang::CFGElement::getAs(), clang::isa(), rbegin(), size(), clang::CFGTerminator::StmtBranch, succ_size(), and Terminator.

◆ getLoopTarget()

const Stmt * clang::CFGBlock::getLoopTarget ( ) const
inline

Definition at line 1147 of file CFG.h.

References LoopTarget.

Referenced by clang::isBackedgeCFGNode().

◆ getParent()

CFG * clang::CFGBlock::getParent ( ) const
inline

◆ getTerminator()

◆ getTerminatorCondition()

const Stmt * CFGBlock::getTerminatorCondition ( bool StripParens = true) const

◆ getTerminatorStmt() [1/2]

◆ getTerminatorStmt() [2/2]

const Stmt * clang::CFGBlock::getTerminatorStmt ( ) const
inline

Definition at line 1135 of file CFG.h.

References Terminator.

◆ hasNoReturnElement()

bool clang::CFGBlock::hasNoReturnElement ( ) const
inline

Definition at line 1152 of file CFG.h.

Referenced by CheckFallThrough(), isImmediateSinkBlock(), neverReturns(), and print_block().

◆ isInevitablySinking()

bool CFGBlock::isInevitablySinking ( ) const

Returns true if the block would eventually end with a sink (a noreturn node).

Definition at line 6455 of file CFG.cpp.

References CFGBlock(), clang::CFG::getExit(), getParent(), isImmediateSinkBlock(), and succs().

Referenced by isAssertlikeBlock().

◆ operator[]()

CFGElement clang::CFGBlock::operator[] ( size_t i) const
inline

Definition at line 1002 of file CFG.h.

References Elements.

◆ pred_begin() [1/2]

◆ pred_begin() [2/2]

const_pred_iterator clang::CFGBlock::pred_begin ( ) const
inline

Definition at line 1021 of file CFG.h.

◆ pred_empty()

bool clang::CFGBlock::pred_empty ( ) const
inline

Definition at line 1059 of file CFG.h.

Referenced by checkRecursiveFunction(), checkThrowInNonThrowingFunc(), and print_block().

◆ pred_end() [1/2]

◆ pred_end() [2/2]

const_pred_iterator clang::CFGBlock::pred_end ( ) const
inline

Definition at line 1022 of file CFG.h.

◆ pred_rbegin() [1/2]

pred_reverse_iterator clang::CFGBlock::pred_rbegin ( )
inline

Definition at line 1024 of file CFG.h.

◆ pred_rbegin() [2/2]

const_pred_reverse_iterator clang::CFGBlock::pred_rbegin ( ) const
inline

Definition at line 1026 of file CFG.h.

◆ pred_rend() [1/2]

pred_reverse_iterator clang::CFGBlock::pred_rend ( )
inline

Definition at line 1025 of file CFG.h.

◆ pred_rend() [2/2]

const_pred_reverse_iterator clang::CFGBlock::pred_rend ( ) const
inline

Definition at line 1027 of file CFG.h.

◆ pred_size()

unsigned clang::CFGBlock::pred_size ( ) const
inline

Definition at line 1058 of file CFG.h.

Referenced by isDeadReturn(), and print_block().

◆ preds() [1/2]

pred_range clang::CFGBlock::preds ( )
inline

Definition at line 1029 of file CFG.h.

References pred_begin(), and pred_end().

◆ preds() [2/2]

pred_const_range clang::CFGBlock::preds ( ) const
inline

Definition at line 1033 of file CFG.h.

References pred_begin(), and pred_end().

◆ print()

void CFGBlock::print ( raw_ostream & OS,
const CFG * cfg,
const LangOptions & LO,
bool ShowColors ) const

print - A simple pretty printer of a CFGBlock that outputs to an ostream.

Generally this will only be called from CFG::print.

Definition at line 6403 of file CFG.cpp.

References print_block().

Referenced by clang::CFG::dump(), and dump().

◆ printAsOperand()

void clang::CFGBlock::printAsOperand ( raw_ostream & OS,
bool  )
inline

Definition at line 1168 of file CFG.h.

References getBlockID().

◆ printTerminator()

void CFGBlock::printTerminator ( raw_ostream & OS,
const LangOptions & LO ) const

printTerminator - A simple pretty printer of the terminator of a CFGBlock.

Definition at line 6411 of file CFG.cpp.

References getTerminator().

Referenced by printTerminatorJson().

◆ printTerminatorJson()

void CFGBlock::printTerminatorJson ( raw_ostream & Out,
const LangOptions & LO,
bool AddQuotes ) const

printTerminatorJson - Pretty-prints the terminator in JSON format.

Definition at line 6418 of file CFG.cpp.

References clang::JsonFormat(), and printTerminator().

Referenced by clang::ProgramPoint::printJson().

◆ rbegin() [1/2]

reverse_iterator clang::CFGBlock::rbegin ( )
inline

◆ rbegin() [2/2]

const_reverse_iterator clang::CFGBlock::rbegin ( ) const
inline

Definition at line 964 of file CFG.h.

References Elements.

◆ ref_begin() [1/2]

ref_iterator clang::CFGBlock::ref_begin ( )
inline

Definition at line 982 of file CFG.h.

References begin().

Referenced by refs(), and refs().

◆ ref_begin() [2/2]

const_ref_iterator clang::CFGBlock::ref_begin ( ) const
inline

Definition at line 984 of file CFG.h.

References begin().

◆ ref_end() [1/2]

ref_iterator clang::CFGBlock::ref_end ( )
inline

Definition at line 983 of file CFG.h.

References end().

Referenced by refs(), and refs().

◆ ref_end() [2/2]

const_ref_iterator clang::CFGBlock::ref_end ( ) const
inline

Definition at line 985 of file CFG.h.

References end().

◆ refs() [1/2]

ref_iterator_range clang::CFGBlock::refs ( )
inline

Definition at line 992 of file CFG.h.

References ref_begin(), and ref_end().

◆ refs() [2/2]

const_ref_iterator_range clang::CFGBlock::refs ( ) const
inline

Definition at line 993 of file CFG.h.

References ref_begin(), and ref_end().

◆ rend() [1/2]

reverse_iterator clang::CFGBlock::rend ( )
inline

Definition at line 963 of file CFG.h.

References Elements.

Referenced by CheckFallThrough(), rref_end(), and rref_end().

◆ rend() [2/2]

const_reverse_iterator clang::CFGBlock::rend ( ) const
inline

Definition at line 965 of file CFG.h.

References Elements.

◆ rref_begin() [1/2]

reverse_ref_iterator clang::CFGBlock::rref_begin ( )
inline

Definition at line 987 of file CFG.h.

References rbegin().

Referenced by rrefs(), and rrefs().

◆ rref_begin() [2/2]

const_reverse_ref_iterator clang::CFGBlock::rref_begin ( ) const
inline

Definition at line 989 of file CFG.h.

References rbegin().

◆ rref_end() [1/2]

reverse_ref_iterator clang::CFGBlock::rref_end ( )
inline

Definition at line 988 of file CFG.h.

References rend().

Referenced by rrefs(), and rrefs().

◆ rref_end() [2/2]

const_reverse_ref_iterator clang::CFGBlock::rref_end ( ) const
inline

Definition at line 990 of file CFG.h.

References rend().

◆ rrefs() [1/2]

reverse_ref_iterator_range clang::CFGBlock::rrefs ( )
inline

Definition at line 994 of file CFG.h.

References rref_begin(), and rref_end().

◆ rrefs() [2/2]

const_reverse_ref_iterator_range clang::CFGBlock::rrefs ( ) const
inline

Definition at line 995 of file CFG.h.

References rref_begin(), and rref_end().

◆ setHasNoReturnElement()

void clang::CFGBlock::setHasNoReturnElement ( )
inline

Definition at line 1126 of file CFG.h.

◆ setLabel()

void clang::CFGBlock::setLabel ( Stmt * Statement)
inline

Definition at line 1124 of file CFG.h.

References Label.

◆ setLoopTarget()

void clang::CFGBlock::setLoopTarget ( const Stmt * loopTarget)
inline

Definition at line 1125 of file CFG.h.

References LoopTarget.

◆ setTerminator()

void clang::CFGBlock::setTerminator ( CFGTerminator Term)
inline

Definition at line 1123 of file CFG.h.

References Terminator.

◆ size()

unsigned clang::CFGBlock::size ( ) const
inline

Definition at line 999 of file CFG.h.

References Elements.

Referenced by clang::ento::CallEvent::getCalleeStackFrame(), and getLastCondition().

◆ succ_begin() [1/2]

◆ succ_begin() [2/2]

const_succ_iterator clang::CFGBlock::succ_begin ( ) const
inline

Definition at line 1039 of file CFG.h.

◆ succ_empty()

bool clang::CFGBlock::succ_empty ( ) const
inline

Definition at line 1056 of file CFG.h.

Referenced by print_block().

◆ succ_end() [1/2]

◆ succ_end() [2/2]

const_succ_iterator clang::CFGBlock::succ_end ( ) const
inline

Definition at line 1040 of file CFG.h.

◆ succ_rbegin() [1/2]

succ_reverse_iterator clang::CFGBlock::succ_rbegin ( )
inline

Definition at line 1042 of file CFG.h.

Referenced by clang::ento::ExprEngine::processSwitch().

◆ succ_rbegin() [2/2]

const_succ_reverse_iterator clang::CFGBlock::succ_rbegin ( ) const
inline

Definition at line 1044 of file CFG.h.

◆ succ_rend() [1/2]

succ_reverse_iterator clang::CFGBlock::succ_rend ( )
inline

Definition at line 1043 of file CFG.h.

Referenced by clang::ento::ExprEngine::processSwitch().

◆ succ_rend() [2/2]

const_succ_reverse_iterator clang::CFGBlock::succ_rend ( ) const
inline

Definition at line 1045 of file CFG.h.

◆ succ_size()

◆ succs() [1/2]

◆ succs() [2/2]

succ_const_range clang::CFGBlock::succs ( ) const
inline

Definition at line 1051 of file CFG.h.

References succ_begin(), and succ_end().

Member Data Documentation

◆ BlockID

unsigned clang::CFGBlock::BlockID

A numerical ID assigned to a CFGBlock during construction of the CFG.

Definition at line 864 of file CFG.h.

Referenced by CFGBlock(), and getBlockID().

◆ Elements

◆ Label

Stmt* clang::CFGBlock::Label = nullptr

An (optional) label that prefixes the executable statements in the block.

When this variable is non-NULL, it is either an instance of LabelStmt, SwitchCase or CXXCatchStmt.

Definition at line 852 of file CFG.h.

Referenced by getLabel(), getLabel(), print_block(), and setLabel().

◆ LoopTarget

const Stmt* clang::CFGBlock::LoopTarget = nullptr

Some blocks are used to represent the "loop edge" to the start of a loop from within the loop body.

This Stmt* will be refer to the loop statement for such blocks (and be null otherwise).

Definition at line 861 of file CFG.h.

Referenced by getLoopTarget(), and setLoopTarget().

◆ Terminator

CFGTerminator clang::CFGBlock::Terminator

The terminator for a basic block that indicates the type of control-flow that occurs between a block and its successors.

Definition at line 856 of file CFG.h.

Referenced by CFGBlock(), getLastCondition(), getTerminator(), getTerminatorCondition(), getTerminatorStmt(), getTerminatorStmt(), and setTerminator().


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