@@ -56,7 +56,8 @@ class GVN extends TValueNumber {
5656 final string toString ( ) { result = "GVN" }
5757
5858 final Location getLocation ( ) {
59- result = rank [ 1 ] ( Location l |
59+ result =
60+ rank [ 1 ] ( Location l |
6061 l = getAnExpr ( ) .getLocation ( )
6162 |
6263 l
@@ -66,8 +67,36 @@ class GVN extends TValueNumber {
6667 )
6768 }
6869
70+ final string getKind ( ) {
71+ this instanceof TVariableAddressValueNumber and result = "VariableAddress"
72+ or
73+ this instanceof TInitializeParameterValueNumber and result = "InitializeParameter"
74+ or
75+ this instanceof TInitializeThisValueNumber and result = "InitializeThis"
76+ or
77+ this instanceof TStringConstantValueNumber and result = "StringConstant"
78+ or
79+ this instanceof TFieldAddressValueNumber and result = "FieldAddress"
80+ or
81+ this instanceof TBinaryValueNumber and result = "Binary"
82+ or
83+ this instanceof TPointerArithmeticValueNumber and result = "PointerArithmetic"
84+ or
85+ this instanceof TUnaryValueNumber and result = "Unary"
86+ or
87+ this instanceof TInheritanceConversionValueNumber and result = "InheritanceConversion"
88+ or
89+ this instanceof TUniqueValueNumber and result = "Unique"
90+ }
91+
92+ /** Gets an expression that has this GVN. */
93+ Expr getAnExpr ( ) { result = getAnUnconvertedExpr ( ) }
94+
95+ /** Gets an expression that has this GVN. */
96+ Expr getAnUnconvertedExpr ( ) { result = getAnInstruction ( ) .getUnconvertedResultExpression ( ) }
97+
6998 /** Gets an expression that has this GVN. */
70- Expr getAnExpr ( ) { result = getAnInstruction ( ) .getConvertedResultExpression ( ) }
99+ Expr getAConvertedExpr ( ) { result = getAnInstruction ( ) .getConvertedResultExpression ( ) }
71100}
72101
73102/** Gets the global value number of expression `e`. */
0 commit comments