clang 20.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
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 = llvm::iterator_range< const_reverse_ref_iterator >
 
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 = FilteredCFGBlockIterator< const_pred_iterator, true >
 
using filtered_succ_iterator = FilteredCFGBlockIterator< const_succ_iterator, false >
 

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
 
StmtgetTerminatorCondition (bool StripParens=true)
 
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 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 604 of file CFG.h.

Member Typedef Documentation

◆ CFGElementRef

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

Definition at line 914 of file CFG.h.

◆ const_iterator

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

Definition at line 895 of file CFG.h.

◆ const_pred_iterator

Definition at line 953 of file CFG.h.

◆ const_pred_reverse_iterator

Definition at line 955 of file CFG.h.

◆ const_ref_iterator

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

Definition at line 919 of file CFG.h.

◆ const_ref_iterator_range

Definition at line 920 of file CFG.h.

◆ const_reverse_iterator

Definition at line 897 of file CFG.h.

◆ const_reverse_ref_iterator

Definition at line 925 of file CFG.h.

◆ const_reverse_ref_iterator_range

Definition at line 926 of file CFG.h.

◆ const_succ_iterator

Definition at line 960 of file CFG.h.

◆ const_succ_reverse_iterator

Definition at line 962 of file CFG.h.

◆ ConstCFGElementRef

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

Definition at line 915 of file CFG.h.

◆ filtered_pred_iterator

Definition at line 1054 of file CFG.h.

◆ filtered_succ_iterator

Definition at line 1057 of file CFG.h.

◆ iterator

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

Definition at line 894 of file CFG.h.

◆ pred_const_range

Definition at line 957 of file CFG.h.

◆ pred_iterator

Definition at line 952 of file CFG.h.

◆ pred_range

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

Definition at line 956 of file CFG.h.

◆ pred_reverse_iterator

Definition at line 954 of file CFG.h.

◆ ref_iterator

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

Definition at line 917 of file CFG.h.

◆ ref_iterator_range

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

Definition at line 918 of file CFG.h.

◆ reverse_iterator

Definition at line 896 of file CFG.h.

◆ reverse_ref_iterator

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

Definition at line 922 of file CFG.h.

◆ reverse_ref_iterator_range

Definition at line 923 of file CFG.h.

◆ succ_const_range

Definition at line 964 of file CFG.h.

◆ succ_iterator

Definition at line 959 of file CFG.h.

◆ succ_range

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

Definition at line 963 of file CFG.h.

◆ succ_reverse_iterator

Definition at line 961 of file CFG.h.

Constructor & Destructor Documentation

◆ CFGBlock()

clang::CFGBlock::CFGBlock ( unsigned  blockid,
BumpVectorContext C,
CFG parent 
)
inlineexplicit

Definition at line 889 of file CFG.h.

References Parent.

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 1172 of file CFG.h.

References clang::C, and Elements.

◆ appendBaseDtor()

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

Definition at line 1160 of file CFG.h.

References clang::C, and Elements.

◆ appendCleanupFunction()

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

Definition at line 1176 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 1130 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 1135 of file CFG.h.

References clang::C, E, and Elements.

◆ appendDeleteDtor()

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

Definition at line 1188 of file CFG.h.

References clang::C, and Elements.

◆ appendInitializer()

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

Definition at line 1141 of file CFG.h.

References clang::C, and Elements.

◆ appendLifetimeEnds()

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

Definition at line 1180 of file CFG.h.

References clang::C, and Elements.

◆ appendLoopExit()

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

Definition at line 1184 of file CFG.h.

References clang::C, and Elements.

◆ appendMemberDtor()

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

Definition at line 1164 of file CFG.h.

References clang::C, and Elements.

◆ appendNewAllocator()

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

Definition at line 1146 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 1151 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 1156 of file CFG.h.

References clang::C, and Elements.

◆ appendStmt()

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

Definition at line 1126 of file CFG.h.

References clang::C, and Elements.

◆ appendTemporaryDtor()

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

Definition at line 1168 of file CFG.h.

References clang::C, E, and Elements.

◆ back()

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

Definition at line 902 of file CFG.h.

