13#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_POSTORDERCFGVIEW_H
14#define LLVM_CLANG_ANALYSIS_ANALYSES_POSTORDERCFGVIEW_H
19#include "llvm/ADT/BitVector.h"
20#include "llvm/ADT/DenseMap.h"
21#include "llvm/ADT/PostOrderIterator.h"
28 virtual void anchor();
38 llvm::BitVector VisitedBlockIDs;
56 return std::make_pair(std::nullopt,
58 if (VisitedBlockIDs.test(
Block->getBlockID()))
59 return std::make_pair(std::nullopt,
false);
60 VisitedBlockIDs.set(
Block->getBlockID());
61 return std::make_pair(std::nullopt,
true);
68 return VisitedBlockIDs.test(
Block->getBlockID());
83 struct CFGLoopBodyFirstTraits {
84 using NodeRef = const ::clang::CFGBlock *;
87 static ChildIteratorType child_begin(NodeRef N) {
return N->succ_rbegin(); }
88 static ChildIteratorType child_end(NodeRef N) {
return N->succ_rend(); }
92 static NodeRef getEntryNode(const ::clang::CFG *F) {
93 return &F->getEntry();
96 static nodes_iterator nodes_begin(const ::clang::CFG *F) {
97 return F->nodes_begin();
100 static nodes_iterator nodes_end(const ::clang::CFG *F) {
101 return F->nodes_end();
104 static unsigned size(const ::clang::CFG *F) {
return F->
size(); }
107 llvm::po_iterator<const CFG *, CFGBlockSet, true, CFGLoopBodyFirstTraits>;
108 std::vector<const CFGBlock *> Blocks;
110 using BlockOrderTy = llvm::DenseMap<const CFGBlock *, unsigned>;
111 BlockOrderTy BlockOrder;
116 using iterator = std::vector<const CFGBlock *>::reverse_iterator;
143 static const void *
getTag();
145 static std::unique_ptr<PostOrderCFGView>
This file defines AnalysisDeclContext, a class that manages the analysis context data for context sen...
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
AnalysisDeclContext contains the context data for the function, method or block under analysis.
Represents a single basic block in a source-level CFG.
AdjacentBlocks::const_reverse_iterator const_succ_reverse_iterator
Represents a source-level, intra-procedural CFG that represents the control-flow of a Stmt.
CFGBlockListTy::const_iterator const_iterator
The base class of a hierarchy of objects representing analyses tied to AnalysisDeclContext.
Implements a set of CFGBlocks using a BitVector.
CFGBlockSet(const CFG *G)
std::pair< std::nullopt_t, bool > insert(const CFGBlock *Block)
Set the bit associated with a particular CFGBlock.
bool alreadySet(const CFGBlock *Block)
Check if the bit for a CFGBlock has been already set.
BlockOrderCompare getComparator() const
const_iterator begin() const
std::vector< const CFGBlock * >::reverse_iterator iterator
static std::unique_ptr< PostOrderCFGView > create(AnalysisDeclContext &analysisContext)
std::vector< const CFGBlock * >::const_reverse_iterator const_iterator
const_iterator end() const
static const void * getTag()
The JSON file list parser is used to communicate input to InstallAPI.
BlockOrderCompare(const PostOrderCFGView &pov)
bool operator()(const CFGBlock *b1, const CFGBlock *b2) const
const PostOrderCFGView & POV