* Add `.llvmbc`/`.llvmir` to `ObjectFormat` for emitting unoptimized IR
* Replace `--verbose-air`, `--verbose-intern-pool`,
`--verbose-generic-instances`, `--verbose-llvm-ir`, and
`--verbose-llvm-bc` with various `--debug-log` scopes
* `--debug-log illegal-air`: pre-legalized Air
* `--debug-log legal-air`: post-legalized Air
* `--debug-log air`: final Air with liveness
* `--debug-log ip-stats`: InternPool statistics
* `--debug-log ip-values`: InternPool values
* `--debug-log ip-generic-instances`: InternPool generic instances
* `--debug-log llvm-ir`: pre-optimized LLVM IR
* `--debug-log opt-llvm-ir`: post-optimized LLVM IR
* Delete `--verbose-cimport` which does nothing
* Delete `--verbose-llvm-cpu-features` which is equivalent to looking at
the outputs of `--show-builtin` and `--debug-log llvm-ir`
This pretty much halves the file size of the generated C source code. I have decided to not touch the initial code since I don't believe it would be that beneficial.
Necessary because of the introduction of `@backingInt`/`@fromBackingInt`.
Generated with wasm-opt version 131.
Signed-off-by: Matthew Lugg <mlugg@mlugg.co.uk>
This is necessary after the `@bitCast` changes to prevent zig2 from
being miscompiled on big-endian targets.
Generated with wasm-opt version 118.
Signed-off-by: Matthew Lugg <mlugg@mlugg.co.uk>
Because `std.Io` forces analysis of unused functions in the vtable,
there are now references to 4 more WASI functions, even though the
compiler does not actually call them at runtime.
Therefore, these new stubs fix the bootstrap process after a zig1.wasm
update (though this branch does *not* update zig1.wasm).
It turns out we did use these in the C backend. However, it's really
just as easy, if not easier, to replicate the logic directly in C.
Synchronizes stage1/zig.h to make sure the bootstrap doesn't depend on
these functions either. The actual zig1 tarball is unmodified because
regenerating it is unnecessary in this instance.
This was causing a zig2 miscomp, which emitted slightly broken debug
information, which caused extremely slow stack unwinding. We're working
on fixing or reporting this upstream, but we can use this workaround for
now, because GCC guarantees arithmetic signed shift.
necessary because to pass `zig fmt --check` we need to use the canonical
identifier syntax, which means changing `.@"async"` to `.async` which
previous zig1 is unable to parse.
* Fix warning WasmMut_toC not all control paths return a value
This is a follow up to https://github.com/ziglang/zig/pull/24206 where
I had previously submitted different mechanisms to fix this warning.
This PR is a suggestion by Alex to return NULL instead and Andrew
confirmed this is his preference.
`wasm2c` uses an interesting mechanism to "fake" the existence of cache
directories. However, `wasi_snapshot_preview1_fd_seek` was not correctly
integrated with this system, so previously crashed when run on a file in
a cache directory due to trying to call `fseek` on a `FILE *` which was
`NULL`.
Implementing the changes from the prior commit, to prepare for the
following commit.
This also means that zig1 now uses the new value interpret mode, so
that adding and removing fields from `std.builtin` types is easier.
Signed-off-by: mlugg <mlugg@mlugg.co.uk>
* Make it work for thumb and aarch64.
* Clean up std.os.windows.teb() a bit.
I also updated stage1/zig.h since the changes are backwards-compatible and are
necessary due to the std.os.windows changes that call the newly-added functions.
I took a slightly unconventional approach to detecting endianness here. We have
no compiler/platform-specific preprocessor checks in the stage1 C code today,
and I think that's a property worth maintaining.
As well as being necessary for the `CallingConvention` changes, this
update includes the following notable changes:
* Fix unlabeled `break` targeting the wrong scope in the presence of
labeled continue, unblocking #21422
* Implement `@FieldType`
* Implement `@splat` on arrays
Signed-off-by: mlugg <mlugg@mlugg.co.uk>