7766 Commits

Author SHA1 Message Date
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
Michael Dusan
652efe38b4
Merge pull request #4467 from mikdusan/translate-c-error
translate-c: change OutOfMemory → ASTUnitFailure
2020-02-15 15:45:02 -05:00
Michael Dusan
8583038640
translate-c: change OutOfMemory → ASTUnitFailure
- return a better error when no diagnostics are available
2020-02-15 05:14:31 -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
Andrew Kelley
058f38220a enable passing freebsd tests
See #3210 and #4455
2020-02-14 12:00:38 -05:00
LemonBoy
1c8ac2a0c1 test: Add test cases for the new capture behavior 2020-02-14 15:59:28 +01:00
Andrew Kelley
40b9db7cad
Merge pull request #4451 from daurnimator/use-testing.allocator
Migrate (more) tests from FixedBufferAllocator to testing.allocator
2020-02-14 09:40:08 -05:00
Vexu
9206f8a8cd translate-c improve macro cast translation 2020-02-14 09:36:44 -05:00
xackus
7396b144ba modernize std.meta 2020-02-14 09:35:38 -05:00
LemonBoy
3038290a46 ir: Make all the payload captures do a copy
The payload doesn't alias anymore the same memory it comes from and is
instead a fresh copy of the original object.
2020-02-14 15:30:20 +01:00
daurnimator
6ea6d5a4bd
std: use testing.allocator in tests 2020-02-14 19:15:09 +11:00
daurnimator
ca41567924
std: use testing.allocator in big int tests 2020-02-14 18:59:40 +11:00
daurnimator
f20ba7c32c
std: increase memory available to testing allocator 2020-02-14 18:59:25 +11:00
daurnimator
b61e53cc40
std: bigint.deinit() shouldn't need a mutable pointer 2020-02-14 18:59:07 +11:00
Andrew Kelley
fb6b94f80f
cmake: remove case mismatch detection on build mode
See discussion here for context:
c6df5deb34 (comments)

Michael - I appreciate what you did here, making the configure script
work better for people in practice. When it was checking the build type
against a whitelist, I think it was worth it. However, now that we are
supporting systems which use non-standard cmake build modes, I don't
think this case-mismatch detection thing is worth it. It's starting to
get to the point where it's a lot of complication for very little
benefit. Besides, cmake is not case sensitive. If we support
non-standard build modes, then we would need to support a hypothetical
build mode of `release` (lower case).

So let's just remove this and rely on people to use the build system
correctly (like they will have to do when building any cmake project
from source).
2020-02-13 20:47:44 -05:00
Felix (xq) Queißner
cf67d30cdc Makes ArenaAllocator.deinit() not require a mutable reference. 2020-02-13 16:19:34 -05:00
LemonBoy
a090a5e3bc ir: Don't crash when converting undefined ptrs 2020-02-13 16:18:24 -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
de23c57133
Merge branch 'LemonBoy-revive-3904'
closes #3904
closes #4448
2020-02-13 16:14:10 -05:00
Andrew Kelley
cdba521a06
annotate skipped test with issue link 2020-02-13 16:13:53 -05:00
data-man
948a463cf1
fmt: vector formatting 2020-02-13 16:12:54 -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
f93c219f30 Minor changes for a test case 2020-02-13 12:13:56 +01: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
data-man
4578d13b49 Vector comparison in meta and testing 2020-02-13 12:13:55 +01:00
Michael Dusan
1fb70497d2
Merge pull request #4441 from mikdusan/stage1-cmake
stage1: limit cmake checks on build type
2020-02-12 21:04:34 -05:00
Michael Dusan
08666a057a
Merge pull request #4439 from vegecode/custom-format-comment-issue
Correct comment to include comptime attribute on format output fn par…
2020-02-12 18:35:39 -05:00
Benjamin Feng
a81ae1223d Convert a lot of json tests to use testing.allocator 2020-02-12 17:17:56 -06:00
Benjamin Feng
699c50a375 Switch a bunch of FBA to use testing.allocator 2020-02-12 17:17:56 -06:00
Michael Dusan
471662f7c9
stage1: limit cmake checks on build type
Various maintainers pass custom build types and we don't need to check
those. We are interested only in checking and diagnosing common errors
for Zig project supported types.

Check is now limited to look for case-mismatch only on the well-known
values { Debug, Release, RelWithDebInfo, MinSizeRel }.
2020-02-12 17:23:48 -05:00
LemonBoy
55304128c0 Fix rendering of empty arrays 2020-02-12 23:10:53 +01:00
LemonBoy
327d40e7a3 Fix a UAF when verbose-llvm-ir is specified
The g->module is long gone when codegen_link is called.
2020-02-12 23:10:08 +01:00
vegecode
d06bfc2e2a Correct comment to include comptime attribute on format output fn parameter
Without comptime, printing custom type through the stream interface fails
2020-02-12 13:16:32 -06:00
Andrew Kelley
ab4ea5d3cf
Merge pull request #4433 from LemonBoy/ohno
Trivial patchset
2020-02-11 13:12:42 -05: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
b81c5be451 riscv: Remove 'relax' from the baseline cpu features
LLD doesn't implement relaxations at the moment.
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
LemonBoy
ea8755fda9 compiler-rt: Export the AEABI builtins when targeting thumb 2020-02-11 15:24:18 +01:00
Michael Dusan
e624c86289
Merge pull request #4389 from mikdusan/stage1-mem
stage1: memory/report overhaul
2020-02-10 23:08:33 -05:00
Michael Dusan
edb210905d
stage1: memory/report overhaul
- split util_base.hpp from util.hpp
- new namespaces: `mem` and `heap`
- new `mem::Allocator` interface
- new `heap::CAllocator` impl with global `heap::c_allocator`
- new `heap::ArenaAllocator` impl
- new `mem::TypeInfo` extracts names without RTTI
- name extraction is enabled w/ ZIG_ENABLE_MEM_PROFILE=1
- new `mem::List` takes explicit `Allocator&` parameter
- new `mem::HashMap` takes explicit `Allocator&` parameter
- add Codegen.pass1_arena and use for all `ZigValue` allocs
- deinit Codegen.pass1_arena early in `zig_llvm_emit_output()`
2020-02-10 21:08:08 -05: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
LemonBoy
3237528a59 fmt: Pass the fmt string to the inner formatters 2020-02-10 19:43:11 -05:00
Andrew Kelley
3170ead9eb
compile error instead of abort for unimplemented @typeInfo
of `@Frame(func)`. Closes #3995
2020-02-10 19:14:54 -05:00
Andrew Kelley
702398dd0e
Revert "windows: remove the 'A' versions of psapi functions"
This reverts commit 1cdefeb10b7496126bbb7d00709235abfee56a4a.

See #4426
2020-02-10 12:30:20 -05:00
Andrew Kelley
1cdefeb10b
windows: remove the 'A' versions of psapi functions
See #534
2020-02-10 12:03:11 -05:00
Vexu
ae5ba369e1 translate-c float fixes 2020-02-10 11:02:29 -05:00