@@ -34,7 +34,7 @@ private import Node0ToString
34
34
cached
35
35
private newtype TIRDataFlowNode =
36
36
TNode0 ( Node0Impl node ) { DataFlowImplCommon:: forceCachingInSameStage ( ) } or
37
- TVariableNode ( Variable var , int indirectionIndex ) {
37
+ TGlobalLikeVariableNode ( GlobalLikeVariable var , int indirectionIndex ) {
38
38
indirectionIndex =
39
39
[ getMinIndirectionsForType ( var .getUnspecifiedType ( ) ) .. Ssa:: getMaxIndirectionsForType ( var .getUnspecifiedType ( ) ) ]
40
40
} or
@@ -396,7 +396,7 @@ class Node extends TIRDataFlowNode {
396
396
* modeling flow in and out of global variables.
397
397
*/
398
398
Variable asVariable ( ) {
399
- this = TVariableNode ( result , getMinIndirectionsForType ( result .getUnspecifiedType ( ) ) )
399
+ this = TGlobalLikeVariableNode ( result , getMinIndirectionsForType ( result .getUnspecifiedType ( ) ) )
400
400
}
401
401
402
402
/**
@@ -406,7 +406,7 @@ class Node extends TIRDataFlowNode {
406
406
*/
407
407
Variable asIndirectVariable ( int indirectionIndex ) {
408
408
indirectionIndex > getMinIndirectionsForType ( result .getUnspecifiedType ( ) ) and
409
- this = TVariableNode ( result , indirectionIndex )
409
+ this = TGlobalLikeVariableNode ( result , indirectionIndex )
410
410
}
411
411
412
412
/** Gets an indirection of this node's underlying variable, if any. */
@@ -1751,15 +1751,18 @@ class DefinitionByReferenceNode extends IndirectArgumentOutNode {
1751
1751
}
1752
1752
1753
1753
/**
1754
- * A `Node` corresponding to a variable in the program, as opposed to the
1755
- * value of that variable at some particular point. This can be used for
1756
- * modeling flow in and out of global variables.
1754
+ * A `Node` corresponding to a global (or `static` local) variable in the
1755
+ * program, as opposed to the value of that variable at some particular point.
1756
+ * This is used to model flow through global variables (and `static` local
1757
+ * variables).
1758
+ *
1759
+ * There is no `VariableNode` for non-`static` local variables.
1757
1760
*/
1758
- class VariableNode extends Node , TVariableNode {
1761
+ class VariableNode extends Node , TGlobalLikeVariableNode {
1759
1762
Variable v ;
1760
1763
int indirectionIndex ;
1761
1764
1762
- VariableNode ( ) { this = TVariableNode ( v , indirectionIndex ) }
1765
+ VariableNode ( ) { this = TGlobalLikeVariableNode ( v , indirectionIndex ) }
1763
1766
1764
1767
/** Gets the variable corresponding to this node. */
1765
1768
Variable getVariable ( ) { result = v }
0 commit comments