Andrew Kelley
af958e95cc
Merge pull request #13744 from Vexu/stage2-fixes
...
Improve error messages, fix dependency loops
2023-01-09 14:55:12 -07:00
Andrew Kelley
48798da29b
Merge pull request #13074 from topolarity/stage2-opt
...
stage2: Miscellaneous fixes to vector arithmetic and copy elision
2023-01-09 13:59:04 -07:00
Micah Switzer
8d95b713c5
Sema: resolve lazy align in zirReify for union fields
...
Closes #13435
2023-01-09 13:48:15 -07:00
Jacob Young
48a2783969
cbe: implement optional slice representation change
2022-10-29 05:58:41 -04:00
Veikka Tuominen
4ac8ec4c5c
AstGen: fix refing inferred allocs
...
Closes #13285
2022-10-27 01:31:18 +03:00
Veikka Tuominen
78a7bb108a
llvm: handle namespace like packed structs
...
Closes #13159
Closes #13188
2022-10-27 01:31:18 +03:00
Jacob Young
45c667eb21
behavior: fix redefined exports
2022-10-25 05:11:28 -04:00
Veikka Tuominen
9a52abf3b4
Sema: add missing calls to wip_captures.finalize
...
Closes #13171
2022-10-20 20:11:12 +03:00
Veikka Tuominen
4aaff75c81
Sema: resolve tuple default values before hashing
...
Closes #12488
2022-10-19 01:38:19 +03:00
Veikka Tuominen
6582896ee0
Sema: remove unresolved inferred allocs
...
Closes #2557
2022-10-19 01:38:19 +03:00
Veikka Tuominen
4e134f6dcb
Sema: respect inline call semantics
...
If an argument is comptime-known but shouldn't be create an alloc
to store it in to get a runtime-known value.
2022-10-19 01:38:18 +03:00
Veikka Tuominen
be9a4a1f97
Sema: handle noreturn in boolBr
...
Closes #13112
2022-10-17 18:53:15 +03:00
Jacob Young
cb0e22db4e
llvm: fix lowering of runtime refs to comptime-only decls
...
When we want a runtime pointer to a zero-bit value we use an undef
pointer, but what if we want a runtime pointer to a comptime-only value?
Normally, if `T` is a comptime-only type such as `*const comptime_int`,
then `*const T` would also be a comptime-only type, so anything
referencing a comptime-only value is usually also comptime-only, and
therefore not emitted to the executable.
However, what if instead we have a `*const anyopaque` pointing to a
comptime-only value? Certainly, `*const anyopaque` is a runtime type,
and so we need some runtime value to store, even when it happens to be
pointing to a comptime-only value. In this case we want to do the same
thing as we do when pointing to a zero-bit value, so we use
`hasRuntimeBits` to handle both cases instead of ignoring comptime.
Closes #12025
2022-10-15 14:17:25 -04:00
Jacob Young
400319872b
llvm: fix bug lowering aggregate_init with a byref sentinel
...
Closes #12972
2022-10-15 11:12:04 -04:00
Cody Tapscott
83e2d3fb37
stage1: Skip new tests that never passed in stage1
...
This gets the behavior tests passing for stage1 again.
2022-10-13 12:53:20 -07:00
kkHAIKE
d987bf859e
Sema: add float128IntPartToBigInt to fix compare comptime float with int
2022-10-13 13:11:13 +02:00
jacobly0
562ac8be48
codegen: add support for lowering .field_ptr on a slice
...
Closes #13068
2022-10-12 12:40:59 +03:00
Cody Tapscott
e6ebdcb82e
stage2 LLVM: Use a packed aggregate for union payload init
...
Without the packed qualifier, the type layout that we use to
initialize doesn't match the correct layout of the underlying
storage, causing corrupted data and past-the-end writes.
2022-10-11 15:42:01 -04:00
Veikka Tuominen
40578656e8
Zir: handle ranges in getMultiProng
...
Closes #12890
2022-10-05 17:26:29 +03:00
Andrew Kelley
ff534d2267
Merge pull request #12979 from Vexu/inline-switch
...
Implement inline switch cases
2022-10-03 23:43:09 -04:00
Veikka Tuominen
2a4e89e0c9
Type: correctly handle ABI align strat for optionals and error unions
...
Closes #12984
2022-09-30 00:46:45 +03:00
kkHAIKE
317cb629fb
Sema: fix resolveInferredErrorSet panic when generic inline function
2022-09-29 14:44:37 +03:00
Veikka Tuominen
5baaf90e3c
Sema: implement non-special inline switch prongs
2022-09-27 18:33:23 +03:00
Veikka Tuominen
8e4d0ae4f5
Sema: avoid generic parameter error in nested function type
...
Related to cd1833044ab7505bc101c85f59889bd3ea3fac80
Closes #12945
2022-09-24 15:15:36 +03:00
Veikka Tuominen
3a5148112d
Sema: avoid using pointerDecl when dealing with slices
...
Closes #12885
2022-09-24 14:43:03 +03:00
Veikka Tuominen
ede3798485
Sema: resolve struct layout in zirStructInit
...
Closes #12911
2022-09-23 17:39:21 +03:00
Veikka Tuominen
8d1fdfc8ed
Sema: preserve volatileness when constructing field pointers
...
Closes #12928
2022-09-23 17:39:06 +03:00
kkHAIKE
183127733c
AstGen: make loop body's ResultLoc .none
...
Fixes #12555
Fixes #12551
Fixes #12455
2022-09-21 20:20:05 +03:00
Veikka Tuominen
5e4483fff8
Sema: handle comptime fields in field call bind
...
Closes #12801
2022-09-15 00:50:18 +03:00
Veikka Tuominen
930f904aaa
Sema: resolve lazy align in reifyStruct
...
Closes #12786
2022-09-15 00:48:47 +03:00
Veikka Tuominen
de24cea2cf
Sema: handle empty_struct_value in beginComptimePtrMutation
...
Closes #12794
2022-09-15 00:48:47 +03:00
Veikka Tuominen
c7e45aebaf
llvm: handle pointers in packed structs in more places
...
Closes #12776
2022-09-08 12:51:40 +03:00
riChar
349cf54b32
llvm: fix the type parameter of GlobalAlias
...
Closes 12680
2022-09-04 18:44:45 +03:00
martinhath
3fa5415253
Sema: ensure resolveTypeFields is called for optional and error union types
...
We call `sema.resolveTypeFields` in order to get the fields of structs
and unions inserted into their data structures. If it isn't called, it
can happen that the fields of a type is queried before those fields are
inserted into (for instance) `Module.Union.fields`, which would result in
a wrong 'no field named' error.
Fixes : #12486
2022-08-26 11:37:17 +03:00
Andrew Kelley
7453f56e67
stage2: explicitly tagged enums no longer have one possible value
...
Previously, Zig had inconsistent semantics for an enum like this:
`enum(u8){zero = 0}`
Although in theory this can only hold one possible value, the tag
`zero`, Zig no longer will treat the type this way. It will do loads and
stores, as if the type has runtime bits.
Closes #12619
Tests passed locally:
* test-behavior
* test-cases
2022-08-24 22:20:31 -07:00
Veikka Tuominen
233049503a
Sema: allow empty enums and unions
2022-08-17 23:03:04 +03:00
Cody Tapscott
7e07f3d4f9
stage2 astgen: Use rl semantics for @Type
...
Resolves #12430 .
2022-08-13 09:22:25 +03:00
Isaac Freund
0d32b73078
stage2: Implement explicit backing integers for packed structs
...
Now the backing integer of a packed struct type may be explicitly
specified with e.g. `packed struct(u32) { ... }`.
2022-08-10 19:54:45 +02:00
Meghan Denny
0879cbeed2
remove 'builtin.stage2_arch', Sema is smart enough now
2022-08-07 16:07:08 -07:00
Andrew Kelley
6a3a0fe7ae
Merge remote-tracking branch 'origin/master' into llvm14
2022-07-07 18:25:01 -07:00
Cody Tapscott
cbc85f4516
stage1: Fix seg-fault when slicing string literal with sentinel
2022-07-08 02:14:38 +03:00
Andrew Kelley
9a5c7b4b4d
Merge remote-tracking branch 'origin/master' into llvm14
2022-07-05 16:24:18 -07:00
Andrew Kelley
e8ce1728e9
disable regressed wasm32 behavior tests from LLVM 14
2022-07-05 15:46:12 -07:00
Cody Tapscott
86570b3e2c
stage2: Fix corrupted Type when de-referencing field pointer
2022-07-05 15:02:13 -04:00
Andrew Kelley
434226c89d
stage2: fix type printing of sub-byte pointers
2022-06-08 15:18:43 -07:00
Andrew Kelley
4994ac18e4
Merge pull request #11733 from Vexu/stage2
...
more misc stage2 fixes
2022-05-27 16:20:49 -04:00
Veikka Tuominen
989c0f55e8
stage2: add test for fixed issue
2022-05-27 10:29:24 +03:00
Andrew Kelley
4751356d7f
clean up some behavior tests
...
* improve names
* properly categorize a couple of bug cases
* mark one as already passing
2022-05-26 21:58:19 -07:00
Jakub Konka
8d5acf7693
test: recursively walk dir with tests
...
Prune incremental tests by moving non-incremental behavior tests to
behavior test suite instead.
2022-04-28 18:35:01 +02:00
Andrew Kelley
cf20b97b71
Merge pull request #11279 from igor84/s1_packed_struct
...
stage1: Fix packed structs (#2627 , #10104 )
2022-04-22 11:39:12 -04:00