Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 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
78361bc
Initial shared CFG library instantiation for Go
owen-mc Mar 30, 2026
46a034f
Add go/print-cfg
owen-mc May 13, 2026
a2cda5a
Create cfg node for child of ParenExpr
owen-mc May 13, 2026
8d2ce1c
Model non-returning functions in CFG
owen-mc May 19, 2026
39f9498
Tweak `getEnclosingCallable`
owen-mc May 20, 2026
e9d50d2
Fix edges to function exit with result variables
owen-mc May 20, 2026
9487b06
Do not include comments in the CFG
owen-mc May 21, 2026
2bd7721
Use shared CFG implementation of for loops
owen-mc May 21, 2026
033ff80
Fix CFG for select statements
owen-mc May 21, 2026
85dc86e
Fix CFG for range loop
owen-mc May 28, 2026
712b5a7
Include receivers in parameter init
owen-mc May 28, 2026
651d1a3
Fix global value numbering calculation
owen-mc May 28, 2026
1a3f370
Produce CFG nodes for more reference expressions, like selector bases
owen-mc May 29, 2026
8f632f1
Fix CFG for return instructions
owen-mc May 29, 2026
512d8aa
Control flow shouldn't enter another callable
owen-mc May 29, 2026
bbed9d3
Fix empty switch statements
owen-mc May 29, 2026
129b78b
Accept change in test output
owen-mc May 29, 2026
bf386c2
Restore `ExprNode` for `FuncLit`
owen-mc May 29, 2026
1f274c3
update function-entry additional nodes
owen-mc May 30, 2026
682aa19
Fix range loop CFG
owen-mc May 30, 2026
8c8fd59
Fix lit-init nodes
owen-mc May 30, 2026
9ecacdf
Use shared CFG `getIfInit`
owen-mc May 30, 2026
e34ecfd
Go: update expected node names
owen-mc May 30, 2026
f4357ec
Add Go CFG consistency query
owen-mc Jun 1, 2026
f81d8c2
Fix treatment of `ParenExpr`
owen-mc Jun 3, 2026
f7ce4c1
Restore `ConditionGuardNode`
owen-mc Jun 3, 2026
25bc8af
Accept test output change names
owen-mc Jun 3, 2026
d3020c4
Fix ConditionGuardNode
owen-mc Jun 3, 2026
96d4ab6
Accept changes
owen-mc Jun 3, 2026
e423b74
Fix CFG for expressionless switch statements
owen-mc Jun 3, 2026
494578c
accept test changes
owen-mc Jun 3, 2026
c2c36af
Include implicit type switch var in CFG
owen-mc Jun 3, 2026
ef353d2
Allow overriding endAbruptCompletion for callables
owen-mc Jun 16, 2026
08cdd6d
Shared CFG: add callableExitStep hook for routing epilogue tails to e…
owen-mc Jun 16, 2026
778de1f
Go CFG: anchor result-read epilogue on Normal Exit via new hooks
owen-mc Jun 16, 2026
8aa7892
Shared CFG: add hooks for reachability-gated exit epilogue
owen-mc Jun 16, 2026
6bb659d
Go CFG: run deferred calls at function exit in LIFO order
owen-mc Jun 16, 2026
289eecc
Fix calls for defer statements
owen-mc Jun 16, 2026
a782eff
Update query for unreachable statements
owen-mc Jun 19, 2026
59bfa1b
Migrate Go expression switch CFG to shared library; handle fallthroug…
Copilot Jun 23, 2026
d9653bf
Fix switch-case sanitizer edge for shared CFG and accept CFG expected
Copilot Jun 23, 2026
e469499
Update SSA expected files for new shared-CFG node locations
Copilot Jun 23, 2026
14b47b4
Migrate Go type switches to shared CFG switch model (Option B)
Copilot Jun 23, 2026
c69038e
Small refactors
owen-mc Jun 24, 2026
544454e
Fix break in select statements
owen-mc Jun 25, 2026
78ec4d6
Remove unused send instruction node
owen-mc Jun 25, 2026
b87b7dd
Do not create ExprNode for key-value pair
owen-mc Jun 26, 2026
d609331
Fix data flow through tuple extraction for f(g())
owen-mc Jun 26, 2026
6158389
Fix defer logic for panics
owen-mc Jun 29, 2026
55e89c6
Include ResultZeroInitInstruction in EvalImplicitInitInstruction
owen-mc Jun 29, 2026
173aece
Fix circular dependency
owen-mc Jun 29, 2026
0b90ac4
Fix return edges
owen-mc Jun 29, 2026
d8a34ee
Fix ParenExpr consistency test failures
owen-mc Jun 29, 2026
da98ae2
Go: adopt ForeachStmt with destructuring
owen-mc Jul 9, 2026
ce385a9
Only make implicit varargs slice node for reachable calls
owen-mc Jul 9, 2026
efbe252
f Accept
owen-mc Jul 9, 2026
8c149c1
Test changes to be checked
owen-mc Jun 19, 2026
83c7dd3
Accept test result for improved GVN
owen-mc Jun 26, 2026
2c513fb
Accept improved accuracy in redundant recover test
owen-mc Jun 29, 2026
31fd099
Accept test changes
owen-mc Jun 25, 2026
ace5552
Accept consistency query output
owen-mc Jul 9, 2026
d011b46
Accept CFG changes
owen-mc Jul 9, 2026
c417e32
Accept changes
owen-mc Jul 9, 2026
9f1a48f
Accept test result changes
owen-mc Jul 9, 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