================
@@ -1100,6 +1100,444 @@ const ProgramPointTag *ExprEngine::cleanupNodeTag() {
   return &cleanupTag;
 }
 
+enum VisitKind {
+  PreVisitKind,
+  PostVisitKind,
+};
+
+static bool shouldJustCallCheckers(const Stmt *S, VisitKind K) {
+
+  switch (S->getStmtClass()) {
----------------
tigbr wrote:

I agree, this is a valid concern. The plan I have come up with @NagyDonat is to 
return true by default in the switch and have only the exceptional cases listed 
explicitly.

Using this convention, we would avoid duplicating the following statement kind 
groups:

1. `llvm_unreachable` statement kinds
2. statement kinds that do not need explicit evaluation
3. statement kinds that need evaluation, but which are currently not 
implemented by the analyzer
4. statement kinds that need evaluation and which are implemented by the 
analyzer engine and which also use the regular PreVisit, Visit, PostVisit 
pattern for calling checkers

Only the following statement kind groups would be listed explicitly:

1. statement kinds that do not call checkers for some reason (PreStmt, PostStmt 
or both)
2. statement kinds that call checkers from their visit method with custom 
logic, such as `BinaryOperator` or `LambdaExpr`

The number of these statement kinds can likely be reduced further through 
follow-up patches by turning on checker calls or by refactoring them to the 
regular visit pattern: PreVisit, Visit, PostVisit.

In summary, the intention is to eventually have almost every statement kind 
handled in the regular way and have only a few remaining outlier cases 
documented explicitly in this switch.

https://github.com/llvm/llvm-project/pull/218691
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to