From 289d3374ef8c36bf7e9af64ca78dc8681806c35f Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Mon, 27 Oct 2025 11:23:17 +0100 Subject: [PATCH] SSA: Improve toString. --- shared/ssa/codeql/ssa/Ssa.qll | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/shared/ssa/codeql/ssa/Ssa.qll b/shared/ssa/codeql/ssa/Ssa.qll index 35a6fc8148e..26f3d9f9771 100644 --- a/shared/ssa/codeql/ssa/Ssa.qll +++ b/shared/ssa/codeql/ssa/Ssa.qll @@ -1617,6 +1617,9 @@ module Make< /** A static single assignment (SSA) definition. */ class SsaDefinition extends FinalDefinition { + /** Gets a textual representation of this SSA definition. */ + string toString() { result = super.toString() } + /** * Gets the control flow node of this SSA definition. * @@ -1708,6 +1711,8 @@ module Make< class SsaParameterInit extends SsaExplicitWrite { SsaParameterInit() { parameterInit(this, _) } + override string toString() { result = "SSA param(" + this.getSourceVariable() + ")" } + /** * Gets the parameter that this definition represents. This is equivalent * to `getDefinition().isParameterInit(result)` @@ -1725,6 +1730,8 @@ module Make< */ class SsaImplicitWrite extends SsaWriteDefinition { SsaImplicitWrite() { not explicitWrite(this, _) } + + override string toString() { result = "SSA implicit def(" + this.getSourceVariable() + ")" } } /** @@ -1734,6 +1741,8 @@ module Make< */ class SsaImplicitEntryDefinition extends SsaImplicitWrite { SsaImplicitEntryDefinition() { this.definesAt(_, any(EntryBasicBlock bb), -1) } + + override string toString() { result = "SSA entry def(" + this.getSourceVariable() + ")" } } /** An SSA definition that represents an uncertain variable update. */