Commit Graph

2476 Commits

Author SHA1 Message Date
dweiller 8afafa717f sema: allow slicing *T with comptime known [0..1] 2024-01-14 17:26:45 -08:00
Andrew Kelley 30688c341b LLVM: fix lowering of extern anyopaque
closes #18461
2024-01-11 01:00:49 -08:00
dweiller 69ab687156 test: add tests for switch_block_err_union 2024-01-09 14:42:12 +11:00
Andrew Kelley 3176fdc0b9 Merge pull request #18470 from castholm/typeInfo-sentinels
Make `@typeInfo` return null-terminated strings
2024-01-07 22:28:24 -08:00
Veikka Tuominen faeb0ef032 llvm: optional slices cannot be passed in parts when they allowzero
Closes #18428
2024-01-08 06:57:06 +02:00
Carl Åstholm 92458094c8 Fix failing type reifications 2024-01-07 16:27:50 +01:00
Veikka Tuominen 804cee3b93 categorize behavior/bugs/<issueno>.zig tests 2024-01-06 16:49:41 -08:00
Carl Åstholm 501a2350ab sema: Prevent reifying non-empty union with empty tag type 2024-01-04 22:38:31 +02:00
Andrew Kelley 9a16085093 Merge pull request #18376 from amp-59/shl_exact_comptime_int_to_shl
Sema: Updated `zirShl` to compute `shl_exact` with `comptime_int` LHS using `shl`
2024-01-04 04:19:26 -08:00
Andrew Kelley fc79b22a98 Merge pull request #17431 from castholm/expectEqual
Update `std.testing.expectEqual` and friends to use peer type resolution
2024-01-03 23:55:59 -08:00
Andrew Kelley 52ebba6bdf @shlExact fixups
* Add clarification in langref
* move test case to behavior tests
2024-01-04 00:44:44 -07:00
Andrew Kelley a9337bef2d Merge pull request #18431 from jacobly0/cbe-extern
cbe: fix non-msvc externs and exports
2024-01-03 12:57:01 -08:00
Carl Åstholm 85869f8225 Correct expected/actual parameter order of some assertions 2024-01-03 21:20:49 +01:00
Carl Åstholm d7b36503ca Remove some @as coercions from assertions
These are some spurious fixes to help illustrate the improved ergonomics of the `expectEqual` change. It is by no means complete.
2024-01-03 21:20:48 +01:00
Carl Åstholm 4c1da0912a Fix compile errors from the expectEqual change 2024-01-03 21:20:48 +01:00
xdBronch d03649ec2f add missing resolveStructFieldInits 2024-01-03 11:05:25 +02:00
Jacob Young 047d6d996e cbe: fix non-msvc externs and exports
Closes #17817
2024-01-03 02:52:25 -05:00
Jacob Young 98b633ff17 Reapply "Merge pull request #17824 from kcbanner/fixup_msvc_fmax"
This reverts commit 2b58978360.
2024-01-03 02:41:21 -05:00
Andrew Kelley 289ae45c1b Merge pull request #18160 from ziglang/std-build-module
Move many settings from being per-Compilation to being per-Module
2024-01-02 14:11:27 -08:00
arbrk1 024540de15 Liveness: fix branch operands becoming aliased 2024-01-02 12:08:26 +02:00
Andrew Kelley 142471fcc4 zig build system: change target, compilation, and module APIs
Introduce the concept of "target query" and "resolved target". A target
query is what the user specifies, with some things left to default. A
resolved target has the default things discovered and populated.
In the future, std.zig.CrossTarget will be rename to std.Target.Query.
Introduces `std.Build.resolveTargetQuery` to get from one to the other.

The concept of `main_mod_path` is gone, no longer supported. You have to
put the root source file at the module root now.

* remove deprecated API
* update build.zig for the breaking API changes in this branch
* move std.Build.Step.Compile.BuildId to std.zig.BuildId
* add more options to std.Build.ExecutableOptions, std.Build.ObjectOptions,
  std.Build.SharedLibraryOptions, std.Build.StaticLibraryOptions, and
  std.Build.TestOptions.
* remove `std.Build.constructCMacro`. There is no use for this API.
* deprecate `std.Build.Step.Compile.defineCMacro`. Instead,
  `std.Build.Module.addCMacro` is provided.
  - remove `std.Build.Step.Compile.defineCMacroRaw`.
* deprecate `std.Build.Step.Compile.linkFrameworkNeeded`
  - use `std.Build.Module.linkFramework`
* deprecate `std.Build.Step.Compile.linkFrameworkWeak`
  - use `std.Build.Module.linkFramework`
* move more logic into `std.Build.Module`
* allow `target` and `optimize` to be `null` when creating a Module.
  Along with other fields, those unspecified options will be inherited
  from parent `Module` when inserted into an import table.