References Elements.

Referenced by isBuiltinAssumeFalse(), and neverReturns().

◆ begin() [1/2]

iterator clang::CFGBlock::begin ( )
inline

Definition at line 904 of file CFG.h.

References Elements.

Referenced by Accumulate(), isInCoroutineStmt(), print_block(), and ref_begin().

◆ begin() [2/2]

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

Definition at line 906 of file CFG.h.

References Elements.

◆ dump() [1/2]

LLVM_DUMP_METHOD void CFGBlock::dump ( ) const

Definition at line 6139 of file CFG.cpp.

References dump(), and getParent().

Referenced by dump().

◆ 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 6134 of file CFG.cpp.

References print(), and ShowColors.

◆ empty()

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

◆ end() [1/2]

iterator clang::CFGBlock::end ( )
inline

Definition at line 905 of file CFG.h.

References Elements.

Referenced by Accumulate(), isInCoroutineStmt(), print_block(), and ref_end().

◆ end() [2/2]

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

Definition at line 907 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 1060 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 1064 of file CFG.h.

References succ_begin(), and succ_end().

◆ FilterEdge()

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

◆ front()

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

Definition at line 901 of file CFG.h.

References Elements.

Referenced by clang::BlockEntrance::getFirstElement().

◆ getBlockID()

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

◆ getIndexInCFG()

size_t CFGBlock::getIndexInCFG ( ) const

Definition at line 6129 of file CFG.cpp.

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

◆ getLabel() [1/2]

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

Definition at line 1100 of file CFG.h.

References Label.

Referenced by Accumulate(), DiagnoseSwitchLabelsFallthrough(), FilterEdge(), and print_block().

◆ getLabel() [2/2]

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

Definition at line 1101 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 6235 of file CFG.cpp.

References clang::CFGElement::getAs(), clang::CFGTerminator::getKind(), clang::Expr::IgnoreParens(), rbegin(), size(), clang::CFGTerminator::StmtBranch, succ_size(), and Terminator.

◆ getLoopTarget()

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

Definition at line 1098 of file CFG.h.

References LoopTarget.

Referenced by clang::dataflow::isBackedgeNode().

◆ getParent()

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

◆ getTerminator()

CFGTerminator clang::CFGBlock::getTerminator ( ) const
inline

◆ getTerminatorCondition() [1/2]

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

◆ getTerminatorCondition() [2/2]

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

Definition at line 1094 of file CFG.h.

References getTerminatorCondition().

◆ getTerminatorStmt() [1/2]

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

◆ getTerminatorStmt() [2/2]

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

Definition at line 1082 of file CFG.h.

References clang::CFGTerminator::getStmt(), and Terminator.

◆ hasNoReturnElement()

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

Definition at line 1103 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 6197 of file CFG.cpp.

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

Referenced by isAssertlikeBlock().

◆ operator[]()

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

Definition at line 949 of file CFG.h.

References Elements.

◆ pred_begin() [1/2]

pred_iterator clang::CFGBlock::pred_begin ( )
inline

◆ pred_begin() [2/2]

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

Definition at line 968 of file CFG.h.

◆ pred_empty()

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

Definition at line 1006 of file CFG.h.

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

◆ pred_end() [1/2]

pred_iterator clang::CFGBlock::pred_end ( )
inline

◆ pred_end() [2/2]

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

Definition at line 969 of file CFG.h.

◆ pred_rbegin() [1/2]

pred_reverse_iterator clang::CFGBlock::pred_rbegin ( )
inline

Definition at line 971 of file CFG.h.

◆ pred_rbegin() [2/2]

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

Definition at line 973 of file CFG.h.

◆ pred_rend() [1/2]

pred_reverse_iterator clang::CFGBlock::pred_rend ( )
inline

Definition at line 972 of file CFG.h.

◆ pred_rend() [2/2]

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

Definition at line 974 of file CFG.h.

◆ pred_size()

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

Definition at line 1005 of file CFG.h.

Referenced by getLastStmtLoc(), and print_block().

◆ preds() [1/2]

pred_range clang::CFGBlock::preds ( )
inline

Definition at line 976 of file CFG.h.

References pred_begin(), and pred_end().

◆ preds() [2/2]

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

Definition at line 980 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 6145 of file CFG.cpp.

References print_block(), and ShowColors.

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

◆ printAsOperand()

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

Definition at line 1119 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 6153 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 6160 of file CFG.cpp.

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

◆ rbegin() [1/2]

reverse_iterator clang::CFGBlock::rbegin ( )
inline

◆ rbegin() [2/2]

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

Definition at line 911 of file CFG.h.

References Elements.

◆ ref_begin() [1/2]

ref_iterator clang::CFGBlock::ref_begin ( )
inline

Definition at line 929 of file CFG.h.

References begin().

Referenced by refs().

◆ ref_begin() [2/2]

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

Definition at line 931 of file CFG.h.

References begin().

◆ ref_end() [1/2]

ref_iterator clang::CFGBlock::ref_end ( )
inline

Definition at line 930 of file CFG.h.

References end().

Referenced by refs().

◆ ref_end() [2/2]

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

Definition at line 932 of file CFG.h.

References end().

◆ refs() [1/2]

ref_iterator_range clang::CFGBlock::refs ( )
inline

Definition at line 939 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 940 of file CFG.h.

References ref_begin(), and ref_end().

◆ rend() [1/2]

reverse_iterator clang::CFGBlock::rend ( )
inline

Definition at line 910 of file CFG.h.

References Elements.

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

◆ rend() [2/2]

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

Definition at line 912 of file CFG.h.

References Elements.

◆ rref_begin() [1/2]

reverse_ref_iterator clang::CFGBlock::rref_begin ( )
inline

Definition at line 934 of file CFG.h.

References rbegin().

Referenced by rrefs().

◆ rref_begin() [2/2]

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

Definition at line 936 of file CFG.h.

References rbegin().

◆ rref_end() [1/2]

reverse_ref_iterator clang::CFGBlock::rref_end ( )
inline

Definition at line 935 of file CFG.h.

References rend().

Referenced by rrefs().

◆ rref_end() [2/2]

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

Definition at line 937 of file CFG.h.

References rend().

◆ rrefs() [1/2]

reverse_ref_iterator_range clang::CFGBlock::rrefs ( )
inline

Definition at line 941 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 942 of file CFG.h.

References rref_begin(), and rref_end().

◆ setHasNoReturnElement()

void clang::CFGBlock::setHasNoReturnElement ( )
inline

Definition at line 1073 of file CFG.h.

◆ setLabel()

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

Definition at line 1071 of file CFG.h.

References Label.

◆ setLoopTarget()

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

Definition at line 1072 of file CFG.h.

References LoopTarget.

◆ setTerminator()

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

Definition at line 1070 of file CFG.h.

References Terminator.

◆ size()

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

Definition at line 946 of file CFG.h.

References Elements.

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

◆ succ_begin() [1/2]

succ_iterator clang::CFGBlock::succ_begin ( )
inline

◆ succ_begin() [2/2]

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

Definition at line 986 of file CFG.h.

◆ succ_empty()

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

Definition at line 1003 of file CFG.h.

Referenced by print_block().

◆ succ_end() [1/2]

succ_iterator clang::CFGBlock::succ_end ( )
inline

◆ succ_end() [2/2]

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

Definition at line 987 of file CFG.h.

◆ succ_rbegin() [1/2]

succ_reverse_iterator clang::CFGBlock::succ_rbegin ( )
inline

◆ succ_rbegin() [2/2]

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

Definition at line 991 of file CFG.h.

◆ succ_rend() [1/2]

succ_reverse_iterator clang::CFGBlock::succ_rend ( )
inline

◆ succ_rend() [2/2]

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

Definition at line 992 of file CFG.h.

◆ succ_size()

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

◆ succs() [1/2]

succ_range clang::CFGBlock::succs ( )
inline

◆ succs() [2/2]

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

Definition at line 998 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 811 of file CFG.h.

Referenced by getBlockID().

◆ Elements

ElementList clang::CFGBlock::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 799 of file CFG.h.

Referenced by 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 808 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 803 of file CFG.h.

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


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