File tree Expand file tree Collapse file tree
csharp/ql/lib/semmle/code/csharp/dataflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -516,8 +516,6 @@ module Ssa {
516516 }
517517
518518 override Element getElement ( ) { result = ad .getElement ( ) }
519-
520- override string toString ( ) { result = "SSA def(" + this .getSourceVariable ( ) + ")" }
521519 }
522520
523521 /**
@@ -561,12 +559,6 @@ module Ssa {
561559 final Callable getCallable ( ) { result = this .getBasicBlock ( ) .getEnclosingCallable ( ) }
562560
563561 override Element getElement ( ) { result = this .getCallable ( ) }
564-
565- override string toString ( ) {
566- if this .getSourceVariable ( ) .getAssignable ( ) instanceof LocalScopeVariable
567- then result = "SSA capture def(" + this .getSourceVariable ( ) + ")"
568- else result = "SSA entry def(" + this .getSourceVariable ( ) + ")"
569- }
570562 }
571563
572564 pragma [ nomagic]
@@ -597,10 +589,6 @@ module Ssa {
597589 Parameter getParameter ( ) { result = p }
598590
599591 override Element getElement ( ) { result = this .getParameter ( ) }
600-
601- override string toString ( ) {
602- result = "SSA param(" + pragma [ only_bind_out ] ( this .getParameter ( ) ) + ")"
603- }
604592 }
605593
606594 /**
@@ -694,8 +682,6 @@ module Ssa {
694682 predicate hasInputFromBlock ( Definition inp , BasicBlock bb ) {
695683 inp = SsaImpl:: phiHasInputFromBlock ( this , bb )
696684 }
697-
698- override string toString ( ) { result = "SSA phi(" + this .getSourceVariable ( ) + ")" }
699685 }
700686
701687 /**
Original file line number Diff line number Diff line change @@ -77,6 +77,10 @@ module Ssa_ = Impl::MakeSsa<SsaInput>;
7777
7878class Definition = Impl:: Definition ;
7979
80+ private class SsaDefinitionToStringProxy extends Definition {
81+ override string toString ( ) { result = this .( SsaDefinition ) .toString ( ) }
82+ }
83+
8084deprecated class WriteDefinition = Impl:: WriteDefinition ;
8185
8286deprecated class UncertainWriteDefinition = Impl:: UncertainWriteDefinition ;
Original file line number Diff line number Diff line change @@ -1054,7 +1054,7 @@ module Make<
10541054 /** A static single assignment (SSA) definition. */
10551055 class SsaDefinition extends FinalDefinition {
10561056 /** Gets a textual representation of this SSA definition. */
1057- string toString ( ) { result = super . toString ( ) }
1057+ string toString ( ) { result = "SSA def(" + this . getSourceVariable ( ) + ")" }
10581058
10591059 /**
10601060 * Gets the control flow node of this SSA definition.
@@ -1207,6 +1207,8 @@ module Make<
12071207 * a phi definition for `x` is inserted just before the call `puts x`.
12081208 */
12091209 class SsaPhiDefinition extends SsaDefinition instanceof PhiNode {
1210+ override string toString ( ) { result = "SSA phi(" + this .getSourceVariable ( ) + ")" }
1211+
12101212 /** Holds if `inp` is an input to this phi definition along the edge originating in `bb`. */
12111213 predicate hasInputFromBlock ( SsaDefinition inp , BasicBlock bb ) {
12121214 phiHasInputFromBlockCached ( this , inp , bb )
You can’t perform that action at this time.
0 commit comments