| Age | Commit message (Collapse) | Author |
|
This reverts commit f88b523065fbb8afbd723fd6e803ace0334b713c.
Let's please go through the language proposal process for this change. I
don't see any justification for this breaking change even in the commit
message.
|
|
|
|
* Update the msdos stub to be eight bytes smaller, which moves the
machine PE header field into the first 128 bytes of the file,
allowing it to be matched by a binfmt_misc magic sequence.
This allows the build system to get the correct error during exec.
* Fix library name memory leaks in Sema.
|
|
I need some indices for a thing...
|
|
Closes #17513
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Closes #14753
|
|
|
|
|
|
|
|
Resolves: #18007
|
|
Partially addresses #17916.
|
|
Structs, Pointers
|
|
|
|
This reverts commit 547481c31c8a538a7badbdce66d81820177ce87f.
There is a comment that did not get addressed with this patch, and the
required test cases are not added.
Reopens #17798.
|
|
|
|
This avoids a lot of work that just needs deferred cleanup anyway.
Crucially, also avoids use of undefined in `failWithNeededComptime`.
|
|
|
|
|
|
|
|
|
|
There are two optimizations here, which work together to avoid a
pathological case.
The first optimization is that AstGen now records the result type of an
array multiplication expression where possible. This type is not used
according to the language specification, but instead as an optimization.
In the expression '.{x} ** 1000', if we know that the result must be an
array, then it is much more efficient to coerce the LHS to an array with
length 1 before doing the multiplication. Otherwise, we end up with a
1000-element tuple which we must coerce to an array by individually
extracting each field.
Secondly, the previous logic would repeatedly extract element/field
values from the LHS when initializing the result. This is unnecessary:
each element must only be extracted once, and the result reused.
These changes together give huge improvements to compiler performance on
a pathological case: AIR instructions go from 65551 to 15, and total AIR
bytes go from 1.86MiB to 264.57KiB. Codegen time spent on this function
(in a debug compiler build) goes from minutes to essentially zero.
Resolves: #17586
|
|
Sema: implement vararg integer promotions
|
|
pointer field
b3462b7 caused a regression in a third-party project, since it forced
resolution of field initializers for any field call 'foo.bar()', despite
this only being necessary when 'bar' is a comptime field.
See https://github.com/ziglang/zig/pull/17692#issuecomment-1802096734.
|
|
|
|
|
|
Resolves: #17923
|
|
|
|
sema: analyze struct field bodies in a second pass, to allow them to use the layout of the struct itself
|
|
This code was previously tripping an assertion by not making this value
used in the safety check a vector.
|
|
This was intended to work when destructuring was first implemented, and
was just unintentionally missed out.
|
|
This change allows struct field inits to use layout information
of their own struct without causing a circular dependency.
`semaStructFields` caches the ranges of the init bodies in the `StructType`
trailing data. The init bodies are then resolved by `resolveStructFieldInits`,
which is called before the inits are actually required.
Within the init bodies, the struct decl's instruction is repurposed to refer
to the field type itself. This is to allow us to easily rebuild the inst_map
mapping required for the init body instructions to refer to the field type.
Thanks to @mlugg for the guidance on this one!
|
|
|
|
|
|
|
|
|
|
This incremental compilation logic will need to be reworked so that it
does not depend on buried pointers - that is, long-lived pointers that
are owned by non-top-level objects such as Decl.
In the meantime, this fixes memory leaks since the memory management of
these dependencies has bitrotted.
|
|
checks
Resolves: #17843
|
|
Let's take this breaking change opportunity to fix the style of this
enum.
|
|
|
|
was correct
|
|
- Add resolveUnionAlignment, to resolve a union's alignment only, without triggering layout resolution.
- Update resolveUnionLayout to cache size, alignment, and padding. abiSizeAdvanced and abiAlignmentAdvanced
now use this information instead of computing it each time.
|
|
This commit starts by making Zir.Inst.Index a nonexhaustive enum rather
than a u32 alias for type safety purposes, and the rest of the changes
are needed to get everything compiling again.
|
|
Resolves: #17754
|