@@ -64,9 +64,6 @@ private predicate unresolvedIdentifier(Ident id, string name) {
6464 * An SSA variable.
6565 */
6666class SsaVariable extends Definition {
67- /** Gets the source variable corresponding to this SSA variable. */
68- override SsaSourceVariable getSourceVariable ( ) { this .definesAt ( result , _, _) }
69-
7067 /** Gets the (unique) definition of this SSA variable. */
7168 SsaDefinition getDefinition ( ) { result = this }
7269
@@ -85,21 +82,17 @@ class SsaVariable extends Definition {
8582 /** Gets a use that refers to this SSA variable. */
8683 IR:: Instruction getAUse ( ) { result = this .getAUseIn ( _) }
8784
88- /**
89- * Gets a textual representation of this element.
90- *
91- * The format is `kind@LINE:COL`, where `kind` is one of `def`, `capture`, or `phi`.
92- */
93- override string toString ( ) {
94- exists ( Location loc | loc = this .( SsaDefinition ) .getLocation ( ) |
95- result =
96- this .( SsaDefinition ) .getKind ( ) + "@" + loc .getStartLine ( ) + ":" + loc .getStartColumn ( )
97- )
98- }
99-
100- /** Gets the location of this SSA variable. */
101- override Location getLocation ( ) { result = this .( SsaDefinition ) .getLocation ( ) }
102-
85+ // /**
86+ // * Gets a textual representation of this element.
87+ // *
88+ // * The format is `kind@LINE:COL`, where `kind` is one of `def`, `capture`, or `phi`.
89+ // */
90+ // override string toString() {
91+ // exists(Location loc | loc = this.(SsaDefinition).getLocation() |
92+ // result =
93+ // this.(SsaDefinition).getKind() + "@" + loc.getStartLine() + ":" + loc.getStartColumn()
94+ // )
95+ // }
10396 /**
10497 * DEPRECATED: Use `getLocation()` instead.
10598 *
@@ -123,9 +116,6 @@ class SsaDefinition extends Definition {
123116 /** Gets the SSA variable defined by this definition. */
124117 SsaVariable getVariable ( ) { result = this }
125118
126- /** Gets the source variable defined by this definition. */
127- override SsaSourceVariable getSourceVariable ( ) { this .definesAt ( result , _, _) }
128-
129119 /** Gets the innermost function or file to which this SSA definition belongs. */
130120 ControlFlow:: Root getRoot ( ) { result = this .getBasicBlock ( ) .getScope ( ) }
131121
@@ -180,8 +170,7 @@ class SsaExplicitDefinition extends SsaDefinition, WriteDefinition {
180170 IR:: Instruction getRhs ( ) { this .getInstruction ( ) .writes ( _, result ) }
181171
182172 override string getKind ( ) { result = "def" }
183-
184- override string toString ( ) { result = "definition of " + this .getSourceVariable ( ) }
173+ // override string toString() { result = "definition of " + this.getSourceVariable() }
185174}
186175
187176/** Provides a helper predicate for working with explicit SSA definitions. */
@@ -195,9 +184,7 @@ module SsaExplicitDefinition {
195184/**
196185 * An SSA definition that does not correspond to an explicit variable definition.
197186 */
198- abstract class SsaImplicitDefinition extends SsaDefinition {
199- override Location getLocation ( ) { result = this .getBasicBlock ( ) .getLocation ( ) }
200- }
187+ abstract class SsaImplicitDefinition extends SsaDefinition { }
201188
202189/**
203190 * An SSA definition representing the capturing of an SSA-convertible variable
@@ -207,15 +194,8 @@ abstract class SsaImplicitDefinition extends SsaDefinition {
207194 * at any function call that may affect the value of the variable.
208195 */
209196class SsaVariableCapture extends SsaImplicitDefinition , UncertainWriteDefinition {
210- override Location getLocation ( ) {
211- exists ( BasicBlock bb , int i | this .definesAt ( _, bb , i ) |
212- result = bb .getNode ( i ) .getLocation ( )
213- )
214- }
215-
216197 override string getKind ( ) { result = "capture" }
217-
218- override string toString ( ) { result = "capture variable " + this .getSourceVariable ( ) }
198+ // override string toString() { result = "capture variable " + this.getSourceVariable() }
219199}
220200
221201/**
@@ -247,10 +227,9 @@ class SsaPhiNode extends SsaPseudoDefinition, PhiNode {
247227 override SsaVariable getAnInput ( ) { phiHasInputFromBlock ( this , result , _) }
248228
249229 override string getKind ( ) { result = "phi" }
250-
251- override string toString ( ) {
252- result = this .getSourceVariable ( ) + " = phi(" + this .ppInputs ( ) + ")"
253- }
230+ // override string toString() {
231+ // result = this.getSourceVariable() + " = phi(" + this.ppInputs() + ")"
232+ // }
254233}
255234
256235/**
0 commit comments