16860 Commits

Author SHA1 Message Date
antlilja
14bb533203 use stdout_buffer instead of stdio_buffer in main.zig 2025-07-20 18:27:01 +02:00
Andrew Kelley
8373788c4c
Merge pull request #24488 from ziglang/more
std.zig: finish updating to new I/O API
2025-07-20 11:24:41 +02:00
Andrew Kelley
e43617e686
Merge pull request #24505 from ziglang/json
update std.json and std.zon to new I/O API
2025-07-20 09:48:25 +02:00
Andrew Kelley
c40fb96ca3 std.Io.Writer: fix writeSliceSwap
tried to be too clever, wrote bad code
2025-07-19 22:12:37 -07:00
Jacob Young
b4fd57a9c1 llvm: workaround crashes in llvm loop optimizations
Workaround for #24383
2025-07-20 06:42:47 +02:00
Andrew Kelley
d396780925 Compilation: unrevert some stuff 2025-07-19 19:57:37 -07:00
Andrew Kelley
b956ae20af frontend: align those stdio buffers 2025-07-19 19:57:37 -07:00
Andrew Kelley
bad836a69b Compilation: revert some stuff 2025-07-19 19:57:37 -07:00
Andrew Kelley
93378e2e7b std.zig: finish updating to new I/O API 2025-07-19 19:57:37 -07:00
Jacob Young
592f1043dc cbe: fix comptime-known packed unions 2025-07-20 03:29:25 +02:00
Andrew Kelley
0fb7a0a94b std.zon: better namespace for Serializer 2025-07-19 18:27:09 -07:00
Andrew Kelley
b956b02187 zig env: update std.json API 2025-07-19 16:24:37 -07:00
Andrew Kelley
6e55898661 Compilation: refactor std.fs -> fs
no functional change
2025-07-18 06:42:54 -07:00
Andrew Kelley
c82403020d
Merge pull request #24472 from ziglang/zig-fmt
zig fmt: update related functionality to new I/O API
2025-07-17 12:06:40 +02:00
Andrew Kelley
27212a3e6b LLD: don't default allow_shlib_undefined when cross compiling
prevents e.g. lld-link: warning: undefined symbol: SystemFunction036
from being only a warning
2025-07-17 08:26:24 +02:00
Andrew Kelley
ad726587cc zig fmt: update to new I/O API 2025-07-16 17:20:03 -07:00
Andrew Kelley
9222d201d7 add a happy little main function to src/fmt.zig
Provided for debugging/testing purposes; unused by the compiler.
2025-07-16 17:20:02 -07:00
Andrew Kelley
c4776d66af update compiler 2025-07-16 17:20:02 -07:00
Andrew Kelley
5aa50bcbff fix mips clobbers 2025-07-16 10:27:40 -07:00
Andrew Kelley
fcafc63f3d inline assembly: use types
until now these were stringly typed.

it's kinda obvious when you think about it.
2025-07-16 10:23:02 -07:00
Alex Rønne Petersen
9dc4759902 zig std: link ws2_32.dll on windows
Closes #24450.
2025-07-15 13:53:22 +02:00
Andrew Kelley
deb9f3e88f std.Io: handle packed structs better
Rather than having the endian-suffixed functions be the preferred ones
the unsuffixed ones are the preferred ones and the tricky functions get
a special suffix.

Makes packed structs read and written the same as integers.

closes #12960
2025-07-14 18:43:56 -07:00
Andrew Kelley
148befdaa3
Merge pull request #24409 from ziglang/net
std.net: update to new I/O API
2025-07-15 01:42:40 +02:00
Justus Klausecker
29ac68b253 Sema: Fix invalid AIR generation for switch loop with comptime discarded tag
Add an additional check before emitting `.loop_switch_br` instead
of `.switch_br` in a tagged switch statement for whether any of the
continues referencing its tag are actually runtime reachable.
This fixes triggering an assertion in Liveness caused by the invalid
assumption that every tagged switch must be a loop if its tag is
referenced in any way even if this reference is not runtime reachable.
2025-07-14 09:59:13 -07:00
Ali Cheraghi
f43f89a705 spirv: snake-case the spec 2025-07-14 15:16:17 +02:00
Andrew Kelley
2f3cd175d3 compiler: raise the bar for backend contributions 2025-07-14 09:26:24 +02:00
Andrew Kelley
9a1f4cb011 std.net: update to new I/O API 2025-07-14 00:16:49 -07:00
Alex Rønne Petersen
c6a18e9534 libcxx: fix building for wasm32-wasi by disabling exceptions
I accidentally regressed this in the LLVM 20 upgrade.

Closes #24437.
2025-07-14 07:12:34 +02:00
Andrew Kelley
a558885321 LLVM backend: fixes
* delete dead code
* don't access stack trace too early
* revert unintended edit
2025-07-13 12:16:31 -07:00
Ali Cheraghi
041bcbd109 Do not store StackTrace type 2025-07-13 12:16:31 -07:00
antlilja
e3b79d65d8 LLVM: Move pt field from Object to NavGen
* LLVM: Pass correct tid to emit
* Store stack trace type in Zcu
* Don't use pt.errorIntType in LLVM backend
2025-07-13 12:16:17 -07:00
Joost Doornbos
3974540e5a Fix memory leak in CObject.Diag.Bundle.destroy() 2025-07-13 04:38:58 +02:00
Linus Groh
eb37552536 Remove numerous things deprecated during the 0.14 release cycle
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-11 08:17:43 +02:00
Isaac Freund
f551c7c581 link.Elf: check files in archives for ELF magic
Apparently raw LLVM IR Bitcode files ("Bitstreams") may appear in
archives with LTO enabled. I observed this in the wild on
Chimera Linux.

I'm not yet sure if it's in scope for Zig to support these special
archives, but we should at least give a correct error message.
2025-07-11 04:57:54 +02:00
Andrew Kelley
93ac76594a std: fmt.format to io.Writer.print
allows reverting format -> deprecatedFormat, plus I think this is a
nicer place for the function.
2025-07-09 15:31:02 -07:00
Andrew Kelley
5c6679922d CBE: avoid depending on std.io.Writer.count 2025-07-09 09:32:07 -07:00
Andrew Kelley
bc2cf0c173 eliminate all uses of std.io.Writer.count except for CBE 2025-07-09 09:32:07 -07:00
Andrew Kelley
c1c49a7d1c C backend: fix bitcasting regression 2025-07-08 15:15:08 -07:00
Jacob Young
720cd43fc1 cbe: fix code header being omitted from the output 2025-07-07 22:43:53 -07:00
Andrew Kelley
a983f5b90f wasm backend: memcpy and memmove are the same
both lower to memory.fill operation, which are allowed to overlap
2025-07-07 22:43:53 -07:00
Andrew Kelley
911cd2611f Sema: fix unintentional extra @compileLog newline 2025-07-07 22:43:53 -07:00
Andrew Kelley
26659c862f update compiler unit tests to new API 2025-07-07 22:43:53 -07:00
Andrew Kelley
d8e26275f2 update standalone and incremental tests to new API 2025-07-07 22:43:53 -07:00
Andrew Kelley
f2ad3bcc1c fix 32-bit compilation 2025-07-07 22:43:53 -07:00
Andrew Kelley
7e2a26c0c4 std.io.Writer.printValue: rework logic
Alignment and fill options only apply to numbers.

Rework the implementation to mainly branch on the format string rather
than the type information. This is more straightforward to maintain and
more straightforward for comptime evaluation.

Enums support being printed as decimal, hexadecimal, octal, and binary.

`formatInteger` is another possible format method that is
unconditionally called when the value type is struct and one of the
integer-printing format specifiers are used.
2025-07-07 22:43:53 -07:00
Andrew Kelley
5378fdb153 std.fmt: fully remove format string from format methods
Introduces `std.fmt.alt` which is a helper for calling alternate format
methods besides one named "format".
2025-07-07 22:43:53 -07:00
Andrew Kelley
4ccc6f2b57 compiler: fix remaining build failures 2025-07-07 22:43:53 -07:00
Andrew Kelley
9c8aef55b4 std.fmt.format: use {t} for tag name rather than {s}
prevents footgun when formatted type changes from string to enum
2025-07-07 22:43:52 -07:00
Andrew Kelley
30c2921eb8 compiler: update a bunch of format strings 2025-07-07 22:43:52 -07:00
Andrew Kelley
d09b99d043 C backend: fix compilation errors 2025-07-07 22:43:52 -07:00