#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/Support/Debug.h"
#include "llvm/Support/Error.h"
#define DEBUG_TYPE …
namespace clang {
namespace dataflow {
static int blockIndexInPredecessor(const CFGBlock &Pred,
const CFGBlock &Block) { … }
static bool isBackedgeNode(const CFGBlock &B) { … }
namespace {
class TerminatorVisitor
: public ConstStmtVisitor<TerminatorVisitor, const Expr *> { … };
struct AnalysisContext { … };
class PrettyStackTraceAnalysis : public llvm::PrettyStackTraceEntry { … };
class PrettyStackTraceCFGElement : public llvm::PrettyStackTraceEntry { … };
class JoinedStateBuilder { … };
}
static const Expr *getTerminatorCondition(const Stmt *TerminatorStmt) { … }
static TypeErasedDataflowAnalysisState
computeBlockInputState(const CFGBlock &Block, AnalysisContext &AC) { … }
static void
builtinTransferStatement(unsigned CurBlockID, const CFGStmt &Elt,
TypeErasedDataflowAnalysisState &InputState,
AnalysisContext &AC) { … }
static void
builtinTransferInitializer(const CFGInitializer &Elt,
TypeErasedDataflowAnalysisState &InputState) { … }
static void builtinTransfer(unsigned CurBlockID, const CFGElement &Elt,
TypeErasedDataflowAnalysisState &State,
AnalysisContext &AC) { … }
static TypeErasedDataflowAnalysisState
transferCFGBlock(const CFGBlock &Block, AnalysisContext &AC,
const CFGEltCallbacksTypeErased &PostAnalysisCallbacks = { … }
llvm::Expected<std::vector<std::optional<TypeErasedDataflowAnalysisState>>>
runTypeErasedDataflowAnalysis(
const AdornedCFG &ACFG, TypeErasedDataflowAnalysis &Analysis,
const Environment &InitEnv,
const CFGEltCallbacksTypeErased &PostAnalysisCallbacks,
std::int32_t MaxBlockVisits) { … }
}
}