clang: lib/Analysis/PostOrderCFGView.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
16
17using namespace clang;
18
19void PostOrderCFGView::anchor() {}
20
24
25 for (po_iterator I = po_iterator::begin(cfg, BSet),
26 E = po_iterator::end(cfg, BSet); I != E; ++I) {
27 BlockOrder[*I] = Blocks.size() + 1;
28 Blocks.push_back(*I);
29 }
30}
31
32std::unique_ptr
35 if (!cfg)
36 return nullptr;
37 return std::make_unique(cfg);
38}
39
41
44 PostOrderCFGView::BlockOrderTy::const_iterator b1It = POV.BlockOrder.find(b1);
45 PostOrderCFGView::BlockOrderTy::const_iterator b2It = POV.BlockOrder.find(b2);
46
47 unsigned b1V = (b1It == POV.BlockOrder.end()) ? 0 : b1It->second;
48 unsigned b2V = (b2It == POV.BlockOrder.end()) ? 0 : b2It->second;
49 return b1V > b2V;
50}
This file defines AnalysisDeclContext, a class that manages the analysis context data for context sen...
AnalysisDeclContext contains the context data for the function, method or block under analysis.
Represents a single basic block in a source-level CFG.
Represents a source-level, intra-procedural CFG that represents the control-flow of a Stmt.
unsigned getNumBlockIDs() const
Returns the total number of BlockIDs allocated (which start at 0).
Implements a set of CFGBlocks using a BitVector.
PostOrderCFGView(const CFG *cfg)
static std::unique_ptr< PostOrderCFGView > create(AnalysisDeclContext &analysisContext)
static const void * getTag()
The JSON file list parser is used to communicate input to InstallAPI.
bool operator()(const CFGBlock *b1, const CFGBlock *b2) const
const PostOrderCFGView & POV