]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: adjust IR representations
authorRuss Cox <rsc@golang.org>
Mon, 7 Dec 2020 14:14:44 +0000 (09:14 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 9 Dec 2020 17:05:32 +0000 (17:05 +0000)
commit837b35cc55c258bb57ac9fa337ed0783a6fcc617
tree1e7f1f47df6d52e1fc92d6214602a037d115ad3e
parent0c4944066411c5570ad9e7b66ae414f409d5d826
[dev.regabi] cmd/compile: adjust IR representations

Based on actually using the IR when prototyping adding
type assertions, a few changes to improve it:

- Merge DeferStmt and GoStmt, since they are variants of one thing.
- Introduce LogicalExpr for && and ||, since they (alone) need an init list before Y.
- Add an explicit op to various constructors to make them easier to use.
- Add separate StructKeyExpr - it stores Value in a different abstract location (Left) than KeyExpr (Right).
- Export all fields for use by rewrites (and later reflection).

Passes buildall w/ toolstash -cmp.

Change-Id: Iefbff2386d2bb9ef511ce53b7f92ff6c709dc991
Reviewed-on: https://go-review.googlesource.com/c/go/+/275883
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/typecheck.go
src/cmd/compile/internal/gc/universe.go
src/cmd/compile/internal/ir/expr.go
src/cmd/compile/internal/ir/name.go
src/cmd/compile/internal/ir/node.go
src/cmd/compile/internal/ir/node_gen.go
src/cmd/compile/internal/ir/stmt.go
src/cmd/compile/internal/ir/val.go