17#include "llvm/ADT/BitVector.h"
18#include "llvm/ADT/SmallVector.h"
24 : analyzed(cfg.getNumBlockIDs(),
false) {}
31 if (!analyzed[DstBlockID]) {
33 analyzed[DstBlockID] =
true;
37 return reachable[DstBlockID][Src->
getBlockID()];
42void CFGReverseBlockReachabilityAnalysis::mapReachability(
const CFGBlock *Dst) {
44 llvm::BitVector visited(analyzed.size());
46 ReachableSet &DstReachability = reachable[Dst->
getBlockID()];
47 DstReachability.resize(analyzed.size(),
false);
51 worklist.push_back(Dst);
54 while (!worklist.empty()) {
55 const CFGBlock *block = worklist.pop_back_val();
71 e = block->
pred_end(); i != e; ++i) {
73 worklist.push_back(*i);
Represents a single basic block in a source-level CFG.
AdjacentBlocks::const_iterator const_pred_iterator
pred_iterator pred_begin()
unsigned getBlockID() const
CFGReverseBlockReachabilityAnalysis(const CFG &cfg)
bool isReachable(const CFGBlock *Src, const CFGBlock *Dst)
Returns true if the block 'Dst' can be reached from block 'Src'.
Represents a source-level, intra-procedural CFG that represents the control-flow of a Stmt.
The JSON file list parser is used to communicate input to InstallAPI.