Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: improve mknode.go #53959

randall77 opened this issue Jul 19, 2022 · 1 comment

cmd/compile: improve mknode.go #53959

randall77 opened this issue Jul 19, 2022 · 1 comment


Copy link

@randall77 randall77 commented Jul 19, 2022

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.

@randall77 randall77 added this to the Go1.20 milestone Jul 19, 2022
@randall77 randall77 self-assigned this Jul 19, 2022
@gopherbot gopherbot added the compiler/runtime label Jul 19, 2022
Copy link

@gopherbot gopherbot commented Jul 19, 2022

Change mentions this issue: cmd/compile: redo mknode.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Status: Todo

No branches or pull requests

2 participants