-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: Incomplete refactoring after CL that introduced package types? #19949
Comments
It does look incomplete. Fortunately, it doesn't matter too much from a correctness perspective. From the beginning of cmd/compile/internal/gc/type.go:
|
Indeed - I can't even see the difference anymore... . The factoring is in progress, so feel free to clean up as you see fit. |
Thanks. To be sure: "clean up" means switch to the |
I started switching to the types constants but everything became incredibly verbose. So for now I'd say use the local constants. The factoring as it is clearly doesn't improve the code, but it makes it more explicit what kind of dependencies exist. Ideally (long run) we'd like to use a more direct representation of each type (one struct per type, rather than a Type struct with extension), and make Type an interface (which is already used in some form by the ssa backend). |
Thanks for the explanation. I'm going to close this issue since a) I fixed the specific inconsistency in |
Looking at the
truncfltlit
function ingc/const.go
I see code like this:The fact that we're using
TFLOAT64
fromtypes
andTFLOAT32
fromgc
makes me suspect the refactoring done for CL 39855 (cmd/compile: factor out Pkg, Sym, and Type into package types) was somehow incomplete.cc @griesemer
The text was updated successfully, but these errors were encountered: