Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
6f93a71
Initial plan
Copilot Jun 22, 2026
2a3be26
Incidental fix to `CaseClause.getAnExpr()`
owen-mc Jun 3, 2026
d79920c
Initial shared CFG library instantiation for Go
owen-mc Mar 30, 2026
f8b0c11
Add go/print-cfg
owen-mc May 13, 2026
718dad4
Create cfg node for child of ParenExpr
owen-mc May 13, 2026
e319654
Model non-returning functions in CFG
owen-mc May 19, 2026
d603cd4
Tweak `getEnclosingCallable`
owen-mc May 20, 2026
137db51
Fix edges to function exit with result variables
owen-mc May 20, 2026
7a58784
Do not include comments in the CFG
owen-mc May 21, 2026
a6931e3
Use shared CFG implementation of for loops
owen-mc May 21, 2026
e7927d2
Fix CFG for select statements
owen-mc May 21, 2026
3436e6c
Fix CFG for range loop
owen-mc May 28, 2026
d488b32
Include receivers in parameter init
owen-mc May 28, 2026
cbad545
Fix global value numbering calculation
owen-mc May 28, 2026
56dc936
Produce CFG nodes for more reference expressions, like selector bases
owen-mc May 29, 2026
15ed3ba
Fix CFG for return instructions
owen-mc May 29, 2026
6284acc
Control flow shouldn't enter another callable
owen-mc May 29, 2026
433722f
Fix empty switch statements
owen-mc May 29, 2026
9d12edb
Accept change in test output
owen-mc May 29, 2026
73204db
Restore `ExprNode` for `FuncLit`
owen-mc May 29, 2026
cc47cef
update function-entry additional nodes
owen-mc May 30, 2026
f9e25f6
Fix range loop CFG
owen-mc May 30, 2026
e55eecf
Fix lit-init nodes
owen-mc May 30, 2026
740e3a0
Use shared CFG `getIfInit`
owen-mc May 30, 2026
e4cb405
Go: update expected node names
owen-mc May 30, 2026
1f4bbe5
Add Go CFG consistency query
owen-mc Jun 1, 2026
d908e78
Fix treatment of `ParenExpr`
owen-mc Jun 3, 2026
67b28d2
Restore `ConditionGuardNode`
owen-mc Jun 3, 2026
9ee3ecc
Accept test output change names
owen-mc Jun 3, 2026
94ccd7c
Fix ConditionGuardNode
owen-mc Jun 3, 2026
819f076
Fix CFG for expressionless switch statements
owen-mc Jun 3, 2026
8154ed6
Accept changes
owen-mc Jun 3, 2026
2544cca
Include implicit type switch var in CFG
owen-mc Jun 3, 2026
9a2f822
Allow overriding endAbruptCompletion for callables
owen-mc Jun 16, 2026
bb5f601
Shared CFG: add callableExitStep hook for routing epilogue tails to e…
owen-mc Jun 16, 2026
5438846
Go CFG: anchor result-read epilogue on Normal Exit via new hooks
owen-mc Jun 16, 2026
0bca94f
Shared CFG: add hooks for reachability-gated exit epilogue
owen-mc Jun 16, 2026
a57367d
Go CFG: run deferred calls at function exit in LIFO order
owen-mc Jun 16, 2026
5d8a9e4
Fix calls for defer statements
owen-mc Jun 16, 2026
75a833c
Update query for unreachable statements
owen-mc Jun 19, 2026
ba7527c
Migrate Go expression switch CFG to shared library; handle fallthroug…
Copilot Jun 23, 2026
6167003
Fix switch-case sanitizer edge for shared CFG and accept CFG expected
Copilot Jun 23, 2026
e99ade7
Update SSA expected files for new shared-CFG node locations
Copilot Jun 23, 2026
6f15605
Migrate Go type switches to shared CFG switch model (Option B)
Copilot Jun 23, 2026
0c0506e
Small refactors
owen-mc Jun 24, 2026
7dfe573
Fix break in select statements
owen-mc Jun 25, 2026
0cb574f
Remove unused send instruction node
owen-mc Jun 25, 2026
cdbc19b
Fix data flow through tuple extraction for f(g())
owen-mc Jun 26, 2026
e444730
Fix defer logic for panics
owen-mc Jun 29, 2026
f730c88
Include ResultZeroInitInstruction in EvalImplicitInitInstruction
owen-mc Jun 29, 2026
4aaf735
Fix circular dependency
owen-mc Jun 29, 2026
80ee840
Fix return edges
owen-mc Jun 29, 2026
107717d
Fix ParenExpr consistency test failures
owen-mc Jun 29, 2026
832f844
Go: adopt ForeachStmt with destructuring
owen-mc Jul 9, 2026
a3b3381
Only make implicit varargs slice node for reachable calls
owen-mc Jul 9, 2026
45ef413
Fix InitLiteralComponentInstruction.getRhs() for key-value pairs
owen-mc Jul 10, 2026
dc8dbac
Give KeyValueExpr a type and fix notype test
owen-mc Jul 10, 2026
17deba8
Test changes to be checked
owen-mc Jun 19, 2026
28bd631
Accept test result for improved GVN
owen-mc Jun 26, 2026
dfb90b3
Accept improved accuracy in redundant recover test
owen-mc Jun 29, 2026
9236c3a
Accept test changes
owen-mc Jun 25, 2026
d9b3f00
Accept consistency query output
owen-mc Jul 9, 2026
b6136a1
Accept CFG changes
owen-mc Jul 9, 2026
8d1fba3
Accept changes
owen-mc Jul 9, 2026
c08b03f
Accept test result changes
owen-mc Jul 9, 2026
2bde73c
fold implicit-one operand into incdec-rhs instruction
owen-mc Jul 10, 2026
c85744e
fold compound-assign write into the compound-rhs instruction
owen-mc Jul 10, 2026
27e86d8
drop implicit slice-bound nodes
owen-mc Jul 10, 2026
0c381d9
Merge parameter 'arg' node into 'param-init'
owen-mc Jul 10, 2026
57951e2
Merge 'result-init' node into 'result-zero-init'
owen-mc Jul 10, 2026
f07ab45
Fold implicit literal element index into the lit-init node
owen-mc Jul 10, 2026
01eabc8
Remove redundant inConditionalContext
owen-mc Jul 10, 2026
193cd99
Simplify postOrInOrder
owen-mc Jul 10, 2026
1c60ffa
Use default goto handling
owen-mc Jul 10, 2026
d30162b
Fold uninitialised var-decl zero-init and write into one node
owen-mc Jul 10, 2026
c8f81bc
Fold tuple-destructuring extract and write into one node
owen-mc Jul 10, 2026
992a0b5
Unify result-zero-init and zero-init node kinds
owen-mc Jul 10, 2026
6bb4aef
Simplify zero-init code after unifying result-zero-init
owen-mc Jul 10, 2026
8eaa86e
Unify incdec-rhs into the compound-rhs node kind
owen-mc Jul 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions go/downgrades/23f2f56b5d3a846b4f73e3fa62510e36f934fb46/exprs.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
class Expr_ extends @expr {
string toString() { result = "Expr" }
}

class ExprParent_ extends @exprparent {
string toString() { result = "ExprParent" }
}

// The schema for exprs is:
//
// exprs(unique int id: @expr,
// int kind: int ref,
// int parent: @exprparent ref,
// int idx: int ref);
//
// `@rangeelementexpr` (kind 55) is a synthesized node that groups the loop
// variables (the key and value) of a `range` statement. To downgrade we remove
// those nodes and reparent their children (the key and value expressions)
// directly onto the `range` statement, at the same indices.
from Expr_ id, int kind, ExprParent_ newparent, int idx
where
exists(ExprParent_ parent | exprs(id, kind, parent, idx) and kind != 55 |
// A key or value grouped by a range element node: reparent it onto the
// range statement (the range element node's own parent).
exists(Expr_ pe | pe = parent and exprs(pe, 55, newparent, _))
or
// Any other expression keeps its parent unchanged.
not exists(Expr_ pe | pe = parent and exprs(pe, 55, _, _)) and
newparent = parent
)
select id, kind, newparent, idx
Loading
Loading