Commit Graph

457 Commits

Author SHA1 Message Date
Andrew Kelley
7bb4c855ad
Merge pull request #4222 from LemonBoy/eutwouwth
Prevent crash with empty non-exhaustive enum
2020-01-18 19:25:23 -05:00
LemonBoy
b0f753e21d Fix edge case in tagName handling of unions
Closes #4226
2020-01-18 20:16:15 +01:00
LemonBoy
c53d94e512 Prevent crash with empty non-exhaustive enum 2020-01-18 15:13:21 +01:00
LemonBoy
5f2bac010d Allow @tagName on enum literals
Closes #4214
2020-01-18 09:55:18 +01:00
Andrew Kelley
b5ac079f88
Merge pull request #4191 from Vexu/non-exhaustive-enums
Implement non-exhaustive enums
2020-01-17 14:26:12 -05:00
Vexu
39f92a9ee4
improve behavior test 2020-01-17 09:50:20 +02:00
Vexu
6c8f01dcde
correct field count 2020-01-16 22:52:10 +02:00
Vexu
bac27731e3 add struct field default value to typeinfo 2020-01-16 13:22:30 -05:00
Vexu
df03fcf5f0 implement @bitSizeOf 2020-01-16 13:13:45 -05:00
Vexu
c57784aa15
add is_exhaustive field to typeinfo 2020-01-15 21:50:12 +02:00
Vexu
b971c7d0ff
update tests and translate-c 2020-01-15 20:58:42 +02:00
LemonBoy
505b9db909 Fix codegen error for some union initializers
Closes #3377
2020-01-14 14:57:03 -05:00
LemonBoy
50754ba336 Fix ICE when BoundFn are passed as parameters
Closes #4022
Closes #3699
2020-01-14 13:09:23 -05:00
LemonBoy
cae93c860b Allow switching on pointer types
Closes #4074
2020-01-13 22:18:49 +01:00
LemonBoy
34cdcb13c0 Fix @call being too eager to resolve the fn argument
Closes #4020
2020-01-12 23:51:18 +01:00
Andrew Kelley
5e345ff0ee
Merge pull request #3955 from LemonBoy/fix-1528
Pointer arithmetic affects the alignment factor
2020-01-09 13:53:56 -05:00
LemonBoy
5ab5de89c0 New @export() handling
Use a struct as second parameter to be future proof (and also allows to
specify default values for the parameters)

Closes #2679 as it was just a matter of a few lines of code.
2020-01-09 13:43:06 -05:00
LemonBoy
c51b79c56e Correct alignment calculation for runtime addends 2020-01-09 11:56:45 +01:00
LemonBoy
7ea7842ed0 Fix calculation of new alignment factor 2020-01-08 21:02:05 +01:00
LemonBoy
e134e6c994 Pointer arithmetic affects the alignment factor
Closes #1528
2020-01-08 20:03:03 +01:00
LemonBoy
2a5c622e65 Fix crash with unresolved loc
Fixes #4099
2020-01-07 18:16:17 -05:00
Andrew Kelley
3b5c71d2a5
fix regression with @TypeInfo 2020-01-06 17:13:45 -05:00
Andrew Kelley
53913acaf7
zig fmt and update extern fn to callconv(.C) 2020-01-06 15:34:50 -05:00
Andrew Kelley
0a9daeb37e
Merge branch 'cc-work' of https://github.com/LemonBoy/zig into LemonBoy-cc-work 2020-01-06 14:07:56 -05:00
Andrew Kelley
c30106c906
add test case to cover already-solved bug
closes #2401
2020-01-05 17:42:03 -05:00
LemonBoy
b91eaba38c Correct evaluation of optional type alignment
The lazy logic was too oversimplified and produced a different result
than the one computed later causing all kinds of problems.

Closes #4013
2020-01-03 17:41:55 -05:00
Andrew Kelley
a90fa45ae1
Merge pull request #4027 from ziglang/fix-float-ops
fix float ops with respect to vectors
2020-01-02 16:10:41 -05:00
Andrew Kelley
213ff939f1
fix comptime vector float ops and add test coverage
also rename `@ln` to `@log` to match libc convention.
2020-01-02 14:01:48 -05:00
LemonBoy
563d9ebfe5 Implement the callconv() annotation 2020-01-02 18:53:16 +01:00
LemonBoy
1e61e5f404 Don't ptrCast a result-location assignment to _
After #4010 doing `_ = @bitCast(...)` triggered a nonsensical compiler
error.
2020-01-02 10:41:11 -05:00
Andrew Kelley
cb56b26900
fix float ops with respect to vectors
also remove the redundant type parameter
2020-01-01 23:27:43 -05:00
Vexu
1b64a5f5f0 fix segfault in bit shift safety check 2020-01-01 13:11:42 -05:00
Andrew Kelley
73e535e112
Merge pull request #3683 from Vexu/atomic-float
Support floats with some atomic operations
2019-12-30 19:19:05 -05:00
Andrew Kelley
a05150e92d
fix comparing comptime_int against undefined literal
closes #4004
2019-12-30 19:08:57 -05:00
LemonBoy
28a8ded95a Resolve more types as needed
Closes #3994
2019-12-30 17:45:09 -05:00
Vexu
2252951066
disable test on arm 2019-12-23 11:55:00 +02:00
Vexu
8bb1e04449
support some atomic operations with floats 2019-12-23 11:54:47 +02:00
Andrew Kelley
290dc5d95b
zig fmt support for slice sentinel syntax 2019-12-21 14:03:36 -05:00
LemonBoy
51cbd96820 Fix sentinel value of opaque pointers in typeInfo
Fixes #3888
2019-12-20 15:48:34 -05:00
LemonBoy
f077c3c4cc Fix comptime evaluation of runtime array access
Fix #3951
2019-12-20 15:47:43 -05:00
LemonBoy
d8499f7abe Make sure the fields array is always non-null
Fixes #3497
2019-12-17 15:45:22 -05:00
Andrew Kelley
1cad0acc7e
add behavior test for vector comparison 2019-12-16 11:22:28 -05:00
Vexu
0f38410ea6
improve extern enum 2019-12-15 19:28:53 -05:00
LemonBoy
59de23dfa0 Don't assume TLS storage has a fixed address
Fixes #3433
2019-12-15 16:23:42 -05:00
LemonBoy
19ddbd9e9e Make sure the address is aligned for intToPtr ops
Closes #773
2019-12-15 14:41:05 -05:00
Andrew Kelley
e54c49be9b
uncomment a now-passing behavior test 2019-12-12 19:45:33 -05:00
Robin Voetter
4b4fbe3887
Replace @typeOf with @TypeOf in all zig source
This change was mostly made with `zig fmt` and this also modified some whitespace. Note that in some files, `zig fmt` produced incorrect code, so the change was made manually.
2019-12-10 11:09:41 -05:00
Andrew Kelley
a3f6a58c77
remove var args from the language
closes #208
2019-12-09 15:27:27 -05:00
Andrew Kelley
f205d23e65
implement async function call with @call
this removes the last usage of var args in zig std lib
2019-12-09 15:27:26 -05:00
Andrew Kelley
69b587c1d3
add regression cases for now-passing tests
closes #2749
2019-12-09 15:23:51 -05:00