2645 Commits

Author SHA1 Message Date
Andrew Kelley
cdc5070f21
Merge remote-tracking branch 'origin/master' into llvm10 2020-02-10 00:26:33 -05:00
Andrew Kelley
014f66e6de Merge pull request #4404 from ziglang/async-std
a big step towards std lib integration with async I/O
2020-02-10 00:22:59 -05:00
Andrew Kelley
27575d19c8
avoid conflict with master branch 2020-02-09 22:44:23 -05:00
Andrew Kelley
acdf4048b4
allow local variable address detection to regress
See #3180 for a more comprehensive plan to catch this problem. More
sophisticated control flow analysis is needed to provide compile errors
for returning local variable addresses from a function.
2020-02-09 22:40:36 -05:00
Andrew Kelley
5ea79bfc4a
fix not checking type of return pointer
Thanks to Vexu for the test cases.

Closes #3422
Closes #3646
Closes #3224
Closes #3327
Closes #3269
2020-02-09 22:34:34 -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
LemonBoy
e3447e67fe riscv64: Enable some more tests
Closes #3338
2020-02-07 17:21:28 +01:00
LemonBoy
8d6536b50c codegen: Use the new frame-pointer fn attributes
no-frame-pointer-elim and no-frame-pointer-elim-non-leaf have been
deprecated for a while in favour of the newer (and clearer)
frame-pointer attribute.

Starting with LLVM10 the old attributes are silently ignored, leading to
no stack traces in debug mode.
2020-02-07 17:08:21 +01:00
Andrew Kelley
80ae434b66
Merge pull request #4397 from LemonBoy/fixes
Fixes
2020-02-05 17:04:40 -05:00
LemonBoy
21932a0ef2 Fix edge case in cast between fn with varargs
* Prevent the next_param_index to become greater than the param_count
  one as it's expected by every other function.
* Fix a typo in a error message.

Closes #4381
2020-02-05 20:31:18 +01:00
Vexu
f196ddd251
translate c type names 2020-02-05 17:52:46 +02:00
Vexu
1f49460dcb
fix regressions in comments and string prefixes 2020-02-05 08:35:30 +02:00
Andrew Kelley
d0b12d7726
Merge remote-tracking branch 'origin/master' into llvm10 2020-02-03 17:30:38 -05:00
Vexu
35c40f0a70
fix regressions 2020-02-02 10:49:51 +02:00
LemonBoy
176bc53858 translate-c: Fix translation of fn pointers
Closes #4332
2020-01-30 21:33:50 -05:00
Andrew Kelley
17c8f108a4
drop @newStackCall
this was causing unrelated behavior tests to fail.

if this commit is reverted, the docs are good, but `@newStackCall` is
already deprecated in favor of `@call`, supplying the `stack` property.
2020-01-30 17:51:55 -05:00
Andrew Kelley
4d2fed6232
zig fmt behavior tests 2020-01-30 16:10:08 -05:00
LemonBoy
979c69d6b2 Amend some failing test cases 2020-01-30 19:53:35 +01:00
LemonBoy
c944865fc7 Generate compilable code for array inits
The compiler still doesn't like too much the newfangled anonymous arrays
so let's use the old-style declarations.

Closes #4181
2020-01-30 19:45:08 +01: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
898ef82d65 Patch in arena to cleanup leaks 2020-01-29 22:22:00 -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
Andrew Kelley
4fad16284e
Merge pull request #4320 from fengb/while-spills
Add async spills to while captured variables
2020-01-29 13:37:58 -05:00
Benjamin Feng
4d134a01f5 Move debug.global_allocator to testing.allocator 2020-01-29 12:21:29 -06:00
LemonBoy
534014f84e translate-c: Handle fn protos wrapped in parenthesis
Closes #4289
2020-01-29 12:06:53 -05:00
Benjamin Feng
9a0a378e2f Add test cases for suspend in while loops 2020-01-29 10:01:51 -06:00
Andrew Kelley
504ce86ac9
fix more compile error test regressions 2020-01-28 14:17:25 -05: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
f41e50dc08
Merge branch 'fx-4274' of https://github.com/LemonBoy/zig into LemonBoy-fix-4274 2020-01-27 09:52:31 -05:00
Andrew Kelley
51ac8eb08e fix regression in windows stack traces tty detection 2020-01-26 18:28:52 -05:00
Andrew Kelley
9dffc369f1
Merge remote-tracking branch 'origin/master' into layneson-cpus_and_features 2020-01-25 23:25:29 -05:00
Feix Weiglhofer
a4a9330648 translate-c: Don't make const parameters mutable. (#4273)
* translate-c: Remove arg-prefix from const parameters.
* translate-c: Add unittest for const parameters.
2020-01-24 15:32:32 -05:00