Skip to content

Commit

Permalink
fixup! [clang][dataflow] Make cap on block visits configurable by cal…
Browse files Browse the repository at this point in the history
…ler.

address comments
  • Loading branch information
ymand committed Jan 22, 2024
1 parent 7c5edaf commit 83bc3d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
22 changes: 8 additions & 14 deletions clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,11 @@ template <typename LatticeT> struct DataflowAnalysisState {
/// `PostVisitCFG` on each CFG element with the final analysis results at that
/// program point.
///
/// `MaxBlockVisits` caps the number of block visits during analysis. It doesn't
/// distinguish between repeat visits to the same block and visits to distinct
/// blocks. This parameter is a backstop to prevent infintite loops, in the case
/// of bugs in the lattice and/or transfer functions that prevent the analysis
/// from converging. The default value is essentially arbitrary -- large enough
/// to accomodate what seems like any reasonable CFG, but still small enough to
/// limit the cost of hitting the limit.
/// `MaxBlockVisits` caps the number of block visits during analysis. See
/// `runTypeErasedDataflowAnalysis` for a full description. The default value is
/// essentially arbitrary -- large enough to accommodate what seems like any
/// reasonable CFG, but still small enough to limit the cost of hitting the
/// limit.
template <typename AnalysisT>
llvm::Expected<std::vector<
std::optional<DataflowAnalysisState<typename AnalysisT::Lattice>>>>
Expand Down Expand Up @@ -271,13 +269,9 @@ auto createAnalysis(ASTContext &ASTCtx, Environment &Env)
/// - This limit is still low enough to keep runtimes acceptable (on typical
/// machines) in cases where we hit the limit.
///
/// `MaxBlockVisits` caps the number of block visits during analysis. It doesn't
/// distinguish between repeat visits to the same block and visits to distinct
/// blocks. This parameter is a backstop to prevent infintite loops, in the case
/// of bugs in the lattice and/or transfer functions that prevent the analysis
/// from converging. The default value is essentially arbitrary -- large enough
/// to accomodate what seems like any reasonable CFG, but still small enough to
/// limit the cost of hitting the limit.
/// `MaxBlockVisits` caps the number of block visits during analysis. See
/// `runDataflowAnalysis` for a full description and explanation of the default
/// value.
template <typename AnalysisT, typename Diagnostic>
llvm::Expected<llvm::SmallVector<Diagnostic>> diagnoseFunction(
const FunctionDecl &FuncDecl, ASTContext &ASTCtx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ struct TypeErasedDataflowAnalysisState {
///
/// `MaxBlockVisits` caps the number of block visits during analysis. It doesn't
/// distinguish between repeat visits to the same block and visits to distinct
/// blocks. This parameter is a backstop to prevent infintite loops, in the case
/// blocks. This parameter is a backstop to prevent infinite loops, in the case
/// of bugs in the lattice and/or transfer functions that prevent the analysis
/// from converging.
llvm::Expected<std::vector<std::optional<TypeErasedDataflowAnalysisState>>>
Expand Down

0 comments on commit 83bc3d9

Please # to comment.