-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Follow-up to #19414 #19437
Follow-up to #19414 #19437
Conversation
Note to avoid blindsiding Andrew: merging this PR would implement #19435. |
`Decl` can no longer store un-interned values, so this field is now unnecessary. The type can instead be fetched with the new `typeOf` helper method, which just gets the type of the Decl's `Value`.
…utable memory Perhaps someday, we will make Sema operate on mutable values more generally. For now, it makes sense to split out this representation, since it is only used in comptime pointer accesses. There are some currently unused methods on `MutableValue` which will be used once I rewrite the comptime pointer access logic to be less terrible. The commit following this one will - at long last - delete the legacy Value representation
Good riddance! Most of these changes are trivial. There's a fix for a minor bug this exposed in `Value.readFromPackedMemory`, but aside from that, it's all just things like changing `intern` calls to `toIntern`.
This commit also performs some refactors to `TypedValue.print` in preparation for improved comptime pointer access logic. Once that logic exists, `TypedValue.print` can use Sema to access pointers for more helpful printing. This commit also implements proposal ziglang#19435, because the existing logic there relied on some blatantly incorrect code in `Value.sliceLen`. Resolves: ziglang#19435
Legacy anon decls now have three uses: * Type owner decls * Function owner decls * `@export` and `@extern` Therefore, there are no longer any cases where we wish to explicitly omit legacy anon decls from the binary. This means we can remove the concept of an "alive" vs "dead" `Decl`, which also allows us to remove the separate `anon_work_queue` in `Compilation`.
Now that the legacy `Value` representation is eliminated, we can begin to phase out the redundant `TypedValue` type.
…n decls Also removes some unnecessary uses of legacy anon decls for constructing the array of test functions for the test runner.
The only logic which remained in this file was the Value printing logic. This has been moved into a new `print_value.zig`.
cacee1a
to
a546258
Compare
Notably, this improves string printing from `@as(*[5:0]u8, &@as([5:0]u8, "hello".*))` to `@as(*[5:0]u8, "hello")`, omitting the pointless ref-deref pair.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So good!
I believe you can also delete Module.deleteUnusedDecl
.
Oh, yep! I'll do that in a moment, and have a quick check for any more newly-unused functions. |
Not "newly" unused, but there were quite a few old methods on |
Feel free to merge when the only remaining checks are aarch64-macos. We're expecting those runners to be offline for one day. |
AFAICT my permissions don't allow me to manually merge through the GitHub UI. I could do it on the command-line (I assume; I can't say I've ever tried to push to master), but IME GitHub is pretty piss-poor at detecting that as a merge. Is it possible to get the relevant permission to do the merge on GitHub? |
See commit messages for more details. To summarize:
ty
field ofZcu.Decl
MutableValue
representation for comptime-mutable memoryValue
representationDecl
" systemTypedValue