aboutsummaryrefslogtreecommitdiff
path: root/lib/std/builtin.zig
AgeCommit message (Collapse)Author
2025-11-14represent Mac Catalyst as aarch64-maccatalyst-none rather than ↵Alex Rønne Petersen
aarch64-ios-macabi Apple's own headers and tbd files prefer to think of Mac Catalyst as a distinct OS target. Earlier, when DriverKit support was added to LLVM, it was represented a distinct OS. So why Apple decided to only represent Mac Catalyst as an ABI in the target triple is beyond me. But this isn't the first time they've ignored established target triple norms (see: armv7k and aarch64_32) and it probably won't be the last. While doing this, I also audited all Darwin OS prongs throughout the codebase and made sure they cover all the tags.
2025-11-10std.Target: add Arch tag and info for kvxAlex Rønne Petersen
2025-11-05Remove `std.builtin.subsystem`Carl Åstholm
The subsystem detection was flaky and often incorrect and was not actually needed by the compiler or standard library. The actual subsystem won't be known until at link time, so it doesn't make sense to try to determine it at compile time.
2025-10-29Merge pull request #25592 from ziglang/init-std.IoAndrew Kelley
std: Introduce `Io` Interface
2025-10-29remove all IBM AIX and z/OS supportAlex Rønne Petersen
As with Solaris (dba1bf935390ddb0184a4dc72245454de6c06fd2), we have no way to actually audit contributions for these OSs. IBM also makes it even harder than Oracle to actually obtain these OSs. closes #23695 closes #23694 closes #3655 closes #23693
2025-10-29std: fix compilation errors on WindowsAndrew Kelley
2025-10-27feat: init x86_16 arch via CBEGasInfinity
2025-10-23std.builtin: move AddressSpace.Context to std.Target.AddressSpaceContextAlex Rønne Petersen
This type has nothing to do with the language.
2025-10-23std.builtin: add CallingConvention.sh_interruptAlex Rønne Petersen
Only supported in CBE.
2025-10-23std.builtin: add CallingConvention.microblaze_interruptAlex Rønne Petersen
Only supported in CBE.
2025-10-23std.builtin: add CallingConvention.msp430_interruptAlex Rønne Petersen
Supported by LLVM and CBE.
2025-10-23std.builtin: add CallingConvention.x86_64_x32Alex Rønne Petersen
This was forgotten during the refactoring of std.builtin.CallingConvention. It mirrors mips64_n32 for MIPS.
2025-10-23std.Target: add tags and info for alpha, hppa, microblaze, shAlex Rønne Petersen
2025-10-23std.Target: add arceb and xtensaeb Cpu.Arch tagsAlex Rønne Petersen
2025-10-19compiler: add support for arc_interrupt calling conventionAlex Rønne Petersen
Only for use with the C backend at the moment.
2025-09-30replace usages of old std.debug APIsmlugg
src/crash_handler.zig is still TODO though, i am planning bigger changes there
2025-09-26std.builtin: define VaList as `*u8` for uefiAlex Rønne Petersen
2025-09-26std.builtin: remove dead powerpc-darwin handling for VaListAlex Rønne Petersen
2025-09-26std.builtin: define VaList for arc, csky, lanai, m68k, msp430, nvptx, ve, xcoreAlex Rønne Petersen
2025-09-26std.builtin: sort VaList prongs a bitAlex Rønne Petersen
2025-09-26std.builtin: define VaList as `struct { __ap: *anyopaque }` for Arm per AAPCSAlex Rønne Petersen
2025-08-29std.Io: delete GenericReaderAndrew Kelley
and delete deprecated alias std.io
2025-08-25start adding big endian RISC-V supportAlex Rønne Petersen
The big endian RISC-V effort is mostly driven by MIPS (the company) which is pivoting to RISC-V, and presumably needs a big endian variant to fill the niche that big endian MIPS (the ISA) did. GCC already supports these targets, but LLVM support will only appear in 22; this commit just adds the necessary target knowledge and checks on our end.
2025-07-28aarch64: workaround some optional/union issuesJacob Young
2025-07-22aarch64: add new from scratch self-hosted backendJacob Young
2025-07-16inline assembly: use typesAndrew Kelley
until now these were stringly typed. it's kinda obvious when you think about it.
2025-07-11Remove numerous things deprecated during the 0.14 release cycleLinus Groh
Basically everything that has a direct replacement or no uses left. Notable omissions: - std.ArrayHashMap: Too much fallout, needs a separate cleanup. - std.debug.runtime_safety: Too much fallout. - std.heap.GeneralPurposeAllocator: Lots of references to it remain, not a simple find and replace as "debug allocator" is not equivalent to "general purpose allocator". - std.io.Reader: Is being reworked at the moment. - std.unicode.utf8Decode(): No replacement, needs a new API first. - Manifest backwards compat options: Removal would break test data used by TestFetchBuilder. - panic handler needs to be a namespace: Many tests still rely on it being a function, needs a separate cleanup.
2025-07-07std.fmt: fully remove format string from format methodsAndrew Kelley
Introduces `std.fmt.alt` which is a helper for calling alternate format methods besides one named "format".
2025-07-07std.fmt: breaking API changesAndrew Kelley
added adapter to AnyWriter and GenericWriter to help bridge the gap between old and new API make std.testing.expectFmt work at compile-time std.fmt no longer has a dependency on std.unicode. Formatted printing was never properly unicode-aware. Now it no longer pretends to be. Breakage/deprecations: * std.fs.File.reader -> std.fs.File.deprecatedReader * std.fs.File.writer -> std.fs.File.deprecatedWriter * std.io.GenericReader -> std.io.Reader * std.io.GenericWriter -> std.io.Writer * std.io.AnyReader -> std.io.Reader * std.io.AnyWriter -> std.io.Writer * std.fmt.format -> std.fmt.deprecatedFormat * std.fmt.fmtSliceEscapeLower -> std.ascii.hexEscape * std.fmt.fmtSliceEscapeUpper -> std.ascii.hexEscape * std.fmt.fmtSliceHexLower -> {x} * std.fmt.fmtSliceHexUpper -> {X} * std.fmt.fmtIntSizeDec -> {B} * std.fmt.fmtIntSizeBin -> {Bi} * std.fmt.fmtDuration -> {D} * std.fmt.fmtDurationSigned -> {D} * {} -> {f} when there is a format method * format method signature - anytype -> *std.io.Writer - inferred error set -> error{WriteFailed} - options -> (deleted) * std.fmt.Formatted - now takes context type explicitly - no fmt string
2025-07-07std.io: move getStdIn, getStdOut, getStdErr functions to fs.FileAndrew Kelley
preparing to rearrange std.io namespace into an interface how to upgrade: std.io.getStdIn() -> std.fs.File.stdin() std.io.getStdOut() -> std.fs.File.stdout() std.io.getStdErr() -> std.fs.File.stderr()
2025-07-07zig fmtAndrew Kelley
2025-07-07remove `async` and `await` keywordsAndrew Kelley
Also remove `@frameSize`, closing #3654. While the other machinery might remain depending on #23446, it is settled that there will not be `async`/ `await` keywords in the language.
2025-06-23remove `spirv` cpu archAli Cheraghi
2025-06-16rename spirv backend nameAli Cheraghi
`stage2_spirv64` -> `stage2_spirv`
2025-06-06x86_64: add support for pie executablesJacob Young
2025-05-21spirv: write error value in an storage bufferAli Cheraghi
2025-05-20compiler: Scaffold stage2_powerpc backend.Alex Rønne Petersen
Nothing interesting here; literally just the bare minimum so I can work on this on and off in a branch without worrying about merge conflicts in the non-backend code.
2025-05-03std.Target: Add Cpu.Arch.or1k and basic target info.Alex Rønne Petersen
2025-03-19compiler: Support more GCC code models and fix the mapping to LLVM code models.Alex Rønne Petersen
Closes #22517.
2025-02-17std.Target: Remove functions that just wrap component functions.Alex Rønne Petersen
Functions like isMinGW() and isGnuLibC() have a good reason to exist: They look at multiple components of the target. But functions like isWasm(), isDarwin(), isGnu(), etc only exist to save 4-8 characters. I don't think this is a good enough reason to keep them, especially given that: * It's not immediately obvious to a reader whether target.isDarwin() means the same thing as target.os.tag.isDarwin() precisely because isMinGW() and similar functions *do* look at multiple components. * It's not clear where we would draw the line. The logical conclusion before this commit would be to also wrap Arch.isX86(), Os.Tag.isSolarish(), Abi.isOpenHarmony(), etc... this obviously quickly gets out of hand. * It's nice to just have a single correct way of doing something.
2025-02-17std.Target: Make Cpu.Arch.supportsAddressSpace() take an optional context.Alex Rønne Petersen
Allows deduplicating the code in Sema.
2025-02-17std.builtin: Rename CallingConvention.propeller1_sysv to propeller_sysv.Alex Rønne Petersen
2025-02-17std.builtin: Rename CallingConvention.wasm_watc to wasm_mvp.Alex Rønne Petersen
2025-02-17std.builtin: Remove CallingConvention.arm_(apcs,aapcs16_vfp).Alex Rønne Petersen
* arm_apcs is the long dead "OABI" which we never had working support for. * arm_aapcs16_vfp is for arm-watchos-none which is a dead target that we've dropped support for.
2025-02-17std.Target: Remove Cpu.Arch.propeller2 and use a CPU feature instead.Alex Rønne Petersen
2025-01-24std: remove old declarations now a zig1 update has happenedmlugg
2025-01-24all: update for `panic.unwrapError` and `panic.call` signature changesmlugg
2025-01-24compiler: yet more panic handler changesmlugg
* `std.builtin.Panic` -> `std.builtin.panic`, because it is a namespace. * `root.Panic` -> `root.panic` for the same reason. There are type checks so that we still allow the legacy `pub fn panic` strategy in the 0.14.0 release. * `std.debug.SimplePanic` -> `std.debug.simple_panic`, same reason. * `std.debug.NoPanic` -> `std.debug.no_panic`, same reason. * `std.debug.FormattedPanic` is now a function `std.debug.FullPanic` which takes as input a `panicFn` and returns a namespace with all the panic functions. This handles the incredibly common case of just wanting to override how the message is printed, whilst keeping nice formatted panics. * Remove `std.builtin.panic.messages`; now, every safety panic has its own function. This reduces binary bloat, as calls to these functions no longer need to prepare any arguments (aside from the error return trace). * Remove some legacy declarations, since a zig1.wasm update has happened. Most of these were related to the panic handler, but a quick grep for "zig1" brought up a couple more results too. Also, add some missing type checks to Sema. Resolves: #22584 formatted -> full
2025-01-22std.builtin: make `returnError` not take the error tracemlugg
It's now unnecessary to explicitly pass this, because it receives an implicit error trace parameter anyway, so can just use `@errorReturnTrace()`. The previous commit updated Sema to expect this new interface. This saves an AIR instruction at all `returnError` call sites.
2025-01-16std.builtin.Type: improve ergonomics of `*const anyopaque` fieldsmlugg
For representing struct field default values and array/pointer type sentinel values, we use `*const anyopaque`, since there is no way for `std.builtin.Type.StructField` etc to refer back to its `type` field. However, when introspecting a type, this is quite awkward due to the pointer casts necessary. As such, this commit renames the `sentinel` fields to `sentinel_ptr`, and the `default_value` field to `default_value_ptr`, and introduces helper methods `sentinel()` and `defaultValue()` to load the values. These methods are marked as `inline` because their return value, which is always comptime-known, is very often required at comptime by use sites, so this avoids having to annotate such calls with `comptime`. This is a breaking change, although note that 0.14.0 is already a breaking release for all users of `std.builtin.Type` due to the union fields being renamed.