Skip to content

cmd/compile: improve mknode.go #53959

@randall77

Description

@randall77

The current mknode (cmd/compile/internal/ir/mknode.go) has a few problems:
1) It tends not to run successfully if the tree is in a broken state.
2) It requires that it be run by the go tool in the tree (somewhat related to 1)
3) It requires setting GOROOT
4) It imports code outside the tree (x/packages)

This makes mknode.go very fragile. In particular, I've spent lots of time fighting mknode when adding or removing code, related to 1.

I have a CL to redo mknode.go to use just go/parser instead of the full x/package+typechecker, which will make it more robust. It will work as long as the ir package is parseable, and can be run with any version of Go, not just the one being built.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions