clang  14.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"

Collaboration diagram for clang::CFGBlock:
Collaboration graph
[legend]

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). More...
 
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. More...
 
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. More...
 
void printTerminator (raw_ostream &OS, const LangOptions &LO) const
 printTerminator - A simple pretty printer of the terminator of a CFGBlock. More...
 
void printTerminatorJson (raw_ostream &Out, const LangOptions &LO, bool AddQuotes) const
 printTerminatorJson - Pretty-prints the terminator in JSON format. More...
 
void printAsOperand (raw_ostream &OS, bool)
 
void addSuccessor (AdjacentBlock Succ, BumpVectorContext &C)
 Adds a (potentially unreachable) successor block to the current block. More...
 
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 prependScopeBegin (const VarDecl *VD, const Stmt *S, BumpVectorContext &C)
 
void appendScopeEnd (const VarDecl *VD, const Stmt *S, BumpVectorContext &C)
 
void prependScopeEnd (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 appendLifetimeEnds (VarDecl *VD, Stmt *S, BumpVectorContext &C)
 
void appendLoopExit (const Stmt *LoopStmt, BumpVectorContext &C)
 
void appendDeleteDtor (CXXRecordDecl *RD, CXXDeleteExpr *DE, BumpVectorContext &C)
 
iterator beginAutomaticObjDtorsInsert (iterator I, size_t Cnt, BumpVectorContext &C)
 
iterator insertAutomaticObjDtor (iterator I, VarDecl *VD, Stmt *S)
 
iterator beginLifetimeEndsInsert (iterator I, size_t Cnt, BumpVectorContext &C)
 
iterator insertLifetimeEnds (iterator I, VarDecl *VD, Stmt *S)
 
iterator beginScopeEndInsert (iterator I, size_t Cnt, BumpVectorContext &C)
 
iterator insertScopeEnd (iterator I, VarDecl *VD, Stmt *S)
 

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

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

Member Typedef Documentation

◆ CFGElementRef

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

Definition at line 885 of file CFG.h.

◆ const_iterator

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

Definition at line 866 of file CFG.h.

◆ const_pred_iterator

Definition at line 924 of file CFG.h.

◆ const_pred_reverse_iterator

Definition at line 926 of file CFG.h.

◆ const_ref_iterator

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

Definition at line 890 of file CFG.h.

◆ const_ref_iterator_range

Definition at line 891 of file CFG.h.

◆ const_reverse_iterator

Definition at line 868 of file CFG.h.

◆ const_reverse_ref_iterator

Definition at line 896 of file CFG.h.

◆ const_reverse_ref_iterator_range

Definition at line 898 of file CFG.h.

◆ const_succ_iterator

Definition at line 931 of file CFG.h.

◆ const_succ_reverse_iterator

Definition at line 933 of file CFG.h.

◆ ConstCFGElementRef

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

Definition at line 886 of file CFG.h.

◆ filtered_pred_iterator

Definition at line 1024 of file CFG.h.

◆ filtered_succ_iterator

Definition at line 1027 of file CFG.h.

◆ iterator

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

Definition at line 865 of file CFG.h.

◆ pred_const_range

Definition at line 928 of file CFG.h.

◆ pred_iterator

Definition at line 923 of file CFG.h.

◆ pred_range

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

Definition at line 927 of file CFG.h.

◆ pred_reverse_iterator

Definition at line 925 of file CFG.h.

◆ ref_iterator

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

Definition at line 888 of file CFG.h.

◆ ref_iterator_range

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

Definition at line 889 of file CFG.h.

◆ reverse_iterator

Definition at line 867 of file CFG.h.

◆ reverse_ref_iterator

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

Definition at line 893 of file CFG.h.

◆ reverse_ref_iterator_range

Definition at line 894 of file CFG.h.

◆ succ_const_range

Definition at line 935 of file CFG.h.

◆ succ_iterator

Definition at line 930 of file CFG.h.

◆ succ_range

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

Definition at line 934 of file CFG.h.

◆ succ_reverse_iterator

Definition at line 932 of file CFG.h.

Constructor & Destructor Documentation

◆ CFGBlock()

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

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

◆ appendBaseDtor()

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

Definition at line 1138 of file CFG.h.

References Elements.

◆ appendConstructor()

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

Definition at line 1099 of file CFG.h.

References Elements.

◆ appendCXXRecordTypedCall()

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

Definition at line 1104 of file CFG.h.

References Elements.

◆ appendDeleteDtor()

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

Definition at line 1162 of file CFG.h.

References Elements.

◆ appendInitializer()

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

Definition at line 1110 of file CFG.h.

References Elements.

◆ appendLifetimeEnds()

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

Definition at line 1154 of file CFG.h.

◆ appendLoopExit()

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

Definition at line 1158 of file CFG.h.

References Elements.

◆ appendMemberDtor()

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

Definition at line 1142 of file CFG.h.

References Elements.

◆ appendNewAllocator()

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

Definition at line 1115 of file CFG.h.

References Elements, and clang::interp::NE().

◆ appendScopeBegin()

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

Definition at line 1120 of file CFG.h.

◆ appendScopeEnd()

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

Definition at line 1130 of file CFG.h.

◆ appendStmt()

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

Definition at line 1095 of file CFG.h.

References Elements, and clang::transformer::statement().

◆ appendTemporaryDtor()

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

Definition at line 1146 of file CFG.h.

References Elements.

◆ back()

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

Definition at line 873 of file CFG.h.

References Elements.

Referenced by neverReturns().

◆ begin() [1/2]

iterator clang::CFGBlock::begin ( )
inline

Definition at line 875 of file CFG.h.

References Elements.

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

◆ begin() [2/2]

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

Definition at line 877 of file CFG.h.

References Elements.

◆ beginAutomaticObjDtorsInsert()

iterator clang::CFGBlock::beginAutomaticObjDtorsInsert ( iterator  I,
size_t  Cnt,
BumpVectorContext C 
)
inline

Definition at line 1169 of file CFG.h.

References Elements.

◆ beginLifetimeEndsInsert()

iterator clang::CFGBlock::beginLifetimeEndsInsert ( iterator  I,
size_t  Cnt,
BumpVectorContext C 
)
inline

Definition at line 1182 of file CFG.h.

References Elements.

◆ beginScopeEndInsert()

iterator clang::CFGBlock::beginScopeEndInsert ( iterator  I,
size_t  Cnt,
BumpVectorContext C 
)
inline

Definition at line 1195 of file CFG.h.

References Elements.

◆ dump() [1/2]

LLVM_DUMP_METHOD void CFGBlock::dump ( ) const

Definition at line 5944 of file CFG.cpp.

References getParent().

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

References print().

◆ empty()

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

◆ end() [1/2]

iterator clang::CFGBlock::end ( )
inline

Definition at line 876 of file CFG.h.

References Elements.

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

◆ end() [2/2]

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

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

References pred_begin(), and pred_end().

◆ filtered_succ_start_end()

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

Definition at line 1033 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 872 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 5934 of file CFG.cpp.

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

◆ getLabel() [1/2]

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

Definition at line 1069 of file CFG.h.

References Label.

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

◆ getLabel() [2/2]

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

Definition at line 1070 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 6040 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 1067 of file CFG.h.

References LoopTarget.

◆ getParent()

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

Definition at line 1076 of file CFG.h.

References Parent.

Referenced by annotateStartParameter(), dump(), getIndexInCFG(), and isInevitablySinking().

◆ 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 1063 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 1051 of file CFG.h.

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

◆ hasNoReturnElement()

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

Definition at line 1072 of file CFG.h.

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

◆ insertAutomaticObjDtor()

iterator clang::CFGBlock::insertAutomaticObjDtor ( iterator  I,
VarDecl VD,
Stmt S 
)
inline

Definition at line 1174 of file CFG.h.

◆ insertLifetimeEnds()

iterator clang::CFGBlock::insertLifetimeEnds ( iterator  I,
VarDecl VD,
Stmt S 
)
inline

Definition at line 1187 of file CFG.h.

◆ insertScopeEnd()

iterator clang::CFGBlock::insertScopeEnd ( iterator  I,
VarDecl VD,
Stmt S 
)
inline

Definition at line 1199 of file CFG.h.

◆ isInevitablySinking()

bool CFGBlock::isInevitablySinking ( ) const

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

Definition at line 6002 of file CFG.cpp.

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

Referenced by isAssertlikeBlock().

◆ operator[]()

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

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

◆ pred_empty()

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

Definition at line 977 of file CFG.h.

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

◆ pred_rbegin() [1/2]

pred_reverse_iterator clang::CFGBlock::pred_rbegin ( )
inline

Definition at line 942 of file CFG.h.

◆ pred_rbegin() [2/2]

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

Definition at line 944 of file CFG.h.

◆ pred_rend() [1/2]

pred_reverse_iterator clang::CFGBlock::pred_rend ( )
inline

Definition at line 943 of file CFG.h.

◆ pred_rend() [2/2]

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

Definition at line 945 of file CFG.h.

◆ pred_size()

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

Definition at line 976 of file CFG.h.

Referenced by print_block().

◆ preds() [1/2]

pred_range clang::CFGBlock::preds ( )
inline

Definition at line 947 of file CFG.h.

References pred_begin(), and pred_end().

◆ preds() [2/2]

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

Definition at line 951 of file CFG.h.

References pred_begin(), and pred_end().

◆ prependScopeBegin()

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

Definition at line 1125 of file CFG.h.

◆ prependScopeEnd()

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

Definition at line 1134 of file CFG.h.

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

References print_block().

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

◆ printAsOperand()

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

Definition at line 1088 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 5958 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 5965 of file CFG.cpp.

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

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

References Elements.

◆ ref_begin() [1/2]

ref_iterator clang::CFGBlock::ref_begin ( )
inline

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

References begin().

◆ ref_end() [1/2]

ref_iterator clang::CFGBlock::ref_end ( )
inline

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

References end().

◆ refs() [1/2]

ref_iterator_range clang::CFGBlock::refs ( )
inline

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

References ref_begin(), and ref_end().

◆ rend() [1/2]

reverse_iterator clang::CFGBlock::rend ( )
inline

Definition at line 881 of file CFG.h.

References Elements.

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

◆ rend() [2/2]

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

Definition at line 883 of file CFG.h.

References Elements.

◆ rref_begin() [1/2]

reverse_ref_iterator clang::CFGBlock::rref_begin ( )
inline

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

References rbegin().

◆ rref_end() [1/2]

reverse_ref_iterator clang::CFGBlock::rref_end ( )
inline

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

References rend().

◆ rrefs() [1/2]

reverse_ref_iterator_range clang::CFGBlock::rrefs ( )
inline

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

References rref_begin(), and rref_end().

◆ setHasNoReturnElement()

void clang::CFGBlock::setHasNoReturnElement ( )
inline

Definition at line 1042 of file CFG.h.

◆ setLabel()

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

Definition at line 1040 of file CFG.h.

References Label.

◆ setLoopTarget()

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

Definition at line 1041 of file CFG.h.

References LoopTarget.

◆ setTerminator()

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

Definition at line 1039 of file CFG.h.

References Terminator.

◆ size()

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

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

◆ succ_empty()

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

Definition at line 974 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 958 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 962 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 963 of file CFG.h.

◆ succ_size()

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

◆ succs() [1/2]

succ_range clang::CFGBlock::succs ( )
inline

Definition at line 965 of file CFG.h.

References succ_begin(), and succ_end().

Referenced by isInevitablySinking(), and clang::CFG::isLinear().

◆ succs() [2/2]

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

Definition at line 969 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 783 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 771 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 780 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 775 of file CFG.h.

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


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