Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
221 commits
Select commit Hold shift + click to select a range
537cb49
std.os.linux: Define the Stat struct for riscv32.
alexrp Aug 31, 2024
6364995
std.os.linux: Also use kernel_timespec for riscv32 when libc is linked.
alexrp Aug 31, 2024
68bb788
std.os.linux: Make nanosleep() a compile error on riscv32.
alexrp Aug 31, 2024
f10b226
Compilation: Pass -fPIC for assembly files too, not just C files.
alexrp Aug 27, 2024
2de7296
Compilation: Pass -mthumb for assembly files too, not just C files.
alexrp Aug 27, 2024
f021ad5
musl: Build with -fno-builtin and -mimplicit-it=always (for thumb) li…
alexrp Aug 28, 2024
0ecc633
start: Fix arm stack alignment code to work for thumb too.
alexrp Aug 29, 2024
49ad51b
Builder: add `indirectbr` llvm instruction
jacobly0 Apr 28, 2024
1b000b9
Air: direct representation of ranges in switch cases
mlugg Aug 30, 2024
5fb4a7d
Air: add explicit `repeat` instruction to repeat loops
mlugg Apr 25, 2024
5e12ca9
compiler: implement labeled switch/continue
mlugg Apr 28, 2024
0cc8435
std.zig: resolve syntactic ambiguity
mlugg Apr 29, 2024
3b52e5a
std.zig.render: fix switch rendering
mlugg Apr 30, 2024
cb68c09
wasm: un-regress `loop` and `switch_br`
mlugg Apr 29, 2024
fd70d9d
x86_64: un-regress `loop` and `switch_br`
mlugg Aug 30, 2024
b7a55cd
AstGen: allow breaking from labeled switch
mlugg Aug 30, 2024
2b9af9e
AstGen: error on unused switch label
mlugg Aug 30, 2024
d5b01df
x86_64: implement `loop_switch_br` and `switch_dispatch`
jacobly0 Sep 1, 2024
97ed239
riscv: implement `repeat` and the new `switch_br`
Rexicon226 Sep 1, 2024
0d295d7
riscv: implement `switch_dispatch` & `loop_switch_br`
Rexicon226 Sep 1, 2024
289c704
cbe: don't emit 'x = x' in switch dispatch loop
mlugg Sep 1, 2024
0df1d78
`std.equalRange`: Compute lower and upper bounds
LucasSantos91 Sep 3, 2024
8f742ec
Reuse precomputed bounds.
LucasSantos91 Sep 3, 2024
7a4d699
AstGen: update @errorCast to maybe eval to err
mikdusan Sep 3, 2024
290ccb1
glibc: Avoid building and linking stub libraries that were emptied in…
alexrp Aug 31, 2024
e5ee9c1
std.elf: Bring the EM enum up to date.
alexrp Aug 20, 2024
f87dd43
stdlib : base64 encode to writer (#20961)
Arwalk Sep 4, 2024
b44dd59
elf: split Atom.allocate into Atom-independent parts
kubkon Aug 27, 2024
d32af9e
elf: move initOutputSection into Elf from Object
kubkon Aug 27, 2024
8f1ce3c
elf: shuffle some stages to make it clear what needs what
kubkon Aug 27, 2024
37a1f0e
elf: allocate .bss in ZigObject similarly to .eh_frame
kubkon Aug 28, 2024
0b92404
elf: allocate .data in ZigObject similarly to .eh_frame
kubkon Aug 29, 2024
8485355
elf: allocate .data.rel.ro and .rodata in ZigObject similarly to .eh_…
kubkon Aug 29, 2024
2d0f4fc
elf: allocate .text in ZigObject similarly to .eh_frame
kubkon Aug 29, 2024
ef6ee90
elf: remove now unused number_of_zig_segments
kubkon Aug 29, 2024
bc39bdd
elf: remove isDebugSection helper
kubkon Aug 29, 2024
25fa092
elf: fix a typo in setting ZigObject.data_relro_index
kubkon Aug 29, 2024
acb91f4
elf: fix emitting correct .rela. sections in -r mode
kubkon Aug 29, 2024
da60159
elf+dwarf: refer sections via section symbols
kubkon Aug 30, 2024
3e100c5
dwarf: make Section.off a function
kubkon Aug 30, 2024
6ec5df3
elf: allocate .tdata and .tbss using allocateAtom mechanics
kubkon Aug 30, 2024
1ef96f0
elf: introduce SectionChunk - a container of atoms per object file
kubkon Sep 1, 2024
45e46f0
elf: allocate atom chunks using allocateChunk mechanics in objects
kubkon Sep 1, 2024
874ef63
elf: do not create .eh_frame section if ZigObject already did so
kubkon Sep 2, 2024
f87a725
elf: actually write allocated atoms in object files
kubkon Sep 2, 2024
6a50a0f
elf: update osec index for section chunks in objects
kubkon Sep 2, 2024
6b53dc9
elf: actually allocate atoms within each section chunk
kubkon Sep 2, 2024
5cb51c1
elf: fix relocatable mode
kubkon Sep 2, 2024
2ef3e30
elf: emit relocs for self-hosted generated .eh_frame section
kubkon Sep 3, 2024
88e0d49
elf: init rela sections in a separate pass for ZigObject
kubkon Sep 3, 2024
5cdad18
elf: do not create .eh_frame section if ZigObject already did so in r…
kubkon Sep 3, 2024
fca92fd
elf: copy existing data when allocating other alloc sections in reloc…
kubkon Sep 3, 2024
eeec50d
elf: misc .eh_frame management fixes
kubkon Sep 3, 2024
801f038
elf: do not pad placeholders coming from input object files
kubkon Sep 4, 2024
8c76a61
test/link/elf: test --gc-sections on Zig input with LLVM too
kubkon Sep 4, 2024
6ec8b15
elf: fix emitting static lib when ZigObject is present
kubkon Sep 4, 2024
64ad6ef
elf: create back/forward links for atoms within section chunks
kubkon Sep 4, 2024
d302a10
elf: rename SectionChunk into AtomList and store as part of Section
kubkon Sep 4, 2024
f3d527c
elf: migrate thunks to the new mechanism (AtomList)
kubkon Sep 4, 2024
b6caab6
elf: actually commit AtomList.zig
kubkon Sep 4, 2024
516955d
elf: add AtomList.zig to CMakeLists.txt
kubkon Sep 4, 2024
e1d5bb3
elf: fix 32bit build
kubkon Sep 4, 2024
7e31804
Merge pull request #21305 from ziglang/elf-incr
kubkon Sep 4, 2024
1989583
compiler: Force ELFv2 for powerpc64.
alexrp Sep 4, 2024
2a6eecf
test: Disable `reinterpret packed union` for powerpc64 too.
alexrp Sep 4, 2024
40ee682
test: Disable `store vector with memset` on powerpc64.
alexrp Sep 4, 2024
ee3efe8
test: Add `powerpc64-linux-(none,musl)` triples to module tests.
alexrp Sep 4, 2024
3929cac
Merge pull request #21257 from mlugg/computed-goto-3
andrewrk Sep 5, 2024
c852992
glibc: Also pass `-Wno-unsupported-floating-point-opt` when building …
alexrp Aug 24, 2024
e492e72
glibc: Set asm and include paths for s390x.
alexrp Aug 24, 2024
0bbfa19
glibc: Add include path for gnux32.
alexrp Aug 24, 2024
9eb66ab
glibc: Set asm and include paths for m68k.
alexrp Aug 24, 2024
06945d5
glibc: Add arc start files.
alexrp Aug 24, 2024
7474600
glibc: Add csky start files.
alexrp Aug 24, 2024
4b4fce3
glibc: Set asm and include paths for arc.
alexrp Aug 24, 2024
1773a88
glibc: Set asm and include paths for csky.
alexrp Aug 24, 2024
27c72c5
glibc: Fix an edge case leading to duplicate stub symbols.
alexrp Aug 24, 2024
3543f28
std.math.big.int: fix shiftRight sign handling
ianprime0509 Sep 6, 2024
204107c
package-manager: add application/x-tar-gz mime type
travisstaloch Sep 5, 2024
b230e4f
glibc: Patch to work around missing features in LLVM's s390x assembler.
alexrp Sep 5, 2024
1511a41
Merge pull request #21310 from alexrp/ppc64-tests
andrewrk Sep 6, 2024
96fcc8d
Merge pull request #21195 from alexrp/glibc-fixes
andrewrk Sep 6, 2024
f29bdd6
Merge pull request #21263 from alexrp/thumb-fixes
andrewrk Sep 6, 2024
8043197
std.os.linux: Add clock_nanosleep() syscall wrapper.
alexrp Aug 31, 2024
f350155
std.time: Use clock_nanosleep() to implement sleep() on Linux.
alexrp Aug 31, 2024
65a6e9e
std.posix: Skip a couple of tests that use fstat()/fstatat() on riscv32.
alexrp Aug 31, 2024
a0205ff
std.DynLib: Prefer std.fs.File.stat() over posix.fstat().
alexrp Aug 31, 2024
ae10adb
llvm: Don't lower to f16 for riscv32.
alexrp Aug 31, 2024
c1a70ac
std.zig.target: Split `mips(el)-linux-musl` triples into `mips(el)-li…
alexrp Aug 24, 2024
17f54e8
std.zig.target: Split `powerpc-linux-musl` triple into `powerpc-linux…
alexrp Aug 24, 2024
af370a6
std.Target: Make Abi.floatAbi() more accurate.
alexrp Aug 24, 2024
92517fb
llvm: Set float ABI based on std.Target.floatAbi().
alexrp Aug 24, 2024
5f3d9e0
Merge pull request #21261 from alexrp/riscv32
andrewrk Sep 7, 2024
5c128a8
test: Re-enable `vector shift operators` for all LLVM targets.
alexrp Sep 5, 2024
ccf852c
test: Re-enable `vector reduce operation` for most LLVM targets.
alexrp Sep 5, 2024
c97db8e
Support stringifying non-exhaustive enum to json (#21228)
pfgithub Sep 7, 2024
af04404
std: Fix assembler comment syntax for sparc.
alexrp Sep 5, 2024
fb81522
Merge pull request #21327 from alexrp/reenable-tests
andrewrk Sep 7, 2024
fb0028a
mips: fix C ABI compatibility
vesim987 Sep 7, 2024
54b668f
std.fmt: Update casing of a few functions to match naming style guide
linusg Sep 3, 2024
9e6d167
comp: `populateTestFunctions` shouldn't bubble up `AnalysisFail`
Rexicon226 Sep 9, 2024
de8cece
sync Aro dependency
Vexu Sep 8, 2024
95bb536
zig cc: Support `-rtlib=none` for disabling compiler-rt.
alexrp Sep 7, 2024
6b1f509
std.zig.render: replace magic number `4` with `indent_delta`.
Des-Nerger Sep 9, 2024
d6d09f4
add error for discarding if/while pointer capture
xdBronch Sep 9, 2024
6836799
llvm: Set use-soft-float and noimplicitfloat on functions for soft fl…
alexrp Aug 25, 2024
70c9233
llvm: Limit f16/f128 lowering on arm to fp_armv8 and soft float.
alexrp Aug 28, 2024
77c8f4b
Compilation: Pass hard/soft float flags to Clang as appropriate.
alexrp Aug 25, 2024
f945551
Compilation: Work around llvm/llvm-project#105972 by defining the mac…
alexrp Aug 25, 2024
65d36be
std.zig.system: Work around llvm/llvm-project#105978 by disabling vfp2.
alexrp Aug 27, 2024
4fcd3e0
musl: Build with -ffp-contract=off.
alexrp Aug 28, 2024
5285f41
test: Disable `store vector with memset` on soft float arm.
alexrp Aug 28, 2024
26119bd
test: Skip some floating point tests that fail on `arm-linux-(gnu,mus…
alexrp Aug 28, 2024
a872b61
test: Add arm, mips, and powerpc soft float targets to module tests.
alexrp Aug 28, 2024
75983c6
test: Switch all `arm-linux-*` triples for module tests from v8a to v7a.
alexrp Aug 28, 2024
f164577
compiler_rt: Export __truncdfhf2() for AEABI too.
alexrp Sep 1, 2024
9007534
std.zig.tokenizer: simplify line-based tokens
ianprime0509 Sep 10, 2024
778519b
Dwarf: fix missing padding before incrementally updated entries
jacobly0 Sep 4, 2024
f34b198
Dwarf: implement and test decls
jacobly0 Sep 5, 2024
6459212
Dwarf: implement and test segmented list
jacobly0 Sep 7, 2024
e046977
codegen: implement output to the `.debug_info` section
jacobly0 Sep 9, 2024
e048e78
Dwarf: implement and test multi array list
jacobly0 Sep 9, 2024
cdaf315
Dwarf: implement variables without runtime bits
jacobly0 Sep 9, 2024
0f01425
Dwarf: implement default field values
jacobly0 Sep 9, 2024
faafc41
Dwarf: prevent crash on missing field inits
jacobly0 Sep 9, 2024
d5a7fcf
Dwarf: implement and test multi array list slices
jacobly0 Sep 10, 2024
6aa6d08
Dwarf: implement and test hash maps
jacobly0 Sep 10, 2024
8ec68c6
Merge pull request #21323 from jacobly0/dwarf-decls
jacobly0 Sep 10, 2024
36b8910
tokenizer: use labeled switch statements
RetroDev256 Sep 10, 2024
2fc1f9b
llvm: Don't use the optimized jump table construction logic for wasm.
alexrp Sep 10, 2024
0e84fed
update zig1.wasm
andrewrk Sep 10, 2024
421fbd9
thread: don't leak the thread in `spawnManager` (#21379)
Rexicon226 Sep 11, 2024
b817823
Merge pull request #21367 from RetroDev256/faster-tokenizer
andrewrk Sep 11, 2024
218cf05
remove explicit ComplexTypeTag from switch
jjwatt Sep 10, 2024
892ce7e
rework fuzzing API
andrewrk Sep 10, 2024
2b76221
libfuzzer: use a function pointer instead of extern
andrewrk Sep 10, 2024
9bc731b
fuzzing: better std.testing.allocator lifetime management
andrewrk Sep 10, 2024
0cdccff
fuzzer: move web files into separate directory
andrewrk Sep 10, 2024
2d00582
make lowest stack an internal libfuzzer detail
andrewrk Sep 10, 2024
9dc75f0
fix init template for new fuzz testing API
andrewrk Sep 10, 2024
4fba733
Merge pull request #21269 from alexrp/soft-float
andrewrk Sep 12, 2024
e3f58bd
add runs per second to fuzzing ui
andrewrk Sep 12, 2024
5cb9668
test: Re-enable a bunch of behavior tests with LLVM.
alexrp Sep 8, 2024
eccd06f
Merge pull request #21370 from ziglang/fuzz
andrewrk Sep 12, 2024
8588964
Replace deprecated default initializations with decl literals
linusg Sep 2, 2024
9271a89
InternPool: Replace default values with a .empty declaration
linusg Sep 11, 2024
b95e0e0
Merge pull request #21339 from alexrp/reenable-tests
andrewrk Sep 12, 2024
0001f91
Merge pull request #21287 from linusg/deprecated-default-init
mlugg Sep 12, 2024
03c3633
AstGen: do not allow unlabeled `break` to exit a labeled switch
mlugg Sep 11, 2024
55250a9
Sema: perform requested coercion when decl literal demoted to enum li…
mlugg Sep 12, 2024
0329b83
make decl literals work with single item pointers
xdBronch Sep 12, 2024
bc16143
riscv: implement `optional_payload_ptr_set`
Rexicon226 Sep 13, 2024
54611e3
Package.Fetch: add another non-standard Content-Type
mlugg Sep 12, 2024
e17dfb9
std.http.WebSocket: Make 'upgrade: websocket' check case-insensitive
linusg Sep 12, 2024
cf69154
Labeled switch documentation (#21383)
LiterallyVoid Sep 13, 2024
b56a667
start: Rewrite arm code to work for thumb1 too.
alexrp Sep 11, 2024
8ddce90
`std.ascii`: make `toLower` `toUpper` branchless (#21369)
CrazyboyQCD Sep 14, 2024
4d81e8e
Merge pull request #21390 from xdBronch/push-tvovpsxztrqn
mlugg Sep 14, 2024
bab6bf4
compiler: always resolve field inits, remove unnecessary eager resolu…
mlugg Sep 15, 2024
8ff2f10
Revert "Dwarf: prevent crash on missing field inits"
mlugg Sep 15, 2024
19924ca
Sema: give `try` operand `error{}` result type in non-errorable funct…
mlugg Sep 15, 2024
258236e
Sema: don't emit instruction when casting @min/@max result to OPV type
mlugg Sep 15, 2024
5d7fa55
std.Build: allow packages to expose arbitrary LazyPaths by name
mlugg Sep 11, 2024
1365be5
compiler: provide correct result types to `+=` and `-=`
mlugg Sep 15, 2024
7f60d2e
riscv: fix up `ptr_elem_val` to not doubly lock
Rexicon226 Sep 15, 2024
a5c9221
Sema: return undefined on comparison of runtime value against undefined
mlugg Sep 15, 2024
f3445f8
Merge pull request #21423 from mlugg/field-init-resolution
mlugg Sep 16, 2024
7caa3d9
Merge pull request #21425 from mlugg/pointer-arith-inplace-res-ty
mlugg Sep 16, 2024
812557b
std: Restore conventional `compareFn` behavior for `binarySearch`
jayschwa Sep 10, 2024
4650e5b
Sema: clean up cmpNumeric
mlugg Sep 17, 2024
41330c9
Merge pull request #21428 from mlugg/compare-to-undef
mlugg Sep 17, 2024
feaee2b
cc: Add support for -Wp,
vesim987 Sep 18, 2024
2111f4c
Sema: mark export on owner nav when exporting function alias
mlugg Sep 18, 2024
72fc164
std.os.linux: Fix tc_oflag_t for PowerPC
linusg Sep 18, 2024
8b82a0e
std.DynamicBitSet: remove wrong and useless comments (#21418)
JJ Sep 20, 2024
dd095e5
cmake: Update to LLVM 19.
alexrp Aug 22, 2024
da8f81c
compiler: Update LLVM/Clang driver files to LLVM/Clang 19.
alexrp Aug 22, 2024
973ebeb
zig_llvm: Update to LLVM 19.
alexrp Aug 23, 2024
41e5acd
zig_clang: Update to Clang 19.
alexrp Aug 23, 2024
f69ff5e
clang: Update options data to Clang 19.
alexrp Aug 23, 2024
dc14434
clang: Update compiler-provided C headers to Clang 19.
alexrp Aug 22, 2024
26ddfab
libunwind: Update to LLVM 19.
alexrp Aug 23, 2024
70a1805
libunwind: Synchronize some CFLAGS/CXXFLAGS with upstream.
alexrp Aug 23, 2024
d13bc04
libcxxabi: Update to LLVM 19.
alexrp Aug 23, 2024
1c8f0b8
libcxx: Update to LLVM 19.
alexrp Aug 23, 2024
9f669df
libcxx: Synchronize some CXXFLAGS with upstream.
alexrp Aug 23, 2024
a4af54b
update_cpu_features: Update for LLVM 19.
alexrp Aug 22, 2024
662683c
update_cpu_features: Fix feature_overrides logic and replace an omit_…
alexrp Aug 30, 2024
da8b7fb
std.Target: Update CPU models/features for LLVM 19.
alexrp Aug 23, 2024
a27f407
llvm: Stop emitting shl/xor ops for constant packed structs.
alexrp Aug 23, 2024
bdae7d9
test: Disable `@bitCast of packed struct containing pointer` temporar…
alexrp Aug 23, 2024
a4d0a01
std.Target: Add bridgeos tag to Os.
alexrp Aug 25, 2024
0082475
Compilation: Synchronize some libcxx CXXFLAGS with upstream.
alexrp Aug 25, 2024
3acf997
link.Wasm.Feature: Update to mirror std.Target.wasm.
Luukdegram Aug 30, 2024
a99c883
test: Update `wasm/infer-features` based on what LLVM produces.
alexrp Aug 30, 2024
9b60aa0
std.zig.system.darwin.macos: Enable Apple M4 CPU detection.
alexrp Aug 30, 2024
2a24c17
test: Re-enable LLVM riscv64 module tests.
alexrp Aug 30, 2024
f8719c4
test: Re-enable `store vector with memset` for LLVM.
alexrp Aug 31, 2024
8c0902b
Revert "tests: skip native CPU std tests on Windows"
alexrp Aug 31, 2024
894b732
Partially revert "LLVM: work around `@floatFromInt` bug"
alexrp Aug 31, 2024
619e8a8
CI: run tests in llvm19 branch
andrewrk Sep 5, 2024
a3a8a26
add missing clang and llvm library listings
andrewrk Sep 5, 2024
c234655
CI: update tarballs to LLVM 19.1.0rc4
andrewrk Sep 5, 2024
3dd6456
cmake: Add a `ZIG2_NO_RTLIB` option for building zig2 without compile…
alexrp Sep 7, 2024
335ed63
ci: Build with `ZIG2_NO_RTLIB` on Windows machines.
alexrp Sep 7, 2024
bc27871
test: Disable `shared_lib_unwind` on `x86_64-macos`.
alexrp Sep 7, 2024
0d7a9c4
CI: update tarballs
andrewrk Sep 10, 2024
6b96c70
clang: Update compiler-provided C headers to Clang 19.1.0.
alexrp Sep 18, 2024
a463c36
libcxx: Update to LLVM 19.1.0.
alexrp Sep 18, 2024
916eaad
std.Target: Update CPU models/features for LLVM 19.1.0.
alexrp Sep 18, 2024
6c15d69
Revert "ci: Build with `ZIG2_NO_RTLIB` on Windows machines."
andrewrk Sep 18, 2024
38af1b7
CI: update tarballs to 0.14.0-dev.1622+2ac543388
andrewrk Sep 18, 2024
cefcf39
compiler_rt: strong linkage when compiling to .c
andrewrk Sep 19, 2024
6294e65
compiler_rt does not need a build_options module
andrewrk Sep 19, 2024
075ec55
disable failing test
andrewrk Sep 20, 2024
c6ad452
Merge branch 'llvm19'
andrewrk Sep 20, 2024
d83a3f1
doc: Bump LLVM version in README
mochalins Sep 20, 2024
7dc9c07
`std.equalRange`: Compute lower and upper bounds
LucasSantos91 Sep 3, 2024
5fad66e
Reuse precomputed bounds.
LucasSantos91 Sep 3, 2024
fdbc31e
Merge branch 'equalRange' of https://github.com/LucasSantos91/buffere…
LucasSantos91 Sep 20, 2024
7ca4ee1
Fixed interpretation of the `Order` returned by the `compareFn`.
LucasSantos91 Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- master
- llvm18
- llvm19
concurrency:
# Cancels pending runs when a PR gets updated.
group: ${{ github.head_ref || github.run_id }}-${{ github.actor }}
Expand Down
14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ else()
set(ZIG_SYSTEM_LIBCXX "stdc++" CACHE STRING "system libcxx name for build.zig")
endif()

find_package(llvm 18)
find_package(clang 18)
find_package(lld 18)
find_package(llvm 19)
find_package(clang 19)
find_package(lld 19)

if(ZIG_STATIC_ZLIB)
if (MSVC)
Expand Down Expand Up @@ -600,6 +600,7 @@ set(ZIG_STAGE2_SOURCES
src/link/Elf.zig
src/link/Elf/Archive.zig
src/link/Elf/Atom.zig
src/link/Elf/AtomList.zig
src/link/Elf/LdScript.zig
src/link/Elf/LinkerDefined.zig
src/link/Elf/Object.zig
Expand Down Expand Up @@ -833,6 +834,11 @@ else()
endif()
endif()

option(ZIG2_NO_RTLIB "Build zig2 without linking to a compiler runtime library (for `zig cc` only)" OFF)
if(ZIG2_NO_RTLIB)
set(ZIG2_LINK_FLAGS "${ZIG2_LINK_FLAGS} -rtlib=none")
endif()

set(ZIG1_WASM_MODULE "${PROJECT_SOURCE_DIR}/stage1/zig1.wasm")
set(ZIG1_C_SOURCE "${PROJECT_BINARY_DIR}/zig1.c")
set(ZIG2_C_SOURCE "${PROJECT_BINARY_DIR}/zig2.c")
Expand Down Expand Up @@ -888,9 +894,7 @@ set(BUILD_COMPILER_RT_ARGS
--name compiler_rt
-femit-bin="${ZIG_COMPILER_RT_C_SOURCE}"
-target "${ZIG_HOST_TARGET_TRIPLE}"
--dep "build_options"
"-Mroot=lib/compiler_rt.zig"
"-Mbuild_options=${ZIG_CONFIG_ZIG_OUT}"
)

add_custom_command(
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Ensure you have the required dependencies:

* CMake >= 3.15
* System C/C++ Toolchain
* LLVM, Clang, LLD development libraries == 18.x
* LLVM, Clang, LLD development libraries == 19.x

Then it is the standard CMake build process:

Expand Down
2 changes: 0 additions & 2 deletions bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,7 @@ int main(int argc, char **argv) {
"-ofmt=c", "-OReleaseSmall",
"--name", "compiler_rt", "-femit-bin=compiler_rt.c",
"-target", host_triple,
"--dep", "build_options",
"-Mroot=lib/compiler_rt.zig",
"-Mbuild_options=config.zig",
NULL,
};
print_and_run(child_argv);
Expand Down
4 changes: 4 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,8 @@ const clang_libs = [_][]const u8{
"clangToolingCore",
"clangExtractAPI",
"clangSupport",
"clangInstallAPI",
"clangAST",
};
const lld_libs = [_][]const u8{
"lldMinGW",
Expand All @@ -1120,6 +1122,7 @@ const llvm_libs = [_][]const u8{
"LLVMTextAPIBinaryReader",
"LLVMCoverage",
"LLVMLineEditor",
"LLVMSandboxIR",
"LLVMXCoreDisassembler",
"LLVMXCoreCodeGen",
"LLVMXCoreDesc",
Expand Down Expand Up @@ -1255,6 +1258,7 @@ const llvm_libs = [_][]const u8{
"LLVMDWARFLinkerParallel",
"LLVMDWARFLinkerClassic",
"LLVMDWARFLinker",
"LLVMCodeGenData",
"LLVMGlobalISel",
"LLVMMIRParser",
"LLVMAsmPrinter",
Expand Down
2 changes: 1 addition & 1 deletion ci/aarch64-linux-debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
ARCH="$(uname -m)"
TARGET="$ARCH-linux-musl"
MCPU="baseline"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.14.0-dev.418+ebd9efa85"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
PREFIX="$HOME/deps/$CACHE_BASENAME"
ZIG="$PREFIX/bin/zig"

Expand Down
2 changes: 1 addition & 1 deletion ci/aarch64-linux-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
ARCH="$(uname -m)"
TARGET="$ARCH-linux-musl"
MCPU="baseline"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.14.0-dev.418+ebd9efa85"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
PREFIX="$HOME/deps/$CACHE_BASENAME"
ZIG="$PREFIX/bin/zig"

Expand Down
2 changes: 1 addition & 1 deletion ci/aarch64-macos-debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -e
ZIGDIR="$PWD"
TARGET="$ARCH-macos-none"
MCPU="baseline"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.13.0-dev.130+98a30acad"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
PREFIX="$HOME/$CACHE_BASENAME"
ZIG="$PREFIX/bin/zig"

Expand Down
2 changes: 1 addition & 1 deletion ci/aarch64-macos-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -e
ZIGDIR="$PWD"
TARGET="$ARCH-macos-none"
MCPU="baseline"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.13.0-dev.130+98a30acad"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
PREFIX="$HOME/$CACHE_BASENAME"
ZIG="$PREFIX/bin/zig"

Expand Down
2 changes: 1 addition & 1 deletion ci/aarch64-windows.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$TARGET = "$($Env:ARCH)-windows-gnu"
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.13.0-dev.130+98a30acad"
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
$MCPU = "baseline"
$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip"
$PREFIX_PATH = "$(Get-Location)\..\$ZIG_LLVM_CLANG_LLD_NAME"
Expand Down
4 changes: 2 additions & 2 deletions ci/x86_64-linux-debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
ARCH="$(uname -m)"
TARGET="$ARCH-linux-musl"
MCPU="baseline"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.14.0-dev.418+ebd9efa85"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
PREFIX="$HOME/deps/$CACHE_BASENAME"
ZIG="$PREFIX/bin/zig"

Expand Down Expand Up @@ -64,7 +64,7 @@ stage3-debug/bin/zig build \

stage3-debug/bin/zig build test docs \
--maxrss 21000000000 \
-Dlldb=$HOME/deps/lldb-zig/Debug-befcd57a8/bin/lldb \
-Dlldb=$HOME/deps/lldb-zig/Debug-4a44163df/bin/lldb \
-fqemu \
-fwasmtime \
-Dstatic-llvm \
Expand Down
4 changes: 2 additions & 2 deletions ci/x86_64-linux-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
ARCH="$(uname -m)"
TARGET="$ARCH-linux-musl"
MCPU="baseline"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.14.0-dev.418+ebd9efa85"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
PREFIX="$HOME/deps/$CACHE_BASENAME"
ZIG="$PREFIX/bin/zig"

Expand Down Expand Up @@ -64,7 +64,7 @@ stage3-release/bin/zig build \

stage3-release/bin/zig build test docs \
--maxrss 21000000000 \
-Dlldb=$HOME/deps/lldb-zig/Release-befcd57a8/bin/lldb \
-Dlldb=$HOME/deps/lldb-zig/Release-4a44163df/bin/lldb \
-fqemu \
-fwasmtime \
-Dstatic-llvm \
Expand Down
2 changes: 1 addition & 1 deletion ci/x86_64-macos-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -e
ZIGDIR="$PWD"
TARGET="$ARCH-macos-none"
MCPU="baseline"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.13.0-dev.130+98a30acad"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
PREFIX="$HOME/$CACHE_BASENAME"
JOBS="-j3"
ZIG="$PREFIX/bin/zig"
Expand Down
2 changes: 1 addition & 1 deletion ci/x86_64-windows-debug.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$TARGET = "$($Env:ARCH)-windows-gnu"
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.13.0-dev.130+98a30acad"
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
$MCPU = "baseline"
$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip"
$PREFIX_PATH = "$($Env:USERPROFILE)\$ZIG_LLVM_CLANG_LLD_NAME"
Expand Down
2 changes: 1 addition & 1 deletion ci/x86_64-windows-release.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$TARGET = "$($Env:ARCH)-windows-gnu"
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.13.0-dev.130+98a30acad"
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
$MCPU = "baseline"
$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip"
$PREFIX_PATH = "$($Env:USERPROFILE)\$ZIG_LLVM_CLANG_LLD_NAME"
Expand Down
10 changes: 6 additions & 4 deletions cmake/Findclang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
if(${LLVM_LINK_MODE} STREQUAL "shared")
find_library(CLANG_LIBRARIES
NAMES
libclang-cpp.so.18
libclang-cpp.so.18.1
clang-cpp-18.0
clang-cpp180
libclang-cpp.so.19
libclang-cpp.so.19.1
clang-cpp-19.0
clang-cpp190
clang-cpp
NAMES_PER_DIR
HINTS "${LLVM_LIBDIRS}"
Expand Down Expand Up @@ -68,6 +68,8 @@ else()
FIND_AND_ADD_CLANG_LIB(clangToolingCore)
FIND_AND_ADD_CLANG_LIB(clangExtractAPI)
FIND_AND_ADD_CLANG_LIB(clangSupport)
FIND_AND_ADD_CLANG_LIB(clangInstallAPI)
FIND_AND_ADD_CLANG_LIB(clangAST)
endif()

if (MSVC)
Expand Down
32 changes: 16 additions & 16 deletions cmake/Findlld.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h
HINTS ${LLVM_INCLUDE_DIRS}
PATHS
/usr/lib/llvm-18/include
/usr/local/llvm180/include
/usr/local/llvm18/include
/usr/local/opt/llvm@18/include
/opt/homebrew/opt/llvm@18/include
/usr/lib/llvm-19/include
/usr/local/llvm190/include
/usr/local/llvm19/include
/usr/local/opt/llvm@19/include
/opt/homebrew/opt/llvm@19/include
/mingw64/include)

find_library(LLD_LIBRARY NAMES lld-18.0 lld180 lld NAMES_PER_DIR
find_library(LLD_LIBRARY NAMES lld-19.0 lld190 lld NAMES_PER_DIR
HINTS ${LLVM_LIBDIRS}
PATHS
/usr/lib/llvm-18/lib
/usr/local/llvm180/lib
/usr/local/llvm18/lib
/usr/local/opt/llvm@18/lib
/opt/homebrew/opt/llvm@18/lib
/usr/lib/llvm-19/lib
/usr/local/llvm190/lib
/usr/local/llvm19/lib
/usr/local/opt/llvm@19/lib
/opt/homebrew/opt/llvm@19/lib
)
if(EXISTS ${LLD_LIBRARY})
set(LLD_LIBRARIES ${LLD_LIBRARY})
Expand All @@ -34,11 +34,11 @@ else()
HINTS ${LLVM_LIBDIRS}
PATHS
${LLD_LIBDIRS}
/usr/lib/llvm-18/lib
/usr/local/llvm180/lib
/usr/local/llvm18/lib
/usr/local/opt/llvm@18/lib
/opt/homebrew/opt/llvm@18/lib
/usr/lib/llvm-19/lib
/usr/local/llvm190/lib
/usr/local/llvm19/lib
/usr/local/opt/llvm@19/lib
/opt/homebrew/opt/llvm@19/lib
/mingw64/lib
/c/msys64/mingw64/lib
c:/msys64/mingw64/lib)
Expand Down
16 changes: 9 additions & 7 deletions cmake/Findllvm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ if(ZIG_USE_LLVM_CONFIG)
# terminate when the right LLVM version is not found.
unset(LLVM_CONFIG_EXE CACHE)
find_program(LLVM_CONFIG_EXE
NAMES llvm-config-18 llvm-config-18.0 llvm-config180 llvm-config18 llvm-config NAMES_PER_DIR
NAMES llvm-config-19 llvm-config-19.0 llvm-config190 llvm-config19 llvm-config NAMES_PER_DIR
PATHS
"/mingw64/bin"
"/c/msys64/mingw64/bin"
"c:/msys64/mingw64/bin"
"C:/Libraries/llvm-18.0.0/bin")
"C:/Libraries/llvm-19.0.0/bin")

if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")
if (NOT LLVM_CONFIG_ERROR_MESSAGES STREQUAL "")
Expand All @@ -40,9 +40,9 @@ if(ZIG_USE_LLVM_CONFIG)
OUTPUT_STRIP_TRAILING_WHITESPACE)

get_filename_component(LLVM_CONFIG_DIR "${LLVM_CONFIG_EXE}" DIRECTORY)
if("${LLVM_CONFIG_VERSION}" VERSION_LESS 18 OR "${LLVM_CONFIG_VERSION}" VERSION_EQUAL 19 OR "${LLVM_CONFIG_VERSION}" VERSION_GREATER 19)
if("${LLVM_CONFIG_VERSION}" VERSION_LESS 19 OR "${LLVM_CONFIG_VERSION}" VERSION_EQUAL 20 OR "${LLVM_CONFIG_VERSION}" VERSION_GREATER 20)
# Save the error message, in case this is the last llvm-config we find
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "expected LLVM 18.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "expected LLVM 19.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")

# Ignore this directory and try the search again
list(APPEND CMAKE_IGNORE_PATH "${LLVM_CONFIG_DIR}")
Expand All @@ -63,12 +63,12 @@ if(ZIG_USE_LLVM_CONFIG)
ERROR_VARIABLE LLVM_CONFIG_ERROR
ERROR_STRIP_TRAILING_WHITESPACE)

if (LLVM_CONFIG_ERROR)
if (LLVM_CONFIG_ERROR)
# Save the error message, in case this is the last llvm-config we find
if (ZIG_SHARED_LLVM)
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 18.x found at ${LLVM_CONFIG_EXE} does not support linking as a shared library")
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 19.x found at ${LLVM_CONFIG_EXE} does not support linking as a shared library")
else()
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 18.x found at ${LLVM_CONFIG_EXE} does not support linking as a static library")
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 19.x found at ${LLVM_CONFIG_EXE} does not support linking as a static library")
endif()

# Ignore this directory and try the search again
Expand Down Expand Up @@ -200,6 +200,7 @@ else()
FIND_AND_ADD_LLVM_LIB(LLVMTextAPIBinaryReader)
FIND_AND_ADD_LLVM_LIB(LLVMCoverage)
FIND_AND_ADD_LLVM_LIB(LLVMLineEditor)
FIND_AND_ADD_LLVM_LIB(LLVMSandboxIR)
FIND_AND_ADD_LLVM_LIB(LLVMXCoreDisassembler)
FIND_AND_ADD_LLVM_LIB(LLVMXCoreCodeGen)
FIND_AND_ADD_LLVM_LIB(LLVMXCoreDesc)
Expand Down Expand Up @@ -335,6 +336,7 @@ else()
FIND_AND_ADD_LLVM_LIB(LLVMDWARFLinkerParallel)
FIND_AND_ADD_LLVM_LIB(LLVMDWARFLinkerClassic)
FIND_AND_ADD_LLVM_LIB(LLVMDWARFLinker)
FIND_AND_ADD_LLVM_LIB(LLVMCodeGenData)
FIND_AND_ADD_LLVM_LIB(LLVMGlobalISel)
FIND_AND_ADD_LLVM_LIB(LLVMMIRParser)
FIND_AND_ADD_LLVM_LIB(LLVMAsmPrinter)
Expand Down
47 changes: 47 additions & 0 deletions doc/langref.html.in
Original file line number Diff line number Diff line change
Expand Up @@ -2495,6 +2495,53 @@ or
</p>
{#code|test_exhaustive_switch.zig#}

{#header_close#}

{#header_open|Labeled switch#}
<p>
When a switch statement is labeled, it can be referenced from a
{#syntax#}break{#endsyntax#} or {#syntax#}continue{#endsyntax#}.
{#syntax#}break{#endsyntax#} will return a value from the {#syntax#}
switch{#endsyntax#}.
</p>
<p>
A {#syntax#}continue{#endsyntax#} targeting a switch must have an
operand. When executed, it will jump to the matching prong, as if the
{#syntax#}switch{#endsyntax#} were executed again with the {#syntax#}
continue{#endsyntax#}'s operand replacing the initial switch value.
</p>

{#code|test_switch_continue.zig#}

<p>
Semantically, this is equivalent to the following loop:
</p>
{#code|test_switch_continue_equivalent.zig#}

<p>
This can improve clarity of (for example) state machines, where the syntax {#syntax#}continue :sw .next_state{#endsyntax#} is unambiguous, explicit, and immediately understandable.
</p>
<p>
However, the motivating example is a switch on each element of an array, where using a single switch can improve clarity and performance:
</p>
{#code|test_switch_dispatch_loop.zig#}

<p>
If the operand to {#syntax#}continue{#endsyntax#} is
{#link|comptime#}-known, then it can be lowered to an unconditional branch
to the relevant case. Such a branch is perfectly predicted, and hence
typically very fast to execute.
</p>

<p>
If the operand is runtime-known, each {#syntax#}continue{#endsyntax#} can
embed a conditional branch inline (ideally through a jump table), which
allows a CPU to predict its target independently of any other prong. A
loop-based lowering would force every branch through the same dispatch
point, hindering branch prediction.
</p>


{#header_close#}

{#header_open|Inline Switch Prongs#}
Expand Down
Loading