LemonBoy
eb7d36ae0d
Make single-element enum default to u0
...
* Allow comptime_int as explicit enum tag type
Closes #2997
2019-09-13 15:13:10 -04:00
Andrew Kelley
0eddee449d
add behavior test for @enumToInt(enum(u1){x}.x)
...
closes #2737
2019-09-11 15:05:00 -04:00
LemonBoy
8fbae77770
Force LLVM to generate byte-aligned packed unions
...
Sometimes the frontend and LLVM would disagree on the ABI alignment of a
packed union. Solve the problem by telling LLVM we're gonna manage the
struct layout by ourselves.
Closes #3184
2019-09-10 10:07:32 -04:00
Andrew Kelley
852679c369
fix a var decl in scope preventing for loop spills
2019-09-09 16:44:23 -04:00
Andrew Kelley
a3993465fe
Merge pull request #3200 from LemonBoy/eq-tagged-union
...
Allow comparison between union tag and enum literal
2019-09-09 16:17:45 -04:00
Andrew Kelley
f50bfb94b5
fix bad LLVM IR when for target expr needs to be spilled
...
Also reduce the size of ZigVar in memory by making the name
a `const char *` rather than a `Buf`.
2019-09-09 15:59:16 -04:00
LemonBoy
4b1cd45472
Comptime folding of enum/union comparisons
2019-09-09 19:09:56 +02:00
LemonBoy
cc63760587
Allow comparison between union tag and enum literal
...
Closes #2810
2019-09-09 18:51:13 +02:00
Andrew Kelley
f7721ac37c
implement spilling when returning error union async function call
...
closes #3190
2019-09-09 12:15:39 -04:00
Andrew Kelley
229323e13a
fix suspensions inside for loops generating invalid LLVM IR
...
closes #3076
2019-09-07 17:37:17 -04:00
Andrew Kelley
9a18db8a80
properly spill expressions with async function calls
2019-09-07 00:27:45 -04:00
Andrew Kelley
d1a98ccff4
implement spills when expressions used across suspend points
...
closes #3077
2019-09-07 00:13:12 -04:00
Andrew Kelley
9ca8d9e21a
fix await used in an expression generating bad LLVM
2019-09-07 00:13:12 -04:00
Andrew Kelley
0a3c6dbda9
implement noasync function calls
...
See #3157
2019-09-05 21:55:32 -04:00
Andrew Kelley
2045b4d932
prefer result type casting to peer type resolution
...
See #2749
2019-09-05 14:56:52 -04:00
LemonBoy
8e3c56b912
Always resolve the struct field types
...
Packed structs used to skip the zero-sized types and trip some
assertions that expected the type reference not to be null.
Fixes #3143
2019-09-05 13:07:04 -04:00
LemonBoy
0107b19124
Resolve lazy values when checking for definedness
...
Fixes #3154
2019-09-05 13:09:43 -04:00
Jonathan Marler
9a358d2d33
Add Array support to @Type
2019-09-05 13:08:45 -04:00
Timon Kruiper
e540e5b8ec
Implicit cast from enum literal to optional enum and implicit cast to payload of error union
2019-09-04 12:30:23 -04:00
Andrew Kelley
ac7703f65f
fixups and add documentation for @Type
2019-09-04 11:12:14 -04:00
Jonathan Marler
b728cb6d4e
Add @Type builtin
2019-09-03 22:50:29 -06:00
Andrew Kelley
a81e4351a2
Merge branch 'fixSegfault' of https://github.com/marler8997/zig into marler8997-fixSegfault
2019-09-03 18:15:01 -04:00
Andrew Kelley
be17a4b6c1
fix compiler crash in struct field pointers
...
when the llvm type has not been fully analyzed. This is a regression
from lazy values.
2019-09-03 14:51:34 -04:00
Andrew Kelley
4a5b0cde13
fix const result loc, runtime if cond, else unreachable
...
Closes #2791 . See that issue for more details; I documented the
debugging process quite thoroughly on this one.
2019-09-02 20:28:25 -04:00
Andrew Kelley
ab4cba14c8
fix recursive call of await @asyncCall with struct return type
2019-09-02 14:35:41 -04:00
Andrew Kelley
d291d3c8c0
fix using @typeOf on a generic function call
2019-09-02 13:07:44 -04:00
Andrew Kelley
0c4d47c6d5
add regression test for already fixed bug
...
closes #2692
2019-09-01 23:35:58 -04:00
Andrew Kelley
ec6f15b0f5
fix @typeOf an async function call of generic fn with error union type
2019-09-01 00:27:22 -04:00
Andrew Kelley
5c3a9a1a3e
improvements to @asyncCall
...
* `await @asyncCall` generates better code. See #3065
* `@asyncCall` works with a real `@Frame(func)` in addition to
a byte slice. Closes #3072
* `@asyncCall` allows passing `{}` (a void value) as the result
pointer, which uses the result location inside the frame.
Closes #3068
* support `await @asyncCall` on a non-async function. This is in
preparation for safe recursion (#1006 ).
2019-08-31 18:50:16 -04:00
Andrew Kelley
a223063923
@typeOf now guarantees no runtime side effects
...
related: #1627
2019-08-31 11:00:31 -04:00
Andrew Kelley
6ab8b2aab4
support recursive async and non-async functions
...
which heap allocate their own frames
related: #1006
2019-08-30 20:06:02 -04:00
Andrew Kelley
d9fed5cdfd
align(@alignOf(T)) T does not force resolution of T
2019-08-30 14:53:44 -04:00
Andrew Kelley
03910925f0
await does not force async if callee is blocking
...
closes #3067
2019-08-29 21:51:37 -04:00
Andrew Kelley
0512beca9d
comparing against zero participates in lazy values
2019-08-29 14:46:22 -04:00
Andrew Kelley
af90da1531
fix implicit cast from zero sized array ptr to slice
...
closes #1850
2019-08-28 12:16:52 -04:00
Andrew Kelley
7139eef4cf
implement lazy values for error union types
...
closes #3129
2019-08-28 11:17:20 -04:00
Andrew Kelley
47fcbfdc51
add regression test for already fixed bug
...
closes #3112
2019-08-27 17:39:06 -04:00
Andrew Kelley
f4519c520a
support self-referential struct through a slice of optional
...
by making optionals even more lazy
closes #1805
2019-08-27 16:55:58 -04:00
Andrew Kelley
c1fd7ed6e2
add regression test for struct with optional list of self
...
closes #1735
2019-08-27 14:06:17 -04:00
Andrew Kelley
e1b258f39f
add regression test for bug fixed by lazy values
...
closes #624
2019-08-27 13:44:04 -04:00
Andrew Kelley
8fef23a525
add regression test for bug fixed by lazy values
...
closes #1310
2019-08-27 13:36:42 -04:00
Andrew Kelley
ffac0b02e7
implement and test struct field explicit alignment
2019-08-27 10:14:11 -04:00
Andrew Kelley
ae65c236c5
fix regression with global variable assignment...
...
...with optional unwrapping with var initialized to undefined
2019-08-26 15:24:24 -04:00
Jonathan Marler
1b19c28c79
Fix issue 3058: zig build segfault
2019-08-24 10:47:27 -06:00
Marc Tiehuis
2aa18b9097
Merge pull request #3090 from ziglang/fmt-internal
...
fmt changes
2019-08-19 19:48:05 -10:00
Andrew Kelley
3dbed54294
fix @bitCast of packed struct literal
...
closes #3042
2019-08-19 17:50:37 -04:00
Andrew Kelley
6bc520ab95
solve it a slightly different way
...
the error handling of result locations is a bit awkward but it should
basically be the same everywhere
2019-08-19 17:35:19 -04:00
Michael Dusan
24deb1a7fe
fix @bitCast segfault with literal array param
...
closes #3010
2019-08-19 17:24:14 -04:00
Andrew Kelley
d067a037cc
fix void array as a local variable initializer
...
Related: #1767
2019-08-19 15:58:31 -04:00
Andrew Kelley
44fb5275c1
fix array multiplication not setting parent value info
...
closes #3095
2019-08-19 14:46:12 -04:00