Draft
Conversation
Co-authored-by: owen-mc <62447351+owen-mc@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/codeql/sessions/b400ebd5-4095-401e-8811-fb550600b3c4
Co-authored-by: owen-mc <62447351+owen-mc@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/codeql/sessions/b400ebd5-4095-401e-8811-fb550600b3c4
Co-authored-by: owen-mc <62447351+owen-mc@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/codeql/sessions/b400ebd5-4095-401e-8811-fb550600b3c4
Copilot
AI
changed the title
[WIP] Add shared SSA library integration for Go
Go: use shared SSA library (codeql.ssa.Ssa)
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Go was the last language with its own bespoke SSA implementation. This migrates it to the shared
codeql.ssa.Ssalibrary, consistent with C#, Java, Ruby, Rust, and Swift.Key changes
go/ql/lib/qlpack.yml: Addcodeql/ssa: ${workspace}dependency.BasicBlocks.qll: Addmodule Cfg implements BB::CfgSig<Location>— the CFG adapter required by the shared library.SsaImpl.qll(complete rewrite):defAt,useAt,mayCapture,assignedThroughClosure).SsaInput implements SsaImplCommon::InputSig<Location, BasicBlock>feedingvariableWrite(certain = explicit def, uncertain = capture) andvariableRead.v.isCaptured()short-circuit.SsaImplCommon::Make<Location, BasicBlocks::Cfg, SsaInput> as Impl.Definition,WriteDefinition,UncertainWriteDefinition,PhiNode) and cached predicates (ssaDefReachesRead,phiHasInputFromBlock,firstUse,adjacentUseUse).SSA.qll(updated public API):SsaVariable,SsaDefinitionnow extend the sharedDefinitioninstead of a local newtype.SsaExplicitDefinition extends SsaDefinition, WriteDefinitionSsaVariableCapture extends SsaImplicitDefinition, UncertainWriteDefinitionSsaPhiNode extends SsaPseudoDefinition, PhiNodetoString()formats match the prior output ("definition of x","capture variable x","x = phi(def@L:C, ...)") so test expectations are unchanged. Removed thedefinesAt(bb, idx, v)compatibility wrapper (no external callers) and the now-redundantgetBasicBlock()override (it'sfinalin the shared library).Original prompt
Created from VS Code.
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.