* improve the ZIR generated of variable decls
- utilize the same ZIR for the type and init value when possible
- init value gets a result location with the variable type.
no manual coercion is required.
* no longer use return instructions to extract values out of comptime
blocks. Instead run the analysis and then look at the corresponding
analyzed instruction, relying on the comptime mechanism to report
errors when something could not be comptime evaluated.
* move SPU code from std to self hosted compiler
* change std lib comments to be descriptive rather than prescriptive
* avoid usingnamespace
* fix case style of error codes
* remove duplication of producer_string
* generalize handling of less than 64 bit arch pointers
* clean up SPU II related test harness code
See #6113 for an alternate way of doing this that we didn't end up
following.
Closes#6079.
I also took the opportunity here to extract C.zig and Elf.zig from
link.zig.
* std.Mutex API is improved to not have init() deinit(). This API is
designed to support static initialization and does not require any
resource cleanup. This also happens to work around some kind of
stage1 behavior that wasn't letting the new allocator mutex code
get compiled.
* the general purpose allocator now returns a bool from deinit()
which tells if there were any leaks. This value is used by the test
runner to fail the tests if there are any.
* self-hosted compiler is updated to use the general purpose allocator
when not linking against libc.
I made two mistakes in the previous commit; it was not actually using
the argv that we built, and also the qemu logic was unconditionally
skipping the test.
Now I have verified that when mangling the RISC-V "hello world" test and
then using -Denable-qemu, we get a test failure.
I'm allowing incremental compilation of ZIR modules to be broken. This
is not a real use case of ZIR, and the feature requires a lot of code
duplication with incremental compilation of Zig AST (which works great).