[clang][dataflow] Generalise match switch utility to other AST types and add a...
[clang][dataflow] Generalise match switch utility to other AST types and add a `CFGMatchSwitch` which currently handles `CFGStmt` and `CFGInitializer`. `MatchSwitch` currently takes in matchers and functions for the `Stmt` class. This patch generalises the match switch utility (renamed to `ASTMatchSwitch`) to work for different AST node types by introducing a template argument which is the base type for the AST nodes that the match switch will handle. A `CFGMatchSwitch` is introduced as a wrapper around multiple `ASTMatchSwitch`s for different base types. It works by unwrapping `CFGElement`s into their contained AST nodes and passing the nodes to the relevant `ASTMatchSwitch`. The `CFGMatchSwitch` currently only handles `CFGStmt` and `CFGInitializer`. Reviewed By: gribozavr2, sgatev Differential Revision: https://reviews.llvm.org/D131616
Loading
Please sign in to comment