* the `target` field of `addExecutable` is now required. pass `b.host`
  to get the host target.
2024-01-01 17:51:18 -07:00
Andrew Kelley 2b58978360 Revert "Merge pull request #17824 from kcbanner/fixup_msvc_fmax"
This reverts commit 7161ed79c4, reversing
changes made to 3f2a65594e.

Unfortunately, this sat in the PR queue too long and the merge broke the
zig1.wasm bootstrap process.
2024-01-01 17:49:57 -07:00
Andrew Kelley 7161ed79c4 Merge pull request #17824 from kcbanner/fixup_msvc_fmax
cbe: add a system for avoiding collisions with C compiler intrinsics
2024-01-01 15:36:16 -08:00
Jacob Young d312665803 Sema: ensure slice_ptr produces the correct type
Closes #18345
2023-12-23 02:08:58 -05:00
Stefan Su 42ddf592dd use casted_rhs instead of rhs so icmp works correctly for airShlSat 2023-12-22 14:51:41 +00:00
Meghan Denny cbf2b1fea4 test: add coverage for index into comptime-known vector is comptime-known 2023-12-22 04:44:15 +02:00
Jacob Young c70c333594 x86_64: fix packed struct field reuse 2023-12-04 13:31:54 -05:00
Jacob Young bdb6546a8f x86_64: fix vector comparisions 2023-12-04 13:09:13 -05:00
Jacob Young 50993a8f08 x86_64: implement more operations on vectors with 1-bit elements 2023-12-04 01:29:07 -05:00
Jacob Young 485e20884c x86_64: implement movement for pointer vectors 2023-12-03 23:07:50 -05:00
Jacob Young 7c85ea65ba x86_64: "implement" aggregate_init for vectors 2023-12-03 13:55:31 -05:00
Jacob Young e00f1397e3 x86_64: implement some todos 2023-12-03 10:24:03 -05:00
Jacob Young 014833b61f x86_64: implement more compliant vectors 2023-12-03 10:22:06 -05:00
Jacob Young 917b4ad5e0 x86_64: implement more atomic ops 2023-12-03 10:22:06 -05:00
Jacob Young bf5ab54510 test: test with -fstrip and fix failures
Closes #17513
2023-12-01 04:34:50 +00:00
David Rubin 1e42a3de89 Remove all usages of std.mem.copy and remove std.mem.set (#18143) 2023-11-29 16:03:02 -05:00
Bogdan Romanyuk 7fbbeae617 value: handle lazy_align and lazy_size in writeToPackedMemory 2023-11-27 12:35:29 +00:00
Bogdan Romanyuk bece97ef24 Sema: ensure tuple fields is resolved and fix internal out-of-bounds access 2023-11-25 14:05:51 +00:00
Tw 2fefc0b5c7 Zir: add missing extra index for linksection_or_addspace
Closes #18052
Closes #18104

Signed-off-by: Tw <tw19881113@gmail.com>
2023-11-25 11:39:37 +00:00
Robin Voetter 28e1d82857 spirv: disable failing tests 2023-11-24 01:11:12 +01:00
Andrew Kelley d5e21a4f1a std: remove meta.trait
In general, I don't like the idea of std.meta.trait, and so I am
providing some guidance by deleting the entire namespace from the
standard library and compiler codebase.

My main criticism is that it's overcomplicated machinery that bloats
compile times and is ultimately unnecessary given the existence of Zig's
strong type system and reference traces.

Users who want this can create a third party package that provides this
functionality.

closes #18051
2023-11-22 13:24:27 -05:00
Andrew Kelley 54d196bb30 Merge pull request #18057 from Vexu/fixes
Fix bad error location on field init with field access
2023-11-21 15:12:03 -05:00
Garrett 40b8c993f5 translate-c: skip blank macros when translating defines 2023-11-21 13:54:46 +00:00
Veikka Tuominen d63298da65 InternPool: handle funcZirBodyInst for func_coerced
Closes #18039
2023-11-21 13:59:14 +02:00
mlugg 9cf6c1ad11 behavior: work around LLVM bug
See #18034
2023-11-19 11:11:50 +00:00
mlugg 3c585730f2 AstGen: preserve result type in comptime block 2023-11-19 11:11:50 +00:00
mlugg 9c16b2370d test: update behavior to silence 'var is never mutated' errors 2023-11-19 09:57:03 +00:00
David 673a1efa22 Sema: include sentinel in type of pointer-to-array ptr field
Resolves: #18007
2023-11-16 16:08:30 +00:00
kcbanner 3fc6a2f113 sema: pass sema through if available for the array_type case in bitSizeAdvanced 2023-11-11 13:11:51 +00:00
Jacob Young 89cac88e91 behavior: add testing for LLVM SROA bugs 2023-11-10 18:04:09 -05:00