6889 Commits

Author SHA1 Message Date
Michael Dusan
1f99899408 stage1 enhance IR print
- pass2 now prints missing instructions in a trailing fashion
- instruction struct name added to print as column 2
2019-08-31 22:42:58 -04:00
Andrew Kelley
5c3a9a1a3e
improvements to @asyncCall
* `await @asyncCall` generates better code. See #3065
 * `@asyncCall` works with a real `@Frame(func)` in addition to
   a byte slice. Closes #3072
 * `@asyncCall` allows passing `{}` (a void value) as the result
   pointer, which uses the result location inside the frame.
   Closes #3068
 * support `await @asyncCall` on a non-async function. This is in
   preparation for safe recursion (#1006).
2019-08-31 18:50:16 -04:00
Andrew Kelley
a223063923
@typeOf now guarantees no runtime side effects
related: #1627
2019-08-31 11:00:31 -04:00
Andrew Kelley
6ab8b2aab4
support recursive async and non-async functions
which heap allocate their own frames

related: #1006
2019-08-30 20:06:02 -04:00
Andrew Kelley
2148943fff
Merge pull request #3139 from hspak/zig-fmt-nested-if
zig fmt: fix nested if
2019-08-30 15:48:07 -04:00
Robin Voetter
7a2b4cb9a1 Merge remote-tracking branch 'upstream/master' into arm-support-improvement 2019-08-30 21:37:46 +02:00
Andrew Kelley
fed5c12d9a
musl: fix alltypes.h and syscall.h not being correct
The previous
[instructions](https://github.com/ziglang/zig/wiki/Updating-libc) for
updating musl libc headers had this (repeated for each architecture):

make DESTDIR=build-all/arm install-headers ARCH=arm

However musl's build system does not properly rebuild alltypes.h and
syscall.h from source, instead using whatever is cached from the
previous build. In the case of the previous time that I updated to musl
1.1.23, this happened to be the aarch64 architecture.

As a workaround, one can remove the obj/ directory to force rebuilding
this file. Now the instructions say this (repeated for each architecture):

rm -rf obj/ && make DESTDIR=build-all/arm install-headers ARCH=arm

This commit updates the resulting headers after this workaround is
applied and the process headers tool is run again.
2019-08-30 15:02:23 -04:00
Andrew Kelley
37ef490fc6
update process_headers.zig for latest zig 2019-08-30 15:01:37 -04:00
Andrew Kelley
d9fed5cdfd
align(@alignOf(T)) T does not force resolution of T 2019-08-30 14:53:44 -04:00
Michael Dusan
966670645a fix stage1 to build on macOS + xcode/clang 2019-08-30 09:01:29 -04:00
Robin Voetter
ca2aa4880f Merge remote-tracking branch 'upstream/master' into arm-support-improvement 2019-08-30 13:02:28 +02:00
Robin Voetter
4b8325f381 Remove unneeded os check 2019-08-30 13:02:15 +02:00
Robin Voetter
c1f8b201a1 Improve comments near un-implemented functionality 2019-08-30 12:58:44 +02:00
Hong Shick Pak
19964f5dc8 run new zig fmt and remove stale comment 2019-08-29 21:23:49 -07:00
Hong Shick Pak
9f4d44bc49 zig fmt: fix nested if 2019-08-29 21:10:26 -07:00
Andrew Kelley
10541c8fc8
Merge branch 'lazy-sizeof' 2019-08-29 22:44:21 -04:00
Andrew Kelley
e9a4bcbcc6
fix regressions 2019-08-29 22:44:07 -04:00
Andrew Kelley
03910925f0
await does not force async if callee is blocking
closes #3067
2019-08-29 21:51:37 -04:00
Andrew Kelley
8e93991634
avoid unnecessarily requiring alignment for array elem pointers 2019-08-29 16:25:58 -04:00
Andrew Kelley
0512beca9d
comparing against zero participates in lazy values 2019-08-29 14:46:22 -04:00
Andrew Kelley
d9f0446b1f
make @sizeOf lazy 2019-08-29 12:43:56 -04:00
Robin Voetter
2323da3a68 add __aeabi_read_tp 2019-08-29 18:12:58 +02:00
Andrew Kelley
94bbb46ca6
fix not fully resolving debug info for structs causing llvm error 2019-08-29 10:29:48 -04:00
Andrew Kelley
f7f8692730
fix not fully resolving debug info for structs causing llvm error 2019-08-29 10:24:24 -04:00
Shritesh
834a789bb9 Use LLVM path provided by homebrew 2019-08-29 10:19:35 -04:00
Robin Voetter
e4c262b804 Don't print line info if source is not available 2019-08-29 10:52:50 +02:00
Robin Voetter
108a51b110 fix issues with debug.zig
- Use sys_*stat*64 instead of sys_*stat* where appropriate
- Fix overflow when calculating atime, ctime and mtime on File.stat()
- Fix compilation error casting getEndPos to usize.
2019-08-29 10:34:05 +02:00
Robin Voetter
b3ac323a44 TLS initialization, clone definition and _start functionality 2019-08-29 01:14:43 +02:00
Robin Voetter
57de61084e Make mmap use SYS_mmap2 if it exists 2019-08-29 00:55:22 +02:00
Robin Voetter
223b773e03 Add more syscall constants 2019-08-29 00:54:57 +02:00
Andrew Kelley
928ce5e326
Merge remote-tracking branch 'origin/master' into llvm9 2019-08-28 16:59:35 -04:00
Andrew Kelley
e8a9caa3dd
add suggestion to AutoHash compile error message 2019-08-28 14:38:55 -04:00
Andrew Kelley
af90da1531
fix implicit cast from zero sized array ptr to slice
closes #1850
2019-08-28 12:16:52 -04:00
Andrew Kelley
d5b3d97c23
Merge pull request #2760 from Vexu/fmt-comment-fix
Fix non-empty comments getting removed with empty comments
2019-08-28 12:01:08 -04:00
yvt
c98f792ff8 Improve the handling of zig fmt: off/on
This commit reworks the handling of `zig fmt: off/on`. A motivating
example is shown below:

    const c = d;
    // zig fmt: off
    // comment
    const a = b;
    // zig fmt: on

Before processing the decl `const a = b;`, `renderRoot` looks for
`zig fmt: off` that appears between this decl and the previous one. If
it finds one, it searches for the next `zig fmt: on` that re-enables
reformatting (or EOF if none was found), and copies the input code
between `zig fmt: off` and `zig fmt: on` to the output stream. After
that, it proceeds to the next decl.

The important thing to notice here is that `renderTopLevelDecl` emits
line comment tokens that follow the decl. Therefore, when copying code,
we must be careful not to copy the line comment tokens that already have
been written to the output stream. The original code failed to take this
fact into consideration. It did skip `// zig fmt: off`, but not the
remaining ones. As a result, when the above example is fed as input, it
duplicated the line `// comment`.
2019-08-28 11:57:01 -04:00
Robin Voetter
50c37c75d1 add arm32 syscall conventions 2019-08-28 17:41:49 +02:00
Andrew Kelley
7139eef4cf
implement lazy values for error union types
closes #3129
2019-08-28 11:17:20 -04:00
Robin Voetter
32f4606cec add arm32 linux bits definitions 2019-08-28 16:35:23 +02:00
Marc Tiehuis
ac477f3c9a
Merge pull request #3060 from Sahnvour/hashing
auto_hash with deep/shallow hashing
2019-08-28 21:25:50 +12:00
Andrew Kelley
47fcbfdc51
add regression test for already fixed bug
closes #3112
2019-08-27 17:39:06 -04:00
Andrew Kelley
f4519c520a
support self-referential struct through a slice of optional
by making optionals even more lazy

closes #1805
2019-08-27 16:55:58 -04:00
Andrew Kelley
c1fd7ed6e2
add regression test for struct with optional list of self
closes #1735
2019-08-27 14:06:17 -04:00
Andrew Kelley
428a2fdedd
better handle struct depends on itself via optional field
closes #1995
2019-08-27 13:59:18 -04:00
Andrew Kelley
e1b258f39f
add regression test for bug fixed by lazy values
closes #624
2019-08-27 13:44:04 -04:00
Marc Tiehuis
fbcdf78cbd Simplify wyhash and improve speed
This removes the exposed stateless variant since the standard variant
has similar speed now.

Using `./benchmark --filter wyhash --count 1024`, the speed change has
changed from:

    wyhash
       iterative: 4093 MiB/s [6f76b0d5db7db34c]
      small keys: 3132 MiB/s [28c2f43c70000000]

to

    wyhash
       iterative: 6515 MiB/s [673e9bb86da93ea4]
      small keys: 10487 MiB/s [28c2f43c70000000]
2019-08-27 19:42:37 +02:00
Andrew Kelley
8fef23a525
add regression test for bug fixed by lazy values
closes #1310
2019-08-27 13:36:42 -04:00
Andrew Kelley
35a374efe0
Merge pull request #3115 from ziglang/fix-field-alignment-kludge
fix field alignment kludge by implementing lazy values
2019-08-27 13:02:31 -04:00
Andrew Kelley
d9ed55f017
fix not properly casting align values
and add check for alignment specified on enum fields
2019-08-27 12:54:50 -04:00
Andrew Kelley
7d34e55a71
add a TODO compile error for union field alignment syntax
See #3125
2019-08-27 10:45:28 -04:00
Andrew Kelley
ffac0b02e7
implement and test struct field explicit alignment 2019-08-27 10:14:11 -04:00