You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cmd/compile: cleanup code paths that aren't needed now that -p is required #51734
Since CL 391014 (a987aaf), cmd/compile now requires the -p flag. There's a lot of code to handle code paths that aren't needed any more.
At least a few cleanups I can think of:
Initialize types.LocalPkg with base.Ctxt.Pkgpath instead of "".
Change types.TypeHash to use t.LinkString instead of fmtTypeIDHash.
Get rid of "package height" and just sort method sets on identifier and package path. (We can just write package height as 0 in the iexport data format; public importers ignore it anyway.)
Change cmd/link (or cmd/internal/obj?) to Fatalf if it sees "". in any linker symbols.
Perhaps other opportunities.
The iexport file format uses "" for the current package too, which probably needs to be retained for compatibility with legacy importers.
Activity
randall77 commentedon Mar 16, 2022
I think point 2 will be the right fix to revert/improve what CL 389474 did.
cuonglm commentedon Mar 17, 2022
I'm going to send a CL for this.
cuonglm commentedon Mar 17, 2022
Hmm, simply changing
types.TypeHashto uset.LinkString()makego run run.gopanic with:It seems to need more works than I expect, so feel free to go ahead if you have one, otherwise, I will take another look when I'm back with my laptop.
cc @mdempsky @randall77
mdempsky commentedon Mar 17, 2022
@cuonglm At least step 1 needs to happen before we can do step 2. :)
gopherbot commentedon Mar 18, 2022
Change https://go.dev/cl/393715 mentions this issue:
cmd/compile: set LocalPkg.Path to -p flaggopherbot commentedon Mar 18, 2022
Change https://go.dev/cl/393716 mentions this issue:
cmd/compile/internal/types: use Type.LinkString in TypeHashgopherbot commentedon Mar 18, 2022
Change https://go.dev/cl/393896 mentions this issue:
test: remove obsolete test cases that misuse -ptest: remove obsolete test case that misuses -p
gopherbot commentedon May 3, 2022
Change https://go.dev/cl/403757 mentions this issue:
cmd/compile: combo set LocalPkg.Path to -p flaggopherbot commentedon May 12, 2022
Change https://go.dev/cl/406059 mentions this issue:
cmd/compile/internal/ir: remove PkgFuncName assumption that LocalPkg.Path == ""gopherbot commentedon May 12, 2022
Change https://go.dev/cl/406056 mentions this issue:
cmd/compile/internal/noder: remove unified IR assumptions on LocalPkg.Path == ""gopherbot commentedon May 12, 2022
Change https://go.dev/cl/406057 mentions this issue:
cmd/compile/internal/typecheck: remove iexport assumption of LocalPkg.Path == ""gopherbot commentedon May 12, 2022
Change https://go.dev/cl/406055 mentions this issue:
cmd/compile/internal/gc: parse command-line flags earlier38 remaining items
[dev.unified] cmd/compile/internal/types2: remove package height
[dev.unified] cmd/compile: only sort symbols by name and package path
[dev.unified] cmd/compile: remove package height
[dev.unified] cmd/compile/internal/types2: remove package height
mdempsky commentedon Nov 30, 2022
I think this is more or less done now. This issue has served its purpose.