| Age | Commit message (Collapse) | Author |
|
|
|
Storing defers this way has the benefits that the defer doesn't get
analyzed multiple times in AstGen, it takes up less space, and it
makes Sema aware of defers allowing for 'unreachable else prong'
error on error sets in generic code.
The disadvantage is that it is a bit more complex and errdefers with
payloads now emit a placeholder instruction (but those are rare).
Sema.zig before:
Total ZIR bytes: 3.7794370651245117MiB
Instructions: 238996 (2.051319122314453MiB)
String Table Bytes: 89.2802734375KiB
Extra Data Items: 430144 (1.640869140625MiB)
Sema.zig after:
Total ZIR bytes: 3.3344192504882812MiB
Instructions: 211829 (1.8181428909301758MiB)
String Table Bytes: 89.2802734375KiB
Extra Data Items: 374611 (1.4290275573730469MiB)
|
|
|
|
stage2 ARM: introduce allocRegs mechanism and other improvements
|
|
This avoids the following confusing error message:
error: expected type 'fn(i32, i32) void', found 'fn(i32, i32) void'
|
|
Macro definitions are simply a slice of bytes, which may not be
UTF-8 encoded. If they are not UTF-8 encoded, escape non-printable
and non-ASCII characters as `\xNN`.
Fixes #12784
|
|
|
|
|
|
This is done by introducing a new Mir pseudo-instruction
|
|
|
|
- unwrap_errunion_err for registers
- unwrap_errunion_payload for registers
- ptr_slice_len_ptr for all MCValues
- ptr_slice_ptr_ptr for all MCValues
|
|
|
|
Closes #12776
|
|
Closes #12769
|
|
Closes #12549
|
|
Closes 12680
|
|
|
|
Closes #12698
|
|
Pointers to zero-bit types are not zero-bit types so the function should
return something.
Closes #12716
|
|
Closes #12704
|
|
Follow up to fdb88708527742e450e4c566024d9d50ce61dd8d
|
|
Closes #10793
Co-authored-by: Veikka Tuominen <git@vexu.eu>
|
|
This is problematic because in practice it depends on whether the
compiler backend supports it too, as evidenced by the TODO comment about
LLVM not supporting some architectures that in fact do support tail
calls.
Instead this logic is organized strategically in src/target.zig, part of
the internal compiler source code, and the behavior tests in question
duplicate some logic for deciding whether to proceed with the test.
The proper place to expose this flag is in `@import("builtin")` - the
generated source file - so that third party compilers can advertise
whether they support tail calls.
|
|
|
|
Closes #12656
|
|
Closes #4301
Closes #5692
Closes #6281
Closes #10786
Closes #11149
Closes #11776
|
|
stage2: fix size of c_longdouble for Wasm target
|
|
Since now the size of a c_longdouble is correctly 16 bytes,
the test is no longer passing. It was previously accidentally passing
due to incorrect sizing and it not being larger than the size
of a f64.
disable long_double test for windows
|
|
Closes #12645
|
|
Closes #12376
|
|
Closes #12649
|
|
Adds error for taking a non comptime parameter in a function returning a
comptime-only type but not when that type is dependent on a parameter.
Co-authored-by: Veikka Tuominen <git@vexu.eu>
|
|
Closes #3091
|
|
We call `sema.resolveTypeFields` in order to get the fields of structs
and unions inserted into their data structures. If it isn't called, it
can happen that the fields of a type is queried before those fields are
inserted into (for instance) `Module.Union.fields`, which would result in
a wrong 'no field named' error.
Fixes: #12486
|
|
Closes #7567
|
|
Previously, when lowering AIR instructions `wrap_errunion_payload`,
`wrap_errunion_err`, and `wrap_optional`, the LLVM backend would create
an alloca instruction to store the result, but did not set the alignment
on it. This caused UB which went undetected for a long time until we
started enabling the stack protector.
Closes #12594
Unblocks #12508
Inspires #12634
Tests passed locally:
* test-behavior
* test-cases
|
|
This fixes a bug exposed by cd1833044ab7505bc101c85f59889bd3ea3fac80
where a function type would be converted to generic_poison even after
being instantiated due to containing comptime only types.
This could also be fixed by just checking `is_generic_instantiation`
but this way also provides better type names.
Closes #12625
|
|
Previously, Zig had inconsistent semantics for an enum like this:
`enum(u8){zero = 0}`
Although in theory this can only hold one possible value, the tag
`zero`, Zig no longer will treat the type this way. It will do loads and
stores, as if the type has runtime bits.
Closes #12619
Tests passed locally:
* test-behavior
* test-cases
|
|
Stage2 fixes
|
|
stage2+stage1: remove type parameter from bit builtins
|
|
Closes #12566
|
|
Closes #12616
|
|
|
|
closes #12026
|
|
Closes #12529
Closes #12511
Closes #6835
|
|
Closes #12570
|
|
Closes #12572
|
|
Closes #12537
|
|
Closes #12512
Closes #12513
|
|
Closes #12519
Closes #12505
|