Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
bb0b50c
Switch to using shared CFG library
owen-mc Jul 13, 2026
2fcfb42
Add go/print-cfg
owen-mc May 13, 2026
c6abc67
Fix notype test for KeyValueExpr
owen-mc Jul 13, 2026
21d186c
Update PrintAst tests for RangeElementExpr
owen-mc Jul 13, 2026
f335c64
Trivial test changes (node names, locations)
owen-mc Jul 13, 2026
427d234
(to fix) test changes due to CFG nodes for subexprs of const exprs
owen-mc Jul 13, 2026
85be8a1
Accept improved accuracy in redundant recover test
owen-mc Jun 29, 2026
1ce1f9c
Accept removed reverseRead df consistency result
owen-mc Jul 13, 2026
5404666
removed NoretFunctions result
owen-mc Jul 13, 2026
3bec7ca
Accept lost result for noRetFunctions test
owen-mc Jul 13, 2026
cb7e6c9
Accept improved result for noRetFunctions test
owen-mc Jul 13, 2026
b28e453
Accept test changes that are too hard to check
owen-mc Jun 19, 2026
ec0175d
Add Go CFG consistency query
owen-mc Jun 1, 2026
e6f54bf
Accept CFG consistency results
owen-mc Jul 13, 2026
e8ec6e1
fold implicit-one operand into incdec-rhs instruction
owen-mc Jul 10, 2026
5ebd695
fold compound-assign write into the compound-rhs instruction
owen-mc Jul 10, 2026
76fca59
drop implicit slice-bound nodes
owen-mc Jul 10, 2026
d72041c
Merge parameter 'arg' node into 'param-init'
owen-mc Jul 10, 2026
ff88aba
Merge 'result-init' node into 'result-zero-init'
owen-mc Jul 10, 2026
d609864
Fold implicit literal element index into the lit-init node
owen-mc Jul 10, 2026
2ff1d5d
Remove redundant inConditionalContext
owen-mc Jul 10, 2026
7e00e04
Simplify postOrInOrder
owen-mc Jul 10, 2026
762119c
Use default goto handling
owen-mc Jul 10, 2026
f9cd31b
Fold uninitialised var-decl zero-init and write into one node
owen-mc Jul 10, 2026
2366d53
Fold tuple-destructuring extract and write into one node
owen-mc Jul 10, 2026
52fc320
Unify result-zero-init and zero-init node kinds
owen-mc Jul 10, 2026
a403566
Simplify zero-init code after unifying result-zero-init
owen-mc Jul 10, 2026
654577b
Unify incdec-rhs into the compound-rhs node kind
owen-mc Jul 10, 2026
5f32c69
No CFG nodes for subexprs of const exprs
owen-mc Jul 13, 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