aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2025-03-11Sema: fix handling of `@This()` on opaquesmlugg
Resolves: #22869
2025-03-11Merge pull request #23193 from mlafeldt/fix-macho-detectionMathias Lafeldt
Fetch: enhance Mach-O executable detection for modern Macs closes #21044
2025-03-10x86_64: implement select of register maskJacob Young
2025-03-10x86_64: fix symbol bugsJacob Young
Closes #23143
2025-03-10Dwarf: remove comptime parameters from generic origin functionsJacob Young
Since generic instantiations are missing comptime arguments in Air, they must be removed from the generic origins too.
2025-03-09Merge pull request #21933 from kcbanner/comptime_nan_comparisonAndrew Kelley
Fix float vector comparisons with signed zero and NaN, add test coverage
2025-03-08Sema: handle generated tag enums in union field order checkIan Johnson
Fixes #23059 The "note: enum field here" now references the field in the base union type rather than crashing.
2025-03-08Merge pull request #22998 from jacobly0/x86_64-rewriteAndrew Kelley
x86_64: rewrite aggregate init
2025-03-08Compilation: Fix `-fno-rtlib-defaultlib` unused argument warning in ReleaseSafe.Alex Rønne Petersen
Closes #23138.
2025-03-08llvm: Replace DataLayoutBuilder with a simple target -> string switch.Alex Rønne Petersen
This should be a lot easier to maintain. It's also a small step towards eventually making the builder API parse the data layout string in order to answer layout questions that we need to ask during code generation.
2025-03-07x86_64: reuse single register code during register write splittingJacob Young
2025-03-07x86_64: implement write register splittingJacob Young
2025-03-07x86_64: rewrite aggregate initJacob Young
2025-03-08zig cc: Don't pass -mabi for assembly files when targeting arm.Alex Rønne Petersen
Clang's integrated Arm assembler doesn't understand -mabi yet, so this results in "unused command line argument" warnings when building musl code and glibc stubs, for example.
2025-03-07std.zig.Ast: improve type safetyTechatrix
This commits adds the following distinct integer types to std.zig.Ast: - OptionalTokenIndex - TokenOffset - OptionalTokenOffset - Node.OptionalIndex - Node.Offset - Node.OptionalOffset The `Node.Index` type has also been converted to a distinct type while `TokenIndex` remains unchanged. `Ast.Node.Data` has also been changed to a (untagged) union to provide safety checks.
2025-03-07std.zig.Ast: add `blockStatements` and `builtinCallParams`Techatrix
2025-03-07add a reference to #21690Techatrix
2025-03-05Remove uses of deprecated callconv aliasesLinus Groh
2025-03-04Fix "dependency path outside project" error for nested local path dependenciesCarl Åstholm
Closes #23076
2025-03-04init: Substitute invalid package names with `foo`Carl Åstholm
Closes #23066
2025-03-03Merge pull request #22979 from mlugg/remove-legacy-coercionsMatthew Lugg
Sema: remove legacy coercion
2025-03-03incremental: invalidate namespace dependencies when a name changes visibilitymlugg
We could have more fine-grained dependencies here, but I think this is fine for now.
2025-03-03Value: fix comparison of NaN in compareHeteroAdvanacedkcbanner
Sema: fix equality comparison of signed zeroes and NaN in compareScalar tests: add test coverage for vector float comparisons
2025-03-03compiler: Don't consider powerpc to have red zone support yet.Alex Rønne Petersen
The command line flag is only supported in Clang 20: https://github.com/ziglang/zig/issues/23056 This gets rid of some warnings when using zig cc.
2025-03-02link: fixed bugs uncovered by changing the cache modeJacob Young
2025-03-02link: make sure MachO closes the damn filesmlugg
Windows is a ridiculous operating system designed by toddlers, and so requires us to close all file handles in the `tmp/xxxxxxx` cache dir before renaming it into `o/xxxxxxx`. We have a hack in place to handle this for the main output file, but the MachO linker also outputs a file with debug symbols, and we weren't closing it! This led to a fuckton of CI failures when we enabled `.whole` cache mode by default for self-hosted backends. thanks jacob for figuring this out while i sat there
2025-03-02compiler: default to `.whole` cache mode for self-hosted backendsmlugg
This is a better default cache mode until incremental compilation is enabled by default.
2025-03-02Merge pull request #22529 from xtexx/x86-64/shl-sat-intJacob Young
x86_64: Implement integer saturating left shifting codegen
2025-03-02x86_64: implement integer saturating left shifting codegenxtex
Simliarly to shl_with_overflow, we first SHL/SAL the integer, then SHR/SAR it back to compare if overflow happens. If overflow happened, set result to the upper limit to make it saturating. Bug: #17645 Co-authored-by: Jacob Young <jacobly0@users.noreply.github.com> Signed-off-by: Bingwu Zhang <xtex@aosc.io>
2025-03-01x86_64: rewrite wrapping add/subJacob Young
2025-02-28Merge pull request #22994 from ziglang/newhashAndrew Kelley
implement new package hash format: `$name-$semver-$hash`
2025-02-28Revert "Merge pull request #22898 from kristoff-it/deprecated-proposal"Andrew Kelley
This reverts commit dea72d15da4fba909dc3ccb2e9dc5286372ac023, reversing changes made to ab381933c87bcc744058d25a876cfdc0d23fc674. The changeset does not work as advertised and does not have sufficient test coverage. Reopens #22822
2025-02-27Move the compiler's LLVM bitcode builder to std.zig.llvm.Alex Rønne Petersen
2025-02-26rename "nonce" to "fingerprint"Andrew Kelley
2025-02-26zig init: adjust template lang to allow zig fmt passthroughAndrew Kelley
2025-02-26bump package id component to 32 bitsAndrew Kelley
and to make the base64 round even, bump sha256 to 200 bits (up from 192)
2025-02-26switch from "id" to "nonce"Andrew Kelley
mainly this addresses the following use case: 1. Someone creates a template with build.zig.zon, id field included (note that zig init does not create this problem since it generates fresh id every time it runs). 2. User A uses the template, changing package name to "example" but not id field. 3. User B uses the same template, changing package name also to "example", also not changing the id field. Here, both packages have unintentional conflicting logical ids. By making the field a combination of name checksum + random id, this accident is avoided. "nonce" is an OK name for this. Also relaxes errors on remote packages when using `zig fetch`.
2025-02-26CLI: add unit test and improve sanitizeExampleNameAndrew Kelley
2025-02-26Package: update unit tests to new APIAndrew Kelley
2025-02-26zig init: sanitize generated nameAndrew Kelley
Adhere to the new rules: 32 byte limit + must be a valid bare zig identifier
2025-02-26introduce package id and redo hash format againAndrew Kelley
Introduces the `id` field to `build.zig.zon`. Together with name, this represents a globally unique package identifier. This field should be initialized with a 16-bit random number when the package is first created, and then *never change*. This allows Zig to unambiguously detect when one package is an updated version of another. When forking a Zig project, this id should be regenerated with a new random number if the upstream project is still maintained. Otherwise, the fork is *hostile*, attempting to take control over the original project's identity. `0x0000` is invalid because it obviously means a random number wasn't used. `0xffff` is reserved to represent "naked" packages. Tracking issue #14288 Additionally: * Fix bad path in error messages regarding build.zig.zon file. * Manifest validates that `name` and `version` field of build.zig.zon are maximum 32 bytes. * Introduce error for root package to not switch to enum literal for name. * Introduce error for root package to omit `id`. * Update init template to generate `id` * Update init template to populate `minimum_zig_version`. * New package hash format changes: - name and version limited to 32 bytes via error rather than truncation - truncate sha256 to 192 bits rather than 40 bits - include the package id This means that, given only the package hashes for a complete dependency tree, it is possible to perform version selection and know the final size on disk, without doing any fetching whatsoever. This prevents wasted bandwidth since package versions not selected do not need to be fetched.
2025-02-26Package.Manifest: enforce maximum version string length of 32Andrew Kelley
2025-02-26Package.Manifest: enforce name limit of 32Andrew Kelley
2025-02-26fix generated hash of by-path dependenciesAndrew Kelley
This branch regressed from master by switching to binary rather than hex digest, allowing null bytes to end up in identifiers in the zig file. This commit fixes it by changing the "hash" to be literally equal to the sub_path (with a prefix '/' to indicate "global") if it can fit. If it is too long then it is actually hashed, and that value used instead.
2025-02-26require package names to be valid zig identifiersAndrew Kelley
2025-02-26Package: new hash formatAndrew Kelley
legacy format is also supported. closes #20178
2025-02-26reword deprecated error slightlyAndrew Kelley
"found" -> "reached" to match "reached unreachable code"
2025-02-26don't inherit allowed deprecation from parent modulesAndrew Kelley
Inheriting allow-deprecation from parent modules doesn't make too much sense, so instead make them default to disallow unless otherwise specified. This allows build system to avoid redundant `-fno-allow-deprecated` args. This makes the generated CLIs smaller, and makes zig1.wasm update not needed. Also represented `is_root` differently (moved to field of graph).
2025-02-26`@deprecated`: optimize sema implementationLoris Cro
mlugg suggested a better way of implementing analysis of an istruction that cannot be referenced by other instructions.
2025-02-26`@deprecated`: add testsLoris Cro