Skip to content

cmd/compile: cleanup code paths that aren't needed now that -p is required #51734

Closed
@mdempsky

Description

@mdempsky

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:

  1. Initialize types.LocalPkg with base.Ctxt.Pkgpath instead of "".
  2. Change types.TypeHash to use t.LinkString instead of fmtTypeIDHash.
  3. 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.)
  4. 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.

/cc @randall77 @dr2chase @cuonglm

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions