@@ -11,6 +11,8 @@ class Node extends TNode {
1111 /** Gets the expression corresponding to this node, if any. */
1212 CfgNodes:: ExprCfgNode asExpr ( ) { result = this .( ExprNode ) .getExprNode ( ) }
1313
14+ CfgNodes:: StmtCfgNode asStmt ( ) { result = this .( StmtNode ) .getStmtNode ( ) }
15+
1416 /** Gets the parameter corresponding to this node, if any. */
1517 Parameter asParameter ( ) { result = this .( ParameterNode ) .getParameter ( ) }
1618
@@ -47,6 +49,22 @@ class ExprNode extends Node, TExprNode {
4749 CfgNodes:: ExprCfgNode getExprNode ( ) { result = n }
4850}
4951
52+ /**
53+ * A statement, viewed as a node in a data flow graph.
54+ *
55+ * Note that because of control-flow splitting, one `Stmt` may correspond
56+ * to multiple `StmtNode`s, just like it may correspond to multiple
57+ * `ControlFlow::Node`s.
58+ */
59+ class StmtNode extends Node , TStmtNode {
60+ private CfgNodes:: StmtCfgNode n ;
61+
62+ StmtNode ( ) { this = TStmtNode ( n ) }
63+
64+ /** Gets the expression corresponding to this node. */
65+ CfgNodes:: StmtCfgNode getStmtNode ( ) { result = n }
66+ }
67+
5068/**
5169 * The value of a parameter at function entry, viewed as a node in a data
5270 * flow graph.
@@ -103,6 +121,9 @@ private import Cached
103121/** Gets a node corresponding to expression `e`. */
104122ExprNode exprNode ( CfgNodes:: ExprCfgNode e ) { result .getExprNode ( ) = e }
105123
124+ /** Gets a node corresponding to statement `s`. */
125+ StmtNode stmtNode ( CfgNodes:: StmtCfgNode e ) { result .getStmtNode ( ) = e }
126+
106127/**
107128 * Gets the node corresponding to the value of parameter `p` at function entry.
108129 */
0 commit comments