| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
Consider a (legal according to the `@bitCast` rules) conversion from u16
to [2]u8: since the former is a scalar and the latter is a pointer
(arrays are represented at pointers in the codegen phase) we have to
allocate a temporary slot on the stack and then bitcast the resulting
pointer to the desired destination type.
Beware that this means the lifetime of the resulting value is the same
of the function it's contained in and for all intents and purposes
should be regarded as a local (eg. it should not escape).
Closes #4395
Closes #5121
|
|
Applying the wrong ABI is slightly better than using the Zig ABI, the
whole thing is so wrong it should be burned to the ground.
|
|
Thanks to @frett27 on irc for reporting the compiler would segfault when
run on ARM.
|
|
The codegen would sometimes change the LLVM type for some constants to
an unnamed structure in order to accomodate extra padding. This is fine
as long as the alignment of each field is still respected and it was not
the case for structure types, leading to ill-formed constants being
generated.
Optional types suffer from this to a lower extent as their layout is
quite lucky, the only missing piece was the tail padding.
Closes #4530
Closes #4594
Closes #4295
Closes my will to live
|
|
* Fix packed struct alignment
* Adjust some tests
|
|
This is a follow-up to d27ef1aaef8ac12801ba4e6c2ed748c7151096a7
and avoids compiler warnings:
warning: argument unused during compilation: '-nostdinc++'
|
|
Thanks to Michael Dusan for figuring out what was happening here.
closes #5012
|
|
Rewrite the bound checks in slice operator
|
|
Extend the logic used for function definitions to variables.
Closes #4947
|
|
* `--major-image-version`
* `--minor-image-version`
* `--stack`
|
|
The extra logic that's needed was lost during a refactoring, now it
should be fine.
|
|
|
|
|
|
Closes #4050
|
|
run detection of libc.
Fixes #4772
|
|
Before, this would cause a link failure when mixing Zig and C code for
RISC-V targets.
Now, the ABIs match and Zig and C code can be mixed successfully.
I will file a follow-up issue for the ability to deal more explicitly
with ABIs.
closes #4863
|
|
Closes #4777
|
|
|
|
Zig disables its caching and forwards these args when any are provided.
see #4784
|
|
|
|
Make fallthrough an error when compiler supports it. This requires a new
macro that is defined with such compilers to be used as a statement, at
all fallthrough sites:
switch (...) {
case 0:
...
ZIG_FALLTHROUGH;
case 1:
...
break;
default:
...
break;
}
If we ever move to C++17 as minimal requirement, then the macro can be
replaced with `[[fallthrough]];` at statement sites.
|
|
fix some nullptr dereferences on arm-linux-musleabhif
|
|
Throughout the stage1 code it is assumed that these have the same layout,
but that was not the case. This caused an issue on 32-bit hardware.
|
|
|
|
zero termination
|
|
This caused link errors in c++ code because it was not correct to pass
these flags to child codegens. And that was the only reason to detect
these flags. Otherwise we can safely rely on non-explicitly-detected
flag forwarding.
|
|
|
|
closes #4786
|
|
* `-isystem` instead of `-I` for system include directories
fixes a problem with native system directories interfering with zig's
bundled libc.
* separate Stage2Target.is_native into Stage2Target.is_native_os and
Stage2Target.is_native_cpu.
|
|
See #4485
|
|
|
|
|
|
|
|
|
|
The basics are working
|
|
|
|
|
|
|
|
|
|
|
|
|
|
implements #863
|
|
* Don't add an extra slot for the sentinel. Most of the code keeps using
the constant value from the type descriptor, let's harmonize all the
code dealing with sentinels.
* Properly write out sentinel values when reinterpreting pointers at
comptime.
* Allow the reading of the 0th element in a `[0:S]T` type.
|
|
Zero-length array with a sentinel may not have zero size.
Closes #4749
|
|
|