Skip to content

Commit 83bc3d9

Browse files
committed
fixup! [clang][dataflow] Make cap on block visits configurable by caller.
address comments
1 parent 7c5edaf commit 83bc3d9

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,11 @@ template <typename LatticeT> struct DataflowAnalysisState {
187187
/// `PostVisitCFG` on each CFG element with the final analysis results at that
188188
/// program point.
189189
///
190-
/// `MaxBlockVisits` caps the number of block visits during analysis. It doesn't
191-
/// distinguish between repeat visits to the same block and visits to distinct
192-
/// blocks. This parameter is a backstop to prevent infintite loops, in the case
193-
/// of bugs in the lattice and/or transfer functions that prevent the analysis
194-
/// from converging. The default value is essentially arbitrary -- large enough
195-
/// to accomodate what seems like any reasonable CFG, but still small enough to
196-
/// limit the cost of hitting the limit.
190+
/// `MaxBlockVisits` caps the number of block visits during analysis. See
191+
/// `runTypeErasedDataflowAnalysis` for a full description. The default value is
192+
/// essentially arbitrary -- large enough to accommodate what seems like any
193+
/// reasonable CFG, but still small enough to limit the cost of hitting the
194+
/// limit.
197195
template <typename AnalysisT>
198196
llvm::Expected<std::vector<
199197
std::optional<DataflowAnalysisState<typename AnalysisT::Lattice>>>>
@@ -271,13 +269,9 @@ auto createAnalysis(ASTContext &ASTCtx, Environment &Env)
271269
/// - This limit is still low enough to keep runtimes acceptable (on typical
272270
/// machines) in cases where we hit the limit.
273271
///
274-
/// `MaxBlockVisits` caps the number of block visits during analysis. It doesn't
275-
/// distinguish between repeat visits to the same block and visits to distinct
276-
/// blocks. This parameter is a backstop to prevent infintite loops, in the case
277-
/// of bugs in the lattice and/or transfer functions that prevent the analysis
278-
/// from converging. The default value is essentially arbitrary -- large enough
279-
/// to accomodate what seems like any reasonable CFG, but still small enough to
280-
/// limit the cost of hitting the limit.
272+
/// `MaxBlockVisits` caps the number of block visits during analysis. See
273+
/// `runDataflowAnalysis` for a full description and explanation of the default
274+
/// value.
281275
template <typename AnalysisT, typename Diagnostic>
282276
llvm::Expected<llvm::SmallVector<Diagnostic>> diagnoseFunction(
283277
const FunctionDecl &FuncDecl, ASTContext &ASTCtx,

clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ struct TypeErasedDataflowAnalysisState {
141141
///
142142
/// `MaxBlockVisits` caps the number of block visits during analysis. It doesn't
143143
/// distinguish between repeat visits to the same block and visits to distinct
144-
/// blocks. This parameter is a backstop to prevent infintite loops, in the case
144+
/// blocks. This parameter is a backstop to prevent infinite loops, in the case
145145
/// of bugs in the lattice and/or transfer functions that prevent the analysis
146146
/// from converging.
147147
llvm::Expected<std::vector<std::optional<TypeErasedDataflowAnalysisState>>>

0 commit comments

Comments
 (0)