Skip to content

Commit de09d51

Browse files
committed
C#: Reinstate toString for SSA data flow nodes.
1 parent a028f5e commit de09d51

2 files changed

Lines changed: 4 additions & 14 deletions

File tree

csharp/ql/lib/semmle/code/csharp/dataflow/SSA.qll

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff 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
/**

csharp/ql/lib/semmle/code/csharp/dataflow/internal/SsaImpl.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ module Ssa_ = Impl::MakeSsa<SsaInput>;
7777

7878
class Definition = Impl::Definition;
7979

80+
private class SsaDefinitionToStringProxy extends Definition {
81+
override string toString() { result = this.(SsaDefinition).toString() }
82+
}
83+
8084
deprecated class WriteDefinition = Impl::WriteDefinition;
8185

8286
deprecated class UncertainWriteDefinition = Impl::UncertainWriteDefinition;

0 commit comments

Comments
 (0)