clang 18.0.0git
|
#include <algorithm>
#include <optional>
#include <system_error>
#include <utility>
#include <vector>
#include "clang/AST/ASTDumper.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/OperationKinds.h"
#include "clang/AST/StmtCXX.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/Analysis/Analyses/PostOrderCFGView.h"
#include "clang/Analysis/CFG.h"
#include "clang/Analysis/FlowSensitive/DataflowEnvironment.h"
#include "clang/Analysis/FlowSensitive/DataflowLattice.h"
#include "clang/Analysis/FlowSensitive/DataflowWorklist.h"
#include "clang/Analysis/FlowSensitive/RecordOps.h"
#include "clang/Analysis/FlowSensitive/Transfer.h"
#include "clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h"
#include "clang/Analysis/FlowSensitive/Value.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Error.h"
Go to the source code of this file.
Namespaces | |
namespace | clang |
namespace | clang::dataflow |
Dataflow Directional Tag Classes. | |
Macros | |
#define | DEBUG_TYPE "clang-dataflow" |
Functions | |
static int | clang::dataflow::blockIndexInPredecessor (const CFGBlock &Pred, const CFGBlock &Block) |
Returns the index of Block in the successors of Pred . | |
static bool | clang::dataflow::isBackedgeNode (const CFGBlock &B) |
static TypeErasedDataflowAnalysisState | clang::dataflow::computeBlockInputState (const CFGBlock &Block, AnalysisContext &AC) |
Computes the input state for a given basic block by joining the output states of its predecessors. | |
static void | clang::dataflow::builtinTransferStatement (const CFGStmt &Elt, TypeErasedDataflowAnalysisState &InputState, AnalysisContext &AC) |
Built-in transfer function for CFGStmt . | |
static void | clang::dataflow::builtinTransferInitializer (const CFGInitializer &Elt, TypeErasedDataflowAnalysisState &InputState) |
Built-in transfer function for CFGInitializer . | |
static void | clang::dataflow::builtinTransfer (const CFGElement &Elt, TypeErasedDataflowAnalysisState &State, AnalysisContext &AC) |
static TypeErasedDataflowAnalysisState | clang::dataflow::transferCFGBlock (const CFGBlock &Block, AnalysisContext &AC, std::function< void(const CFGElement &, const TypeErasedDataflowAnalysisState &)> PostVisitCFG=nullptr) |
Transfers State by evaluating each element in the Block based on the AC.Analysis specified. | |
llvm::Expected< std::vector< std::optional< TypeErasedDataflowAnalysisState > > > | clang::dataflow::runTypeErasedDataflowAnalysis (const ControlFlowContext &CFCtx, TypeErasedDataflowAnalysis &Analysis, const Environment &InitEnv, std::function< void(const CFGElement &, const TypeErasedDataflowAnalysisState &)> PostVisitCFG=nullptr) |
Performs dataflow analysis and returns a mapping from basic block IDs to dataflow analysis states that model the respective basic blocks. | |
#define DEBUG_TYPE "clang-dataflow" |
Definition at line 40 of file TypeErasedDataflowAnalysis.cpp.
TypeErasedDataflowAnalysis& Analysis |
The analysis to be run.
Definition at line 177 of file TypeErasedDataflowAnalysis.cpp.
Referenced by clang::dataflow::diagnoseFunction(), clang::dataflow::runDataflowAnalysis(), and clang::dataflow::runTypeErasedDataflowAnalysis().
llvm::ArrayRef<std::optional<TypeErasedDataflowAnalysisState> > BlockStates |
Stores the state of a CFG block if it has been evaluated by the analysis.
The indices correspond to the block IDs.
Definition at line 183 of file TypeErasedDataflowAnalysis.cpp.
Referenced by clang::dataflow::runDataflowAnalysis(), and clang::dataflow::runTypeErasedDataflowAnalysis().
const ControlFlowContext& CFCtx |
Contains the CFG being analyzed.
Definition at line 175 of file TypeErasedDataflowAnalysis.cpp.
Referenced by clang::dataflow::DataflowAnalysisContext::getControlFlowContext(), clang::dataflow::runDataflowAnalysis(), clang::dataflow::runTypeErasedDataflowAnalysis(), and clang::dataflow::StmtToEnvMap::StmtToEnvMap().
const Environment& InitEnv |
Initial state to start the analysis.
Definition at line 179 of file TypeErasedDataflowAnalysis.cpp.
Referenced by clang::dataflow::runDataflowAnalysis(), and clang::dataflow::runTypeErasedDataflowAnalysis().
Logger& Log |
Definition at line 180 of file TypeErasedDataflowAnalysis.cpp.
Referenced by clang::tooling::AllTUsToolExecutor::execute().