clang 17.0.0git
|
Collects cases of a "match switch": a collection of matchers paired with callbacks, which together define a switch that can be applied to a node whose type derives from BaseT
.
More...
#include "clang/Analysis/FlowSensitive/MatchSwitch.h"
Public Member Functions | |
template<typename NodeT > | |
ASTMatchSwitchBuilder && | CaseOf (MatchSwitchMatcher< BaseT > M, MatchSwitchAction< NodeT, State, Result > A) && |
Registers an action that will be triggered by the match of a pattern against the input statement. | |
ASTMatchSwitch< BaseT, State, Result > | Build () && |
Collects cases of a "match switch": a collection of matchers paired with callbacks, which together define a switch that can be applied to a node whose type derives from BaseT
.
This structure can simplify the definition of transfer
functions that rely on pattern-matching.
For example, consider an analysis that handles particular function calls. It can define the ASTMatchSwitch
once, in the constructor of the analysis, and then reuse it each time that transfer
is called, with a fresh state value.
Definition at line 98 of file MatchSwitch.h.
|
inline |
Definition at line 119 of file MatchSwitch.h.
References clang::ast_matchers::matchDynamic(), Node, and clang::Result.
|
inline |
Registers an action that will be triggered by the match of a pattern against the input statement.
Requirements:
NodeT
should be derived from BaseT
.
Definition at line 107 of file MatchSwitch.h.
References Node.