Andrew Kelley
30194f27fb
update new test case to take into account lazy @typeInfo
2020-02-18 18:27:18 -05:00
LemonBoy
a6b74cdd38
stage1: Make the parser reject extern fn with body
2020-02-18 18:18:29 -05:00
Andrew Kelley
ccca4b5a5e
Merge pull request #4474 from LemonBoy/saukerkraut
...
Patches
2020-02-18 18:15:11 -05:00
Andrew Kelley
dd58278dbe
add behavior test for previous commit
2020-02-18 15:28:14 -05:00
Timon Kruiper
7560fc716d
Makes the declaration slice resolve lazely when using @typeInfo
...
This way all the declarations in a container won't be resolved untill
the user actually uses the decls slice in the builtin TypeInfo union.
2020-02-18 15:26:37 -05:00
LemonBoy
6b74fd2e12
ir: Avoid invalidating the decl_table iterator
...
Collect the declarations to resolve first and run resolve_top_level_decl
on them later.
Closes #4310
2020-02-16 21:14:30 +01:00
LemonBoy
096f79260b
ir: Prevent crash when indexing undefined ptr to array
...
Closes #4471
2020-02-16 19:53:53 +01:00
Andrew Kelley
7f7d1fbe5a
Implement noasync awaits
...
Note that there is not yet runtime safety for this.
See #3157
2020-02-16 01:44:52 -05:00
Andrew Kelley
cb3a818699
zig fmt: support noasync await
2020-02-16 01:44:52 -05:00
Andrew Kelley
72805fd66e
fix taking address of temporary async frame
2020-02-16 01:44:49 -05:00
Vexu
b15958c557
fix c tokenizer bug
2020-02-14 18:57:57 -05:00
Andrew Kelley
9e1afdc234
Merge pull request #4454 from LemonBoy/capture-reform
...
Payload captures no longer alias the original value
2020-02-14 14:39:00 -05:00
LemonBoy
1c8ac2a0c1
test: Add test cases for the new capture behavior
2020-02-14 15:59:28 +01:00
Vexu
9206f8a8cd
translate-c improve macro cast translation
2020-02-14 09:36:44 -05:00
Andrew Kelley
e8dfc5e7f6
Merge pull request #4442 from fengb/testing-allocator-calls
...
Migrate tests from FixedBufferAllocator to testing.allocator
2020-02-13 16:17:21 -05:00
Andrew Kelley
1675d4f82b
Merge pull request #4443 from LemonBoy/werkzeug
...
A train of small patches
2020-02-13 13:12:18 -05:00
Vexu
fa377dbd15
fix c tokenizer bug
2020-02-13 12:21:28 -05:00
LemonBoy
c5260f7f86
ir: Allow implicit conversion between vector types
...
Only valid when the number of elements match and the types are
compatible.
Fixes #4334
2020-02-13 12:13:56 +01:00
Benjamin Feng
699c50a375
Switch a bunch of FBA to use testing.allocator
2020-02-12 17:17:56 -06:00
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
Vexu
ae5ba369e1
translate-c float fixes
2020-02-10 11:02:29 -05:00
Andrew Kelley
70a4794c57
fix compiler assertion when duplicating fields...
...
...in nested anonymous struct literals
closes #4391
2020-02-10 10:57:40 -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
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
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
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