The check interface from the chk3 library is quite inefficient at its job.
Most classes in the checks, for example, implement check_ast in the exact same way; without checking only fleak has actual logic in the function there, because I cannot figure out a way to implement fleak in one pass.
Other than that, all classes do the exact same thing:
Start a for-loop for the given ASTUnits
Get the required structures from the current AST unit
(If clang diagnostics, see #2) Start the source file in the consumer
Set the diagnostic ID for their custom diagnostic
Call the matchAST function on their ASTMatcher instance
(If clang diagnostics, see #2) End the source file in the consumer
This could easily be implemented in one place instead.
The check interface from the chk3 library is quite inefficient at its job.
Most classes in the checks, for example, implement check_ast in the exact same way; without checking only fleak has actual logic in the function there, because I cannot figure out a way to implement fleak in one pass.
Other than that, all classes do the exact same thing:
matchAST
function on their ASTMatcher instanceThis could easily be implemented in one place instead.