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
68cf7c8
Switch to using shared CFG library
owen-mc Jul 13, 2026
1e90f8a
Add go/print-cfg
owen-mc May 13, 2026
f433e79
Fix notype test for KeyValueExpr
owen-mc Jul 13, 2026
fb3850c
Update PrintAst tests for RangeElementExpr
owen-mc Jul 13, 2026
abc932d
Trivial test changes (node names, locations)
owen-mc Jul 13, 2026
0fbc422
(to fix) test changes due to CFG nodes for subexprs of const exprs
owen-mc Jul 13, 2026
d570ef9
Accept improved accuracy in redundant recover test
owen-mc Jun 29, 2026
c2cc221
Accept removed reverseRead df consistency result
owen-mc Jul 13, 2026
a8dd60b
removed NoretFunctions result
owen-mc Jul 13, 2026
50fca0f
Accept lost result for noRetFunctions test
owen-mc Jul 13, 2026
49f0823
Accept improved result for noRetFunctions test
owen-mc Jul 13, 2026
eb5f239
Accept test changes that are too hard to check
owen-mc Jun 19, 2026
d2e9173
Add Go CFG consistency query
owen-mc Jun 1, 2026
f4b6e6c
Accept CFG consistency results
owen-mc Jul 13, 2026
5733dd2
fold implicit-one operand into incdec-rhs instruction
owen-mc Jul 10, 2026
2f336f4
fold compound-assign write into the compound-rhs instruction
owen-mc Jul 10, 2026
976838b
drop implicit slice-bound nodes
owen-mc Jul 10, 2026
1f94a09
Merge parameter 'arg' node into 'param-init'
owen-mc Jul 10, 2026
1ee5626
Merge 'result-init' node into 'result-zero-init'
owen-mc Jul 10, 2026
5f60236
Fold implicit literal element index into the lit-init node
owen-mc Jul 10, 2026
0ed0030
Remove redundant inConditionalContext
owen-mc Jul 10, 2026
bd11c48
Simplify postOrInOrder
owen-mc Jul 10, 2026
b0f4b59
Use default goto handling
owen-mc Jul 10, 2026
9c62ce9
Fold uninitialised var-decl zero-init and write into one node
owen-mc Jul 10, 2026
d1fbc52
Fold tuple-destructuring extract and write into one node
owen-mc Jul 10, 2026
9016ad2
Unify result-zero-init and zero-init node kinds
owen-mc Jul 10, 2026
77c8e39
Simplify zero-init code after unifying result-zero-init
owen-mc Jul 10, 2026
ebd83dc
Unify incdec-rhs into the compound-rhs node kind
owen-mc Jul 10, 2026
d220d5c
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/d0e7336b491e35a4c890e0b9755a4030d32ee444/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