Commit Graph

9415 Commits (68cc068a3aa5df8bd1995d10a9133af1fa1ea1d3)

Author SHA1 Message Date
Noam Preil 68cc068a3a
[Stage2/Testing] Make API more friendly 2020-06-15 17:51:43 -04:00
Noam Preil bebc1f49cf
[Stage2/Testing] Add (failing) test 2020-06-15 17:51:43 -04:00
Noam Preil 2d1d012f11
[Stage2/Testing] Reduce test 2020-06-15 17:51:43 -04:00
Noam Preil e030414c16
[Stage2/Testing] Always finish case, note all errs 2020-06-15 17:51:43 -04:00
Noam Preil f2399db3ef
[Stage2/Testing] Don't rely on update erroring 2020-06-15 17:51:42 -04:00
Noam Preil 67414be86b
[Stage2/Testing] Print name of failed test 2020-06-15 17:51:42 -04:00
Noam Preil c92816fbef
[Stage2/Testing] ZIR tests for expected errors 2020-06-15 17:51:29 -04:00
Vexu e7207bc267
add workaround for #5599 2020-06-14 20:13:02 +03:00
Carter Sande 09cded209d Add strict_align to pre-v6 ARM targets
This matches GCC's and Clang's default behavior for these targets.
2020-06-12 13:43:12 -04:00
Andrew Kelley 866651a5a3
Merge pull request #5589 from kubkon/preopens-example
Add doc example for extracting WASI preopens
2020-06-12 13:40:30 -04:00
Alexandros Naskos 1bc92b1fde Fix formatting of floating point values with the B and Bi specifiers 2020-06-12 13:38:12 -04:00
Cassidy Dingenskirchen 57f1ed5325 Fix a few std.sort.sort invocations 2020-06-12 13:33:31 -04:00
Veikka Tuominen 7d8fd45267
Merge pull request #5595 from ifreund/doc-arraylist-fix
docs: fix mention of deprecated ArrayList.span()
2020-06-12 19:10:47 +03:00
Isaac Freund a254297953
docs: fix mention of deprecated ArrayList.span() 2020-06-12 17:58:43 +02:00
Jakub Konka 200f9ea6fb Add unit test for std.fs.wasi.PreopenList 2020-06-11 23:00:02 +02:00
Jakub Konka c7721bb368 Add custom format method for Preopen struct 2020-06-11 22:31:08 +02:00
Jakub Konka e4a8598ddd Add doc example for extracting WASI preopens 2020-06-11 22:30:02 +02:00
Jonathan Marler a282ac7a91 Support Reader for InStream 2020-06-09 13:36:17 -04:00
Andrew Kelley 4302f276ed Merge branch 'kubkon-wasm-instrinsics'
closes #5507
2020-06-09 00:22:43 -04:00
Jakub Konka 42c95a64d6 Update langref.html.in 2020-06-09 00:22:34 -04:00
Jakub Konka 660eef9a43 Document the builtins 2020-06-09 00:22:34 -04:00
Jakub Konka 52b97eeef1 Return u32 in @wasmMemorySize instead of i32 2020-06-09 00:22:34 -04:00
Jakub Konka 057d97c093 Return should be i32 due to error signaling in memory.grow
Also, fix tests.
2020-06-09 00:22:34 -04:00
Jakub Konka 3f0a3cea6e Fix builtins to return and accept u32 instead of i32 2020-06-09 00:22:34 -04:00
Jakub Konka 8ffa8ed9a8 Expose full llvm intrinsic 2020-06-09 00:22:34 -04:00
Jakub Konka 73a3bfd1dd Add basic tests for the new builtins 2020-06-09 00:22:34 -04:00
Jakub Konka 146be2a8cb Use builtins in std.heap.WasmAllocator 2020-06-09 00:22:17 -04:00
Jakub Konka 601e831f1d Add builtin for llvm.wasm.memory.grow.i32 intrinsic
This will allow the developer to request additional memory pages
from the runtime to be allocated for the Wasm app. Typical usage:

```zig
var wasm_pages = @wasmMemorySize();
@wasmMemoryGrow(1);
@import("std").debug.assert((wasm_pages + 1) == @wasmMemorySize());
```
2020-06-09 00:22:17 -04:00
Jakub Konka ce3f0077cf Add builtin for llvm.wasm.memory.size.i32 instrinsic
This will allow the developer to poll the runtime for currently
allocated memory in the number of Wasm pages. Typical usage:

```zig
var wasm_pages = @wasmMemorySize();
@import("std").debug.assert(wasm_pages > 0);
```
2020-06-09 00:22:17 -04:00
Jonathan Marler 12051b02f1 fix memory errors 2020-06-09 00:17:22 -04:00
Andrew Kelley 9ee98f103b
Merge pull request #5539 from mikdusan/issue5474
stage1: fix constness in some corner cases
2020-06-09 00:12:57 -04:00
Jonathan Marler 7481582774 support Writer instead of OutStream
Start implementing https://github.com/ziglang/zig/issues/4917 which is to rename instream/outstream to reader/writer.  This first change allows code to use Writer/writer instead of OutStream/outStream, but still maintains the old outstream names with "Deprecated" comments.
2020-06-08 22:59:28 -04:00
Michael Dusan f5b584cc13
Merge pull request #5567 from mikdusan/qemu
ci linux: bump qemu-5.0.0-49ee115552
2020-06-08 22:12:14 -04:00
Andrew Kelley d2278f2156
Merge pull request #5566 from ziglang/stage2-garbage-collect-decls
Stage2 garbage collect decls
2020-06-08 18:29:12 -04:00
Jakub Konka 0ff5d7b24e Add option for overriding the stack size
This commit adds a `--stack [size]` link-time option to zig compiler
allowing the user to override the default stack size set for the
specified executable/library format. This is currently limited to
ELF, COFF and Wasm however (i.e., Mach-O is excluded).
2020-06-08 17:44:06 -04:00
Jakub Konka cde7c75676 Increase default Wasm stack to 1MB
This commit increases the default Wasm stack to 1MB from the default
of 1 Wasm page which equal 64KB. This seems like a reasonable default
size while at the same time not overly large. Also, Rust lang seems
to be favouring this default as well: [rust-lang#50083].

[rust-lang#50083]: https://github.com/rust-lang/rust/pull/50083
2020-06-08 17:29:14 -04:00
xackus 0d40cb6255 stage1: fix crash on slice byte reinterpretation 2020-06-08 17:19:06 -04:00
Andrew Kelley 05d284c842 update sort callsite to new API 2020-06-08 16:33:35 -04:00
Michael Dusan c2f547f91f
ci linux: bump qemu-5.0.0-49ee115552
update qemu to upstream with mremap patch
2020-06-08 16:20:39 -04:00
Andrew Kelley 47090d234e stage2: add passing test for compile error in unreferenced cycle 2020-06-08 15:16:40 -04:00
Andrew Kelley 9ea4965ceb self-hosted: remove deleted Decls from failed_decls 2020-06-08 15:16:40 -04:00
Andrew Kelley 91930a4ff0 stage2: fix not re-loading source file for updates after errors 2020-06-08 15:16:40 -04:00
Andrew Kelley cf654b52d6 stage2: -femit-zir respects decl names and supports cycles 2020-06-08 15:16:40 -04:00
Andrew Kelley d4d954abd2 std.sort: give comparator functions a context parameter 2020-06-08 15:16:40 -04:00
Noam Preil c405844b0a [Stage2/x86] Fix 8-bit register order 2020-06-08 02:28:39 -04:00
Andrew Kelley 37695ed81e
Merge pull request #5556 from iansimonson/try_other_addresses
tcpConnectToHost try all addresses in AddressList
2020-06-07 13:53:12 -04:00
Ian Simonson a6d1ef64d7 tcpConnectToHost try all addresses in AddressList
The AddressList returned can contain more than one item
e.g. the ipv4 and ipv6 addresses for a given hostname.
Previously if a server had multiple addresses but
was not listening on one of them Zig would give up
immediately.

Now on std.os.ConnectError.ConnectionRefused Zig will
try the next address in the list. Zig still gives up on
all other errors as they are related to the system and
system resources rather than whether the remote server
is listening on a particular address.
2020-06-07 22:39:35 +10:00
Ian Simonson 983f93c840 Test case for tcpConnectToHost fix 2020-06-07 22:39:35 +10:00
Veikka Tuominen 499df9680c
Merge pull request #5531 from Vexu/translate-c
Translate-c don't crash on complex switches
2020-06-05 10:41:56 +03:00
Michael Dusan c0c9d11d8c
stage1: fix constness in some corner cases
- for one-possible-value types, ir_analyze_struct_field_ptr()
  no longer hardcodes const/volatile

- when slicing arrays, ir_analyze_instruction_slice()
  no longer consults ConstValSpecialStatic

closes #5474
2020-06-05 00:49:57 -04:00