//===- CFGReachabilityAnalysis.cpp - Basic reachability analysis ----------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file defines a flow-sensitive, (mostly) path-insensitive reachability // analysis based on Clang's CFGs. Clients can query if a given basic block // is reachable within the CFG. // //===----------------------------------------------------------------------===// #include "clang/Analysis/Analyses/CFGReachabilityAnalysis.h" #include "clang/Analysis/CFG.h" #include "llvm/ADT/BitVector.h" #include "llvm/ADT/SmallVector.h" usingnamespaceclang; CFGReverseBlockReachabilityAnalysis::CFGReverseBlockReachabilityAnalysis( const CFG &cfg) : … { … } bool CFGReverseBlockReachabilityAnalysis::isReachable(const CFGBlock *Src, const CFGBlock *Dst) { … } // Maps reachability to a common node by walking the predecessors of the // destination node. void CFGReverseBlockReachabilityAnalysis::mapReachability(const CFGBlock *Dst) { … }