Cody Tapscott
77720e30aa
Re-factor: Change AstGen.ResultLoc to be a struct
...
This re-factor is intended to make it easier to track what kind of
operator/expression consumes a result location, without overloading the
ResultLoc union for this purpose.
This is used in the following commit to keep track of initializer
expressions of `const` variables to avoid popping error traces
pre-maturely. Hopefully this will also be useful for implementing
RLS temporaries in the future.
2022-10-21 11:22:46 -07:00
Veikka Tuominen
972c39e2c0
Merge pull request #13219 from Vexu/stage2-fixes
...
Stage2 bug fixes
2022-10-21 12:11:49 +02:00
Veikka Tuominen
ce95cc170b
Value: handle runtime_int in hashPtr
...
Closes #12702
2022-10-20 20:11:12 +03:00
Veikka Tuominen
9a52abf3b4
Sema: add missing calls to wip_captures.finalize
...
Closes #13171
2022-10-20 20:11:12 +03:00
Veikka Tuominen
3b60a6de2f
Sema: fix using runtime instructions inside typeof in comptime only blocks
...
Closes #13210
Follow up to 3ccd4907fbcd04ecddffb618a4b14581fd080279
2022-10-20 20:11:12 +03:00
Veikka Tuominen
34e4b07d0c
Sema: allow runtime only instructions to be emitted in outside functions
...
It is possible to get comptime-known values from runtime-known values
for example the length of array. Allowing runtime only instructions to
be emitted outside function bodies allows these operations to happen.
In places where comptime-known values are required we have other methods
to ensure that and they usually result in more specific compile errors too.
Closes #12240
2022-10-20 20:11:00 +03:00
Veikka Tuominen
13897be0ab
Type: bitSizeOf non-packed structs should include padding
...
Closes #13214
2022-10-20 20:11:00 +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
Andrew Kelley
b120c819db
Merge pull request #13055 from alichraghi/m2m
...
all: rename `@maximum` to `@max` and `@minimum` to `@min`
2022-10-18 14:42:55 -04:00
Andrew Kelley
7c7d9e13d7
Sema: fix runtime int to enum with one possible value
2022-10-18 10:18:09 -07:00
Jacob Young
687a7d38a0
value: implement Value.eqlAdvanced on slices
...
* Support comparison between implicitly casted array pointer and slice.
* Support comparison between slices with different value tags.
Closes #12700
2022-10-18 14:16:39 +02:00
Ali Chraghi
ca27055cda
all: rename @maximum to @max and @minimum to @min
2022-10-18 14:15:16 +03:00
GethDW
edc842ff18
stage2: implement packedStuctToInt for more types
2022-10-18 14:05:48 +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
34863224c3
Re-enable mulAdd f128 tests on i386-linux
2022-10-13 12:53:30 -07:00
Cody Tapscott
1e278131e3
Re-enable @mulAdd f128 tests on aarch64-darwin
...
Closes #9900
2022-10-13 12:53:29 -07:00
Cody Tapscott
f035437b5d
Re-enable Vector f16 tests on Windows
...
Closes #4952
2022-10-13 12:53:20 -07: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
Andrew Kelley
7ce1ee1bce
Merge pull request #13081 from r00ster91/docs
...
fix(text): hyphenation and other fixes
2022-10-12 05:26:11 -04:00
Luuk de Gram
1f196b9e2f
stage2: implement exporting using field access ( #13136 )
...
This implements `@export(a.b, .{..});` in semantic analysis,
allowing users to directly export a variable from a namespace.
* add test case for exporting using field access
2022-10-12 04:38:07 -04: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
b316c25cc6
Merge pull request #13075 from Vexu/stage2-fixes
...
Stage2 misc fixes
2022-10-10 23:27:17 +02:00
Veikka Tuominen
b5c0a797a7
Sema: inline switch capture needs to be set when switch operand is comptime known
2022-10-08 16:58:52 +03:00
Veikka Tuominen
4a6cc1c602
Sema: allow equality comparisons between error unions and error sets
...
Closes #1302
2022-10-07 11:04:02 +03:00
Veikka Tuominen
446deb31a8
Sema: validate bitSizeOf operand type
...
Closes #13080
2022-10-06 20:09:45 +03:00
Veikka Tuominen
0b1dd845d9
stage2: add error for non-void error union payload being ignored
...
See https://github.com/ziglang/zig/pull/6060#discussion_r471032912
2022-10-06 15:39:06 +03:00
Veikka Tuominen
b626977f45
Sema: create sub block for inline loops
...
Closes #13038
2022-10-06 15:39:06 +03:00
r00ster91
8e2aaf6aed
fix(text): hyphenate "runtime" adjectives
2022-10-05 21:33:42 +02:00
r00ster91
51d9db8569
fix(text): hyphenate "comptime" adjectives
2022-10-05 21:19:30 +02:00
r00ster91
654e0b6679
fix(text): hyphenation and other fixes
2022-10-05 21:19:10 +02:00
Veikka Tuominen
ba4aa12098
Sema: use correct value when @ptrCast operand is comptime known
...
Closes #13034
2022-10-05 17:26:29 +03: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
Veikka Tuominen
409cf4aeb8
Sema: use correct ptr ty to check for attributes of slice field ptr
...
Closes #12870
Closes #13006
2022-09-30 00:09:24 +03:00
kkHAIKE
317cb629fb
Sema: fix resolveInferredErrorSet panic when generic inline function
2022-09-29 14:44:37 +03:00
Veikka Tuominen
83fa216c8d
Sema: implement inline else for ints
2022-09-27 18:33:23 +03:00
Veikka Tuominen
950a0e2405
Sema: implement inline else for errors enums and bools
2022-09-27 18:33:23 +03:00
Veikka Tuominen
0e77259f44
add inline switch union tag captures
2022-09-27 18:33:23 +03:00
Veikka Tuominen
5baaf90e3c
Sema: implement non-special inline switch prongs
2022-09-27 18:33:23 +03:00
Veikka Tuominen
c4400e8aa5
AstGen: reset anon_name_strategy for sub expressions
...
Closes #12910
2022-09-24 16:30:37 +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
3525b8778e
Sema: properly handle generic struct as parameter type
...
Closes #12907
2022-09-24 14:43:03 +03:00