clang  10.0.0svn
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 570 of file CFG.h.

Member Typedef Documentation

◆ CFGElementRef

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

Definition at line 871 of file CFG.h.

◆ const_iterator

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

Definition at line 852 of file CFG.h.

◆ const_pred_iterator

Definition at line 910 of file CFG.h.

◆ const_pred_reverse_iterator

Definition at line 912 of file CFG.h.

◆ const_ref_iterator

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

Definition at line 876 of file CFG.h.

◆ const_ref_iterator_range

Definition at line 877 of file CFG.h.

◆ const_reverse_iterator

Definition at line 854 of file CFG.h.

◆ const_reverse_ref_iterator

Definition at line 882 of file CFG.h.

◆ const_reverse_ref_iterator_range

Definition at line 884 of file CFG.h.

◆ const_succ_iterator

Definition at line 917 of file CFG.h.

◆ const_succ_reverse_iterator

Definition at line 919 of file CFG.h.

◆ ConstCFGElementRef

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

Definition at line 872 of file CFG.h.

◆ filtered_pred_iterator

Definition at line 1010 of file CFG.h.

◆ filtered_succ_iterator

Definition at line 1013 of file CFG.h.

◆ iterator

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

Definition at line 851 of file CFG.h.

◆ pred_const_range

Definition at line 914 of file CFG.h.

◆ pred_iterator

Definition at line 909 of file CFG.h.

◆ pred_range

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

Definition at line 913 of file CFG.h.

◆ pred_reverse_iterator

Definition at line 911 of file CFG.h.

◆ ref_iterator

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

Definition at line 874 of file CFG.h.

◆ ref_iterator_range

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

Definition at line 875 of file CFG.h.

◆ reverse_iterator

Definition at line 853 of file CFG.h.

◆ reverse_ref_iterator

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

Definition at line 879 of file CFG.h.

◆ reverse_ref_iterator_range

Definition at line 880 of file CFG.h.

◆ succ_const_range

Definition at line 921 of file CFG.h.

◆ succ_iterator

Definition at line 916 of file CFG.h.

◆ succ_range

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

Definition at line 920 of file CFG.h.

◆ succ_reverse_iterator

Definition at line 918 of file CFG.h.

Constructor & Destructor Documentation

◆ CFGBlock()

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

Definition at line 846 of file CFG.h.

Member Function Documentation

◆ addSuccessor()

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

Adds a (potentially unreachable) successor block to the current block.

Definition at line 4917 of file CFG.cpp.

References clang::CFGBlock::AdjacentBlock::getPossiblyUnreachableBlock(), clang::CFGBlock::AdjacentBlock::getReachableBlock(), and clang::CFGBlock::AdjacentBlock::isReachable().

◆ appendAutomaticObjDtor()

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

Definition at line 1136 of file CFG.h.

◆ appendBaseDtor()

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

Definition at line 1124 of file CFG.h.

◆ appendConstructor()

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

Definition at line 1085 of file CFG.h.

◆ appendCXXRecordTypedCall()

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

Definition at line 1090 of file CFG.h.

◆ appendDeleteDtor()

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

Definition at line 1148 of file CFG.h.

◆ appendInitializer()

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

Definition at line 1096 of file CFG.h.

◆ appendLifetimeEnds()

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

Definition at line 1140 of file CFG.h.

◆ appendLoopExit()

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

Definition at line 1144 of file CFG.h.

◆ appendMemberDtor()

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

Definition at line 1128 of file CFG.h.

◆ appendNewAllocator()

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

Definition at line 1101 of file CFG.h.

◆ appendScopeBegin()

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

Definition at line 1106 of file CFG.h.

◆ appendScopeEnd()

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

Definition at line 1116 of file CFG.h.

◆ appendStmt()

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

Definition at line 1081 of file CFG.h.

◆ appendTemporaryDtor()

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

Definition at line 1132 of file CFG.h.

◆ back()

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

◆ begin() [1/2]

iterator clang::CFGBlock::begin ( )
inline

◆ begin() [2/2]

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

Definition at line 863 of file CFG.h.

◆ beginAutomaticObjDtorsInsert()

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

Definition at line 1155 of file CFG.h.

References clang::C.

◆ beginLifetimeEndsInsert()

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

Definition at line 1168 of file CFG.h.

References clang::C.

◆ beginScopeEndInsert()

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

Definition at line 1181 of file CFG.h.

References clang::C.

◆ dump() [1/2]

LLVM_DUMP_METHOD void CFGBlock::dump ( ) const

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

References print().

◆ empty()

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

◆ end() [1/2]

iterator clang::CFGBlock::end ( )
inline

◆ end() [2/2]

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

Definition at line 864 of file CFG.h.

◆ filtered_pred_start_end()

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

Definition at line 1015 of file CFG.h.

◆ filtered_succ_start_end()

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

Definition at line 1019 of file CFG.h.

◆ FilterEdge()

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

◆ front()

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

Definition at line 858 of file CFG.h.

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

◆ getBlockID()

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

◆ getIndexInCFG()

size_t CFGBlock::getIndexInCFG ( ) const

Definition at line 5618 of file CFG.cpp.

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

◆ getLabel() [1/2]

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

Definition at line 1055 of file CFG.h.

References Label.

Referenced by Accumulate(), FilterEdge(), isPointerToConst(), print_block(), and updateStackPiecesWithMessage().

◆ getLabel() [2/2]

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

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

References clang::CFGElement::getAs(), rbegin(), clang::CFGTerminator::StmtBranch, and succ_size().

◆ getLoopTarget()

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

Definition at line 1053 of file CFG.h.

◆ getParent()

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

Definition at line 1062 of file CFG.h.

References dump(), and Parent.

Referenced by clang::ento::PathDiagnosticLocation::create(), 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 1049 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 1037 of file CFG.h.

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

◆ hasNoReturnElement()

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

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

◆ insertLifetimeEnds()

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

Definition at line 1173 of file CFG.h.

◆ insertScopeEnd()

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

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

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

◆ operator[]()

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

Definition at line 906 of file CFG.h.

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

References clang::BumpVector< T >::begin().

◆ pred_empty()

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

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

References clang::BumpVector< T >::end().

◆ pred_rbegin() [1/2]

pred_reverse_iterator clang::CFGBlock::pred_rbegin ( )
inline

Definition at line 928 of file CFG.h.

References clang::BumpVector< T >::rbegin().

◆ pred_rbegin() [2/2]

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

Definition at line 930 of file CFG.h.

References clang::BumpVector< T >::rbegin().

◆ pred_rend() [1/2]

pred_reverse_iterator clang::CFGBlock::pred_rend ( )
inline

Definition at line 929 of file CFG.h.

References clang::BumpVector< T >::rend().

◆ pred_rend() [2/2]

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

Definition at line 931 of file CFG.h.

References clang::BumpVector< T >::rend().

◆ pred_size()

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

◆ preds() [1/2]

pred_range clang::CFGBlock::preds ( )
inline

Definition at line 933 of file CFG.h.

◆ preds() [2/2]

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

Definition at line 937 of file CFG.h.

◆ prependScopeBegin()

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

Definition at line 1111 of file CFG.h.

◆ prependScopeEnd()

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

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

References print_block().

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

◆ printAsOperand()

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

Definition at line 1074 of file CFG.h.

References clang::C.

◆ 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 5642 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 5649 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 868 of file CFG.h.

◆ ref_begin() [1/2]

ref_iterator clang::CFGBlock::ref_begin ( )
inline

Definition at line 886 of file CFG.h.

◆ ref_begin() [2/2]

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

Definition at line 888 of file CFG.h.

◆ ref_end() [1/2]

ref_iterator clang::CFGBlock::ref_end ( )
inline

Definition at line 887 of file CFG.h.

◆ ref_end() [2/2]

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

Definition at line 889 of file CFG.h.

◆ refs() [1/2]

ref_iterator_range clang::CFGBlock::refs ( )
inline

Definition at line 896 of file CFG.h.

◆ refs() [2/2]

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

Definition at line 897 of file CFG.h.

◆ rend() [1/2]

reverse_iterator clang::CFGBlock::rend ( )
inline

Definition at line 867 of file CFG.h.

Referenced by CheckFallThrough(), getLastStmtLoc(), ResolveCondition(), and writeShouldKill().

◆ rend() [2/2]

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

Definition at line 869 of file CFG.h.

◆ rref_begin() [1/2]

reverse_ref_iterator clang::CFGBlock::rref_begin ( )
inline

Definition at line 891 of file CFG.h.

◆ rref_begin() [2/2]

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

Definition at line 893 of file CFG.h.

◆ rref_end() [1/2]

reverse_ref_iterator clang::CFGBlock::rref_end ( )
inline

Definition at line 892 of file CFG.h.

◆ rref_end() [2/2]

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

Definition at line 894 of file CFG.h.

◆ rrefs() [1/2]

reverse_ref_iterator_range clang::CFGBlock::rrefs ( )
inline

Definition at line 898 of file CFG.h.

◆ rrefs() [2/2]

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

Definition at line 899 of file CFG.h.

◆ setHasNoReturnElement()

void clang::CFGBlock::setHasNoReturnElement ( )
inline

Definition at line 1028 of file CFG.h.

◆ setLabel()

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

Definition at line 1026 of file CFG.h.

References clang::CFGElement::Statement.

Referenced by shouldAddCase().

◆ setLoopTarget()

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

Definition at line 1027 of file CFG.h.

◆ setTerminator()

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

Definition at line 1025 of file CFG.h.

◆ size()

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

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

References clang::BumpVector< T >::begin().

◆ succ_empty()

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

Definition at line 960 of file CFG.h.

References clang::BumpVector< T >::empty().

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

References clang::BumpVector< T >::end().

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

References clang::BumpVector< T >::rbegin().

◆ succ_rend() [1/2]

succ_reverse_iterator clang::CFGBlock::succ_rend ( )
inline

Definition at line 947 of file CFG.h.

References clang::BumpVector< T >::rend().

Referenced by clang::ento::SwitchNodeBuilder::end().

◆ succ_rend() [2/2]

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

Definition at line 949 of file CFG.h.

References clang::BumpVector< T >::rend().

◆ succ_size()

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

◆ succs() [1/2]

succ_range clang::CFGBlock::succs ( )
inline

Definition at line 951 of file CFG.h.

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

◆ succs() [2/2]

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

Definition at line 955 of file CFG.h.

Member Data Documentation

◆ BlockID

unsigned clang::CFGBlock::BlockID

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

Definition at line 769 of file CFG.h.

◆ Elements

ElementList clang::CFGBlock::Elements

The set of statements in the basic block.

Definition at line 752 of file CFG.h.

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

Referenced by print_block().

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

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

Referenced by getTerminatorCondition().


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