LemonBoy
6c05f0949a
ir: Fix erroneous error message for ptr casts
...
Don't blindly throw an error if two integer types are checked for
compatibility.
Bug reported in #4430
2020-02-11 17:03:11 +01:00
LemonBoy
f8fd8c481a
test: Skip the atomic-on-fp test for riscv64
2020-02-11 17:03:10 +01:00
Timon Kruiper
2618366055
Add cast between [*c]T and ?[*:0]T on fn parameter
...
Fixes #4176
2020-02-10 19:43:58 -05:00
Andrew Kelley
04ee3b01a1
fix defer interfering with return value spill
2020-02-09 17:19:28 -05:00
Andrew Kelley
24d197b037
solve previous commit a better way
2020-02-08 15:28:12 -05:00
Andrew Kelley
d80db3546c
Revert "properly spill optional payload capture value"
...
This reverts commit 80ba21b83cd13849c1d1d9cdebfa070b03f334d3.
2020-02-08 15:07:12 -05:00
Andrew Kelley
80ba21b83c
properly spill optional payload capture value
2020-02-08 14:59:33 -05:00
Andrew Kelley
884804dbc3
fix async runtime function call resolves target fn frame
2020-02-08 13:45:31 -05:00
Andrew Kelley
877f39d227
fix async function call resolves target fn frame
2020-02-07 22:48:31 -05:00
Andrew Kelley
39ee1f4b97
fix invalid behavior tests from prev commit
...
and fix "no-op casts" from incorrectly spilling
2020-02-07 16:31:52 -05:00
Andrew Kelley
4a60689309
more carefully calculate llvm field indexes
...
more correctly solves #4403
2020-02-07 14:54:58 -05:00
Andrew Kelley
65b1a4953f
Merge pull request #4324 from fengb/testing-allocator
...
Remove debug.global_allocator in favor of testing.allocator
2020-01-30 10:01:40 -05:00
Benjamin Feng
46d84a1b63
Convert a few more page_allocator
2020-01-30 00:27:44 -06:00
Benjamin Feng
b7a236d68e
Convert a bunch of page_allocator to testing.allocator
2020-01-29 22:22:01 -06:00
Benjamin Feng
b077f3ab7d
Promoted "leak_count_allocator" to the main testing.allocator
2020-01-29 22:22:00 -06:00
LemonBoy
fe4ef7b461
Fix comptime float-int comparisons
...
Closes #4259
2020-01-29 16:37:55 -05:00
Benjamin Feng
ffd30dbe28
Fix stage1 test
2020-01-29 15:30:13 -06:00
LemonBoy
59bc1d2721
Fix edge case in switch with single else
...
ir_gen_switch_expr doesn't set the switch_br field at all if there are
zero cases, detect this situation and handle it gracefully.
Closes #4322
2020-01-29 16:05:14 -05:00
Benjamin Feng
aa9caf5064
Create leak_count_allocator
2020-01-29 14:37:01 -06:00
Benjamin Feng
4d134a01f5
Move debug.global_allocator to testing.allocator
2020-01-29 12:21:29 -06:00
Benjamin Feng
9a0a378e2f
Add test cases for suspend in while loops
2020-01-29 10:01:51 -06:00
Andrew Kelley
287d3c37e1
fix 0-bit child type coerced to optional return ptr result location
...
by un-special-casing 0 bit types in result locations
2020-01-28 11:39:36 -05:00
Andrew Kelley
9d59cdb8c1
fix auto created variables not having correct alignment
2020-01-27 19:42:32 -05:00
Andrew Kelley
37ab960492
fix not handling undefined u0 correctly
2020-01-27 18:59:46 -05:00
Andrew Kelley
b38b967844
fix triple level result location with bitcast sandwich
...
...passed as tuple element
2020-01-27 18:26:39 -05:00
Andrew Kelley
c0fee9dfc7
fix nested bitcast passed as tuple element
2020-01-27 17:30:39 -05:00
Andrew Kelley
e2778c03e0
Merge branch 'master' into ir-clean-up-vars
2020-01-27 13:32:39 -05:00
Andrew Kelley
1a08c0d40b
new test case
2020-01-23 00:46:44 -05:00
Andrew Kelley
830e0ba2d2
enable native CPU feature for windows; disable failing tests
...
See #508 . These can be re-enabled when we upgrade to LLVM 10.
2020-01-21 21:46:06 -05:00
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
Andrew Kelley
396d57c498
fix failing array test by improving copy_const_val
2020-01-16 21:58:53 -05:00
Andrew Kelley
8f336b3970
revert one part of ir get_elem_ptr analysis
...
this reverts one part of 4c3bfeca. it solves some behavior regressions
but introduces new ones. This change was incorrect to make however,
and this commit takes the code in a better direction.
2020-01-16 21:58:52 -05:00
Andrew Kelley
6a8c9f7306
fix regression with optionals and globals
2020-01-16 21:58:52 -05:00
Andrew Kelley
b952b84486
relax language requirements regarding else unreachable
2020-01-16 21:58:52 -05:00
Andrew Kelley
8bf425957b
fix regressions double implicit casting return ptr
2020-01-16 21:58:52 -05:00
Andrew Kelley
e48157c3cb
fix regression with inferred struct fields
2020-01-16 21:58:52 -05:00
Andrew Kelley
fb8da16a60
fix regressions in get_elem_ptr related to undefined
2020-01-16 21:58:52 -05:00
Andrew Kelley
d0b055d69e
fix implicit cast regression
2020-01-16 21:58:52 -05:00
Andrew Kelley
96d64a40a6
fix regression with var ptrs not being const
2020-01-16 21:58:52 -05:00
Andrew Kelley
b6c8fead00
fix regression in global const alignment
2020-01-16 21:58:51 -05:00
Andrew Kelley
fbcee58cfc
zig ir.cpp details: remove the mem_slot mechanism
...
Previously, there was hacky code to deal with result locations and how
they work with regards to comptime values and runtime values. In
addition, there was a hacky "mem_slot" mechanism that managed the memory
for local variables, and acted differently depending on comptime vs
runtime situations. All that is deleted in this commit, and as a result,
result locations code has one less complication.
Importantly, this means that a comptime result location is now passed to
a function when it is evaluated at comptime.
This test causes many regressions, and some of the behavior tests are
disabled (commented out) in this commit. Future commits will re-enable
the tests before merging the branch.
2020-01-16 21:58:47 -05: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