14#ifndef LLVM_CLANG_ANALYSIS_CFG_H
15#define LLVM_CLANG_ANALYSIS_CFG_H
23#include "llvm/ADT/DenseMap.h"
24#include "llvm/ADT/GraphTraits.h"
25#include "llvm/ADT/PointerIntPair.h"
26#include "llvm/ADT/iterator_range.h"
27#include "llvm/Support/Allocator.h"
28#include "llvm/Support/raw_ostream.h"
42class CXXBaseSpecifier;
43class CXXBindTemporaryExpr;
44class CXXCtorInitializer;
46class CXXDestructorDecl;
84 llvm::PointerIntPair<void *, 2>
Data1;
85 llvm::PointerIntPair<void *, 2>
Data2;
89 Data2(const_cast<void*>(Ptr2), (((
unsigned) kind) >> 2) & 0x3) {
100 assert(T::isKind(*
this));
109 template <
typename T> std::optional<T>
getAs()
const {
110 if (!T::isKind(*
this))
119 unsigned x =
Data2.getInt();
135 assert(isKind(*
this));
139 return static_cast<const Stmt *
>(
Data1.getPointer());
190 assert(isa<CallExpr>(
E) || isa<ObjCMessageExpr>(
E));
194 return !
E->isGLValue() &&
195 E->getType().getCanonicalType()->getAsCXXRecordDecl();
201 assert(
C && (isa<TemporaryObjectConstructionContext>(
C) ||
203 isa<ReturnedValueConstructionContext>(
C) ||
204 isa<VariableConstructionContext>(
C) ||
205 isa<ConstructorInitializerConstructionContext>(
C) ||
206 isa<ArgumentConstructionContext>(
C) ||
207 isa<LambdaCaptureConstructionContext>(
C)));
278 return static_cast<Stmt *
>(
Data1.getPointer());
302 return static_cast<Stmt *
>(
Data2.getPointer());
325 return static_cast<Stmt*
>(
Data2.getPointer());
336 Kind kind =
E.getKind();
353 return static_cast<Stmt *
>(
Data2.getPointer());
359 Kind kind =
E.getKind();
383 Kind kind =
E.getKind();
393 assert(VD->
hasAttr<CleanupAttr>());
403 return A->getFunctionDecl();
428 return static_cast<Stmt*
>(
Data2.getPointer());
553 static constexpr int KindBits = 2;
555 "Not enough room for kind!");
556 llvm::PointerIntPair<Stmt *, KindBits> Data;
613 using iterator = std::reverse_iterator<ImplTy::iterator>;
614 using const_iterator = std::reverse_iterator<ImplTy::const_iterator>;
623 return Impl.insert(I, Cnt,
E,
C);
626 const_reference front()
const {
return Impl.back(); }
627 const_reference back()
const {
return Impl.front(); }
629 iterator begin() {
return Impl.rbegin(); }
630 iterator end() {
return Impl.rend(); }
639 assert(i < Impl.size());
640 return Impl[Impl.size() - 1 - i];
643 size_t size()
const {
return Impl.size(); }
644 bool empty()
const {
return Impl.empty(); }
650 template <
bool IsConst>
class ElementRefImpl {
652 template <
bool IsOtherConst>
friend class ElementRefImpl;
655 std::conditional_t<IsConst, const CFGBlock *, CFGBlock *>;
657 using CFGElementPtr =
658 std::conditional_t<IsConst, const CFGElement *, CFGElement *>;
665 ElementRefImpl(CFGBlockPtr
Parent,
size_t Index)
668 template <
bool IsOtherConst>
669 ElementRefImpl(ElementRefImpl<IsOtherConst>
Other)
670 : ElementRefImpl(
Other.Parent,
Other.Index) {}
672 size_t getIndexInBlock()
const {
return Index; }
674 CFGBlockPtr getParent() {
return Parent; }
675 CFGBlockPtr getParent()
const {
return Parent; }
678 return std::make_pair(
Parent, Index) <
686 bool operator!=(ElementRefImpl
Other)
const {
return !(*
this ==
Other); }
688 CFGElementPtr operator->()
const {
return &*(
Parent->begin() + Index); }
690 void dumpToStream(llvm::raw_ostream &OS)
const {
691 OS << getIndexInBlock() + 1 <<
": ";
692 (*this)->dumpToStream(OS);
696 dumpToStream(llvm::errs());
700 template <
bool IsReverse,
bool IsConst>
class ElementRefIterator {
702 template <
bool IsOtherReverse,
bool IsOtherConst>
703 friend class ElementRefIterator;
706 std::conditional_t<IsConst, const CFGBlock *, CFGBlock *>;
708 using UnderlayingIteratorTy = std::conditional_t<
711 ElementList::const_iterator>,
713 ElementList::iterator>>;
715 using IteratorTraits =
typename std::iterator_traits<UnderlayingIteratorTy>;
716 using ElementRef =
typename CFGBlock::ElementRefImpl<IsConst>;
719 using difference_type =
typename IteratorTraits::difference_type;
720 using value_type = ElementRef;
721 using pointer = ElementRef *;
722 using iterator_category =
typename IteratorTraits::iterator_category;
726 UnderlayingIteratorTy Pos;
729 ElementRefIterator(CFGBlockRef
Parent, UnderlayingIteratorTy Pos)
732 template <
bool IsOtherConst>
733 ElementRefIterator(ElementRefIterator<false, IsOtherConst>
E)
734 : ElementRefIterator(
E.Parent,
E.Pos.base()) {}
736 template <
bool IsOtherConst>
737 ElementRefIterator(ElementRefIterator<true, IsOtherConst>
E)
738 : ElementRefIterator(
E.Parent, std::make_reverse_iterator(
E.Pos)) {}
742 return Pos <
Other.Pos;
749 bool operator!=(ElementRefIterator
Other)
const {
750 return !(*
this ==
Other);
754 template <
bool IsOtherConst>
756 getIndexInBlock(CFGBlock::ElementRefIterator<true, IsOtherConst>
E) {
757 return E.Parent->size() - (
E.Pos -
E.Parent->rbegin()) - 1;
760 template <
bool IsOtherConst>
762 getIndexInBlock(CFGBlock::ElementRefIterator<false, IsOtherConst>
E) {
763 return E.Pos -
E.Parent->begin();
769 difference_type operator-(ElementRefIterator
Other)
const {
770 return Pos -
Other.Pos;
773 ElementRefIterator operator++() {
777 ElementRefIterator operator++(
int) {
778 ElementRefIterator Ret = *
this;
782 ElementRefIterator operator+(
size_t count) {
786 ElementRefIterator operator-(
size_t count) {
827 llvm::PointerIntPair<CFGBlock *, 2> UnreachableBlock;
839 return ReachableBlock;
844 return UnreachableBlock.getPointer();
862 Kind K = (Kind) UnreachableBlock.getInt();
863 return K == AB_Normal || K == AB_Alternate;
870 AdjacentBlocks Preds;
871 AdjacentBlocks Succs;
882 LLVM_PREFERRED_TYPE(
bool)
883 unsigned HasNoReturnElement : 1;
891 Succs(
C, 1), HasNoReturnElement(
false),
Parent(parent) {}
927 llvm::iterator_range<const_reverse_ref_iterator>;
1011 LLVM_PREFERRED_TYPE(
bool)
1013 LLVM_PREFERRED_TYPE(
bool)
1023 template <
typename IMPL,
bool IsPred>
1034 : I(i),
E(e), F(f), From(from) {
1035 while (
hasMore() && Filter(*I))
1042 do { ++I; }
while (
hasMore() && Filter(*I));
1117 bool AddQuotes)
const;
1203 bool isAlwaysTrue) {}
1223 std::bitset<Stmt::lastStmtConstant + 1> alwaysAddMask;
1250 return alwaysAddMask[
stmt->getStmtClass()];
1254 alwaysAddMask[stmtClass] = val;
1259 alwaysAddMask.set();
1266 const BuildOptions &BO);
1334 return TryDispatchBlocks.begin();
1338 return TryDispatchBlocks.end();
1346 TryDispatchBlocks.push_back(block);
1355 assert(Synthetic->
isSingleDecl() &&
"Can handle single declarations only");
1356 assert(Synthetic != Source &&
"Don't include original DeclStmts in map");
1357 assert(!SyntheticDeclStmts.count(Synthetic) &&
"Already in map");
1358 SyntheticDeclStmts[Synthetic] = Source;
1362 llvm::DenseMap<const DeclStmt *, const DeclStmt *>::const_iterator;
1371 return SyntheticDeclStmts.begin();
1376 return SyntheticDeclStmts.end();
1392 if (std::optional<CFGStmt>
stmt = BI->getAs<
CFGStmt>())
1393 O(
const_cast<Stmt *
>(
stmt->getStmt()));
1407 unsigned size()
const {
return NumBlockIDs; }
1442 CFGBlock* IndirectGotoBlock =
nullptr;
1444 unsigned NumBlockIDs = 0;
1452 std::vector<const CFGBlock *> TryDispatchBlocks;
1456 llvm::DenseMap<const DeclStmt *, const DeclStmt *> SyntheticDeclStmts;
1526 :
public GraphTraits< ::clang::CFGBlock *> {
1536 :
public GraphTraits<const ::clang::CFGBlock *> {
1542 return F->nodes_begin();
1546 return F->nodes_end();
1549 static unsigned size(const ::clang::CFG* F) {
1555 :
public GraphTraits<Inverse< ::clang::CFGBlock *>> {
1564 :
public GraphTraits<Inverse<const ::clang::CFGBlock *>> {
1570 return F->nodes_begin();
1574 return F->nodes_end();
clang::CharUnits operator*(clang::CharUnits::QuantityType Scale, const clang::CharUnits &CU)
static void dump(llvm::raw_ostream &OS, StringRef FunctionName, ArrayRef< CounterExpression > Expressions, ArrayRef< CounterMappingRegion > Regions)
Defines the clang::Expr interface and subclasses for C++ expressions.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A builtin binary operation expression such as "x + y" or "x <= y".
llvm::BumpPtrAllocator & getAllocator()
std::reverse_iterator< const_iterator > const_reverse_iterator
const CFGElement & const_reference
reverse_iterator rbegin()
std::reverse_iterator< iterator > reverse_iterator
const CFGElement * const_iterator
Represents C++ object destructor implicitly generated for automatic object or temporary bound to cons...
const VarDecl * getVarDecl() const
const Stmt * getTriggerStmt() const
CFGAutomaticObjDtor(const VarDecl *var, const Stmt *stmt)
Represents C++ object destructor implicitly generated for base object in destructor.
CFGBaseDtor(const CXXBaseSpecifier *base)
const CXXBaseSpecifier * getBaseSpecifier() const
This class represents a potential adjacent block in the CFG.
CFGBlock & operator*() const
CFGBlock * operator->() const
CFGBlock * getReachableBlock() const
Get the reachable block, if one exists.
CFGBlock * getPossiblyUnreachableBlock() const
Get the potentially unreachable block.
unsigned IgnoreNullPredecessors
unsigned IgnoreDefaultsWithCoveredEnums
FilteredCFGBlockIterator & operator++()
const CFGBlock * operator*() const
FilteredCFGBlockIterator(const IMPL &i, const IMPL &e, const CFGBlock *from, const FilterOptions &f)
Represents a single basic block in a source-level CFG.
void appendAutomaticObjDtor(VarDecl *VD, Stmt *S, BumpVectorContext &C)
FilteredCFGBlockIterator< const_succ_iterator, false > filtered_succ_iterator
void printTerminator(raw_ostream &OS, const LangOptions &LO) const
printTerminator - A simple pretty printer of the terminator of a CFGBlock.
ElementList::iterator iterator
void setLoopTarget(const Stmt *loopTarget)
bool isInevitablySinking() const
Returns true if the block would eventually end with a sink (a noreturn node).
filtered_pred_iterator filtered_pred_start_end(const FilterOptions &f) const
size_t getIndexInCFG() const
void appendScopeBegin(const VarDecl *VD, const Stmt *S, BumpVectorContext &C)
AdjacentBlocks::reverse_iterator pred_reverse_iterator
const_reverse_iterator rend() const
CFGElement operator[](size_t i) const
llvm::iterator_range< pred_iterator > pred_range
FilteredCFGBlockIterator< const_pred_iterator, true > filtered_pred_iterator
const_reverse_ref_iterator_range rrefs() const
llvm::iterator_range< const_succ_iterator > succ_const_range
static bool FilterEdge(const FilterOptions &F, const CFGBlock *Src, const CFGBlock *Dst)
ElementRefIterator< false, false > ref_iterator
reverse_iterator rbegin()
void setTerminator(CFGTerminator Term)
void printAsOperand(raw_ostream &OS, bool)
void appendMemberDtor(FieldDecl *FD, BumpVectorContext &C)
llvm::iterator_range< const_reverse_ref_iterator > const_reverse_ref_iterator_range
filtered_succ_iterator filtered_succ_start_end(const FilterOptions &f) const
llvm::iterator_range< reverse_ref_iterator > reverse_ref_iterator_range
void appendLifetimeEnds(VarDecl *VD, Stmt *S, BumpVectorContext &C)
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.
ElementList::const_iterator const_iterator
const Stmt * getLabel() const
AdjacentBlocks::iterator pred_iterator
pred_reverse_iterator pred_rend()
bool hasNoReturnElement() const
succ_reverse_iterator succ_rend()
ElementRefIterator< true, false > reverse_ref_iterator
const_reverse_ref_iterator rref_end() const
const_succ_iterator succ_begin() const
void appendDeleteDtor(CXXRecordDecl *RD, CXXDeleteExpr *DE, BumpVectorContext &C)
void appendScopeEnd(const VarDecl *VD, const Stmt *S, BumpVectorContext &C)
const_pred_iterator pred_end() const
const_iterator begin() const
void appendInitializer(CXXCtorInitializer *initializer, BumpVectorContext &C)
unsigned BlockID
A numerical ID assigned to a CFGBlock during construction of the CFG.
const_pred_reverse_iterator pred_rbegin() const
succ_reverse_iterator succ_rbegin()
void printTerminatorJson(raw_ostream &Out, const LangOptions &LO, bool AddQuotes) const
printTerminatorJson - Pretty-prints the terminator in JSON format.
llvm::iterator_range< ref_iterator > ref_iterator_range
AdjacentBlocks::const_reverse_iterator const_succ_reverse_iterator
ref_iterator_range refs()
ElementRefIterator< false, true > const_ref_iterator
ElementRefImpl< true > ConstCFGElementRef
void appendNewAllocator(CXXNewExpr *NE, BumpVectorContext &C)
CFGBlock(unsigned blockid, BumpVectorContext &C, CFG *parent)
Stmt * Label
An (optional) label that prefixes the executable statements in the block.
const_ref_iterator ref_begin() const
CFGTerminator getTerminator() const
succ_iterator succ_begin()
Stmt * getTerminatorStmt()
const_succ_reverse_iterator succ_rend() const
void appendTemporaryDtor(CXXBindTemporaryExpr *E, BumpVectorContext &C)
const Stmt * getLoopTarget() const
AdjacentBlocks::const_iterator const_pred_iterator
succ_const_range succs() const
unsigned pred_size() const
void appendBaseDtor(const CXXBaseSpecifier *BS, BumpVectorContext &C)
AdjacentBlocks::iterator succ_iterator
void appendCXXRecordTypedCall(Expr *E, const ConstructionContext *CC, BumpVectorContext &C)
pred_const_range preds() const
ElementList Elements
The set of statements in the basic block.
const_reverse_iterator rbegin() const
ElementRefImpl< false > CFGElementRef
pred_reverse_iterator pred_rbegin()
ElementRefIterator< true, true > const_reverse_ref_iterator
pred_iterator pred_begin()
const Stmt * LoopTarget
Some blocks are used to represent the "loop edge" to the start of a loop from within the loop body.
reverse_ref_iterator rref_begin()
void appendCleanupFunction(const VarDecl *VD, BumpVectorContext &C)
reverse_ref_iterator rref_end()
const Stmt * getTerminatorStmt() const
const_ref_iterator_range refs() const
const_iterator end() const
const_ref_iterator ref_end() const
void setLabel(Stmt *Statement)
unsigned getBlockID() const
const_succ_reverse_iterator succ_rbegin() const
void appendStmt(Stmt *statement, BumpVectorContext &C)
llvm::iterator_range< const_ref_iterator > const_ref_iterator_range
void setHasNoReturnElement()
const_pred_iterator pred_begin() const
const Stmt * getTerminatorCondition(bool StripParens=true) const
const_succ_iterator succ_end() const
const Expr * getLastCondition() const
const_pred_reverse_iterator pred_rend() const
void appendConstructor(CXXConstructExpr *CE, const ConstructionContext *CC, BumpVectorContext &C)
AdjacentBlocks::reverse_iterator succ_reverse_iterator
Stmt * getTerminatorCondition(bool StripParens=true)
AdjacentBlocks::const_reverse_iterator const_pred_reverse_iterator
void addSuccessor(AdjacentBlock Succ, BumpVectorContext &C)
Adds a (potentially unreachable) successor block to the current block.
void appendLoopExit(const Stmt *LoopStmt, BumpVectorContext &C)
AdjacentBlocks::const_iterator const_succ_iterator
reverse_ref_iterator_range rrefs()
CFGTerminator Terminator
The terminator for a basic block that indicates the type of control-flow that occurs between a block ...
llvm::iterator_range< succ_iterator > succ_range
unsigned succ_size() const
const_reverse_ref_iterator rref_begin() const
llvm::iterator_range< const_pred_iterator > pred_const_range
Represents a function call that returns a C++ object by value.
const ConstructionContext * getConstructionContext() const
CFGCXXRecordTypedCall(const Expr *E, const ConstructionContext *C)
static bool isCXXRecordTypedCall(const Expr *E)
Returns true when call expression CE needs to be represented by CFGCXXRecordTypedCall,...
CFGCallback defines methods that should be called when a logical operator error is found when buildin...
virtual void compareBitwiseEquality(const BinaryOperator *B, bool isAlwaysTrue)
virtual void logicAlwaysTrue(const BinaryOperator *B, bool isAlwaysTrue)
virtual void compareAlwaysTrue(const BinaryOperator *B, bool isAlwaysTrue)
virtual void compareBitwiseOr(const BinaryOperator *B)
virtual ~CFGCallback()=default
CFGCleanupFunction(const VarDecl *VD)
const VarDecl * getVarDecl() const
const FunctionDecl * getFunctionDecl() const
Returns the function to be called when cleaning up the var decl.
CFGCleanupFunction()=default
Represents C++ constructor call.
const ConstructionContext * getConstructionContext() const
CFGConstructor(const CXXConstructExpr *CE, const ConstructionContext *C)
Represents C++ object destructor generated from a call to delete.
CFGDeleteDtor(const CXXRecordDecl *RD, const CXXDeleteExpr *DE)
const CXXDeleteExpr * getDeleteExpr() const
const CXXRecordDecl * getCXXRecordDecl() const
Represents a top-level expression in a basic block.
void dumpToStream(llvm::raw_ostream &OS) const
T castAs() const
Convert to the specified CFGElement type, asserting that this CFGElement is of the desired type.
llvm::PointerIntPair< void *, 2 > Data1
llvm::PointerIntPair< void *, 2 > Data2
std::optional< T > getAs() const
Convert to the specified CFGElement type, returning std::nullopt if this CFGElement is not of the des...
CFGElement(Kind kind, const void *Ptr1, const void *Ptr2=nullptr)
Represents C++ object destructor implicitly generated by compiler on various occasions.
const CXXDestructorDecl * getDestructorDecl(ASTContext &astContext) const
CFGImplicitDtor(Kind kind, const void *data1, const void *data2=nullptr)
CFGImplicitDtor()=default
bool isNoReturn(ASTContext &astContext) const
Represents C++ base or member initializer from constructor's initialization list.
CXXCtorInitializer * getInitializer() const
CFGInitializer(const CXXCtorInitializer *initializer)
Represents the point where the lifetime of an automatic object ends.
CFGLifetimeEnds(const VarDecl *var, const Stmt *stmt)
const Stmt * getTriggerStmt() const
const VarDecl * getVarDecl() const
Represents the point where a loop ends.
const Stmt * getLoopStmt() const
CFGLoopExit(const Stmt *stmt)
Represents C++ object destructor implicitly generated for member object in destructor.
const FieldDecl * getFieldDecl() const
CFGMemberDtor(const FieldDecl *field)
Represents C++ allocator call.
const CXXNewExpr * getAllocatorExpr() const
CFGNewAllocator(const CXXNewExpr *S)
Represents beginning of a scope implicitly generated by the compiler on encountering a CompoundStmt.
const VarDecl * getVarDecl() const
const Stmt * getTriggerStmt() const
CFGScopeBegin(const VarDecl *VD, const Stmt *S)
Represents end of a scope implicitly generated by the compiler after the last Stmt in a CompoundStmt'...
CFGScopeEnd(const VarDecl *VD, const Stmt *S)
const Stmt * getTriggerStmt() const
const VarDecl * getVarDecl() const
CFGStmt(const Stmt *S, Kind K=Statement)
const Stmt * getStmt() const
Represents C++ object destructor implicitly generated at the end of full expression for temporary obj...
const CXXBindTemporaryExpr * getBindTemporaryExpr() const
CFGTemporaryDtor(const CXXBindTemporaryExpr *expr)
Represents CFGBlock terminator statement.
bool isVirtualBaseBranch() const
bool isTemporaryDtorsBranch() const
bool isStmtBranch() const
CFGTerminator(Stmt *S, Kind K=StmtBranch)
const Stmt * getStmt() const
@ TemporaryDtorsBranch
A branch in control flow of destructors of temporaries.
@ VirtualBaseBranch
A shortcut around virtual base initializers.
@ StmtBranch
A branch that corresponds to a statement in the code, such as an if-statement.
@ NumKindsMinusOne
Number of different kinds, for assertions.
bool PruneTriviallyFalseEdges
bool AddStaticInitBranches
bool OmitImplicitValueInitializers
ForcedBlkExprs ** forcedBlkExprs
bool AddCXXDefaultInitExprInAggregates
bool AddCXXDefaultInitExprInCtors
BuildOptions & setAllAlwaysAdd()
BuildOptions & setAlwaysAdd(Stmt::StmtClass stmtClass, bool val=true)
bool alwaysAdd(const Stmt *stmt) const
bool AddRichCXXConstructors
bool AddVirtualBaseBranches
llvm::DenseMap< const Stmt *, const CFGBlock * > ForcedBlkExprs
bool MarkElidedCXXConstructors
Represents a source-level, intra-procedural CFG that represents the control-flow of a Stmt.
unsigned size() const
Return the total number of CFGBlocks within the CFG This is simply a renaming of the getNumBlockIDs()...
llvm::iterator_range< synthetic_stmt_iterator > synthetic_stmt_range
CFGBlockListTy::const_iterator const_iterator
const_iterator nodes_end() const
void print(raw_ostream &OS, const LangOptions &LO, bool ShowColors) const
print - A simple pretty printer of a CFG that outputs to an ostream.
llvm::DenseMap< const DeclStmt *, const DeclStmt * >::const_iterator synthetic_stmt_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
try_block_range try_blocks() const
bool isLinear() const
Returns true if the CFG has no branches.
synthetic_stmt_range synthetic_stmts() const
void VisitBlockStmts(Callback &O) const
static std::unique_ptr< CFG > buildCFG(const Decl *D, Stmt *AST, ASTContext *C, const BuildOptions &BO)
Builds a CFG from an AST.
llvm::BumpPtrAllocator & getAllocator()
std::reverse_iterator< iterator > reverse_iterator
CFGBlockListTy::iterator iterator
const_reverse_iterator rbegin() const
const_iterator end() const
CFGBlock * createBlock()
Create a new block in the CFG.
void addSyntheticDeclStmt(const DeclStmt *Synthetic, const DeclStmt *Source)
Records a synthetic DeclStmt and the DeclStmt it was constructed from.
const CFGBlock * getIndirectGotoBlock() const
llvm::iterator_range< try_block_iterator > try_block_range
const_iterator begin() const
void setIndirectGotoBlock(CFGBlock *B)
Set the block used for indirect goto jumps.
void addTryDispatchBlock(const CFGBlock *block)
try_block_iterator try_blocks_end() const
synthetic_stmt_iterator synthetic_stmt_end() const
void setEntry(CFGBlock *B)
Set the entry block of the CFG.
llvm::iterator_range< const_iterator > const_nodes() const
const CFGBlock & getEntry() const
CFGBlock * getIndirectGotoBlock()
llvm::iterator_range< reverse_iterator > reverse_nodes()
std::vector< const CFGBlock * >::const_iterator try_block_iterator
const CFGBlock & getExit() const
llvm::iterator_range< const_reverse_iterator > const_reverse_nodes() const
const_reverse_iterator rend() const
void dump(const LangOptions &LO, bool ShowColors) const
dump - A simple pretty printer of a CFG that outputs to stderr.
unsigned getNumBlockIDs() const
Returns the total number of BlockIDs allocated (which start at 0).
const_iterator nodes_begin() const
void viewCFG(const LangOptions &LO) const
try_block_iterator try_blocks_begin() const
BumpVector< CFGBlock * > CFGBlockListTy
synthetic_stmt_iterator synthetic_stmt_begin() const
Iterates over synthetic DeclStmts in the CFG.
reverse_iterator rbegin()
llvm::iterator_range< iterator > nodes()
BumpVectorContext & getBumpVectorContext()
Represents a base class of a C++ class.
Represents binding an expression to a temporary.
Represents a call to a C++ constructor.
Represents a C++ base or member initializer.
Represents a delete expression for memory deallocation and destructor calls, e.g.
Represents a C++ destructor within a class.
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Represents a C++ struct/union/class.
ConstructionContext's subclasses describe different ways of constructing an object in C++.
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
bool isSingleDecl() const
isSingleDecl - This method returns true if this DeclStmt refers to a single Decl.
Decl - This represents one declaration (or definition), e.g.
This represents one expression.
Represents a member of a struct/union/class.
Represents a function declaration or definition.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Represents a point when we exit a loop.
Stmt - This represents one statement.
Represents a variable declaration or definition.
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
const internal::VariadicAllOfMatcher< Stmt > stmt
Matches statements.
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
The JSON file list parser is used to communicate input to InstallAPI.
bool operator==(const CallGraphNode::CallRecord &LHS, const CallGraphNode::CallRecord &RHS)
bool operator<(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
const FunctionProtoType * T
Expr * extractElementInitializerFromNestedAILE(const ArrayInitLoopExpr *AILE)
@ Other
Other implicit parameter.
Diagnostic wrappers for TextAPI types for error reporting.
static ChildIteratorType child_end(NodeRef N)
static NodeRef getEntryNode(Inverse<::clang::CFGBlock * > G)
::clang::CFGBlock::const_pred_iterator ChildIteratorType
static ChildIteratorType child_begin(NodeRef N)
static nodes_iterator nodes_end(::clang::CFG *F)
static NodeRef getEntryNode(::clang::CFG *F)
static nodes_iterator nodes_begin(::clang::CFG *F)
static NodeRef getEntryNode(Inverse< const ::clang::CFGBlock * > G)
static ChildIteratorType child_begin(NodeRef N)
::clang::CFGBlock::const_pred_iterator ChildIteratorType
static ChildIteratorType child_end(NodeRef N)
static NodeRef getEntryNode(const ::clang::CFG *F)
static nodes_iterator nodes_begin(const ::clang::CFG *F)
static nodes_iterator nodes_end(const ::clang::CFG *F)
static ChildIteratorType child_begin(NodeRef N)
static ChildIteratorType child_end(NodeRef N)
static NodeRef getEntryNode(::clang::CFGBlock *BB)
::clang::CFGBlock::succ_iterator ChildIteratorType
static nodes_iterator nodes_end(::clang::CFG *F)
static NodeRef getEntryNode(::clang::CFG *F)
static unsigned size(::clang::CFG *F)
static nodes_iterator nodes_begin(::clang::CFG *F)
::clang::CFGBlock::const_succ_iterator ChildIteratorType
static NodeRef getEntryNode(const clang::CFGBlock *BB)
static ChildIteratorType child_begin(NodeRef N)
static ChildIteratorType child_end(NodeRef N)
static nodes_iterator nodes_begin(const ::clang::CFG *F)
static unsigned size(const ::clang::CFG *F)
static nodes_iterator nodes_end(const ::clang::CFG *F)
static NodeRef getEntryNode(const ::clang::CFG *F)
static SimpleType getSimplifiedValue(::clang::CFGTerminator Val)