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

Closed
randall77 opened this issue Jul 19, 2022 · 1 comment
Closed

cmd/compile: improve mknode.go #53959

randall77 opened this issue Jul 19, 2022 · 1 comment
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge
Milestone

Comments

@randall77
Copy link
Contributor

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 Issues related to the Go compiler and/or runtime. label Jul 19, 2022
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/418375 mentions this issue: cmd/compile: redo mknode.go

@golang golang locked and limited conversation to collaborators Aug 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

2 participants