Skip to content

Commit 19d8dfa

Browse files
committed
SSA: Improve toString.
1 parent 844badd commit 19d8dfa

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

shared/ssa/codeql/ssa/Ssa.qll

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,6 +1617,9 @@ module Make<
16171617

16181618
/** A static single assignment (SSA) definition. */
16191619
class SsaDefinition extends FinalDefinition {
1620+
/** Gets a textual representation of this SSA definition. */
1621+
string toString() { result = super.toString() }
1622+
16201623
/**
16211624
* Gets the control flow node of this SSA definition.
16221625
*
@@ -1708,6 +1711,8 @@ module Make<
17081711
class SsaParameterInit extends SsaExplicitWrite {
17091712
SsaParameterInit() { parameterInit(this, _) }
17101713

1714+
override string toString() { result = "SSA param(" + this.getSourceVariable() + ")" }
1715+
17111716
/**
17121717
* Gets the parameter that this definition represents. This is equivalent
17131718
* to `getDefinition().isParameterInit(result)`
@@ -1725,6 +1730,8 @@ module Make<
17251730
*/
17261731
class SsaImplicitWrite extends SsaWriteDefinition {
17271732
SsaImplicitWrite() { not explicitWrite(this, _) }
1733+
1734+
override string toString() { result = "SSA implicit def(" + this.getSourceVariable() + ")" }
17281735
}
17291736

17301737
/**
@@ -1734,6 +1741,8 @@ module Make<
17341741
*/
17351742
class SsaImplicitEntryDefinition extends SsaImplicitWrite {
17361743
SsaImplicitEntryDefinition() { this.definesAt(_, any(EntryBasicBlock bb), -1) }
1744+
1745+
override string toString() { result = "SSA entry def(" + this.getSourceVariable() + ")" }
17371746
}
17381747

17391748
/** An SSA definition that represents an uncertain variable update. */

0 commit comments

Comments
 (0)