Commit Graph

2529 Commits

Author SHA1 Message Date
Shritesh Bhattarai a2d8f03092 support extern "wasi" functions 2019-04-13 22:28:58 -05:00
Shritesh Bhattarai 63f2e96eea wasm: use .wasm ext for exe 2019-04-12 13:17:59 -04:00
Andrew Kelley 6284a4c534 translate-c: move some code to the C API
See #1964
2019-04-12 03:56:38 -04:00
Andrew Kelley f860493f23 translate-c: move some code to the C API
See #1964
2019-04-12 03:12:22 -04:00
Andrew Kelley 6f34d08aed translate-c: move some code to the C API
See #1964
2019-04-11 23:38:41 -04:00
Shritesh Bhattarai 5f8dbcac06 wasm: disable error ret tracing 2019-04-11 16:37:40 -04:00
Andrew Kelley b960f1d922 translate-c: move some code to the C API
See #1964
2019-04-11 15:33:26 -04:00
Andrew Kelley a895c59971 delete unused function
missed by 27cd830ec8
2019-04-11 14:33:43 -04:00
Matthew Iannucci 27cd830ec8 Add initial support for iOS targets (#2237)
* Add iOS C int sizes... try to hack in iOS DebugInfo

* Get rid of ios link check for now

* Remove macos linkversion check
2019-04-11 13:15:17 -04:00
Andrew Kelley dff201540f translate-c: move some code to the C API
See #1964
2019-04-11 03:59:12 -04:00
LemonBoy 8f5753ba9f Fix normalization of right-shifted BigInt at CT
The pointer value for the `digits` field was being treated as if it were
a limb.

Fixes #2225
2019-04-11 03:49:15 -04:00
Shritesh Bhattarai 13798d26c7 pass exec_path to zig run 2019-04-10 20:07:35 -04:00
Shritesh Bhattarai 666e879925 Build compiler_rt for WASM exe 2019-04-10 19:14:19 -04:00
Andrew Kelley a71bfc249d compiler-rt: better way to do the ABI required on Windows
This removes the compiler_rt.setXmm0 hack. Instead, for
the functions that use i128 or u128 in their parameter and
return types, we use `@Vector(2, u64)` which generates
the LLVM IR `<2 x i64>` type that matches what Clang
generates for `typedef int ti_int __attribute__ ((mode (TI)))`
when targeting Windows x86_64.
2019-04-10 18:47:14 -04:00
kristopher tate 627b52fe65 src/ir.cpp: don't call-out to analyze_type_expr;
replaces `analyze_type_expr` with `ir_analyze_type_expr`
2019-04-07 10:37:43 +09:00
Jimmi Holst Christensen 65cf5a8e44 removed todo comment and added test 2019-04-06 11:04:55 +02:00
Jimmi Holst Christensen 3109c89850 fixed 1726 2019-04-06 10:56:07 +02:00
Andrew Kelley f00adb47f5 ir: avoid dependency on isnan
there's a simple way to check for nan that does not need this header.
hryx on IRC reported that Linux Mint based on ubuntu 16.04, kernel
4.15.0, x86_64 did not have the isnan function.
2019-04-06 01:03:30 -04:00
Andrew Kelley 83390bdfdd fix dereferencing a zero bit type
Before only u0 was special cased in handling a dereference;
now all zero bit types are handled the same way. Dereferencing
a pointer to a zero bit type always gives a comptime-known
result.

This previously had been failing on master branch but went unnoticed
because until 846f72b57c the CI server was mistakenly not actually
running the single-threaded tests with --single-threaded.

This fixes the standard library tests with --single-threaded
--release-fast.
2019-04-05 20:18:26 -04:00
Shritesh Bhattarai 3854bb9198 wasm: Pass --allow-undefined and --export-all to the linker 2019-04-05 18:46:11 -04:00
Andrew Kelley c47c2a2f2a stage1: fix debug builds on macOS 2019-04-05 15:39:00 -04:00
Andrew Kelley 1dc6751721 fix NaN comparing equal to itself
This was broken both in comptime code and in runtime code.

closes #1174
2019-04-04 22:07:15 -04:00
Andrew Kelley 5866dfe4d9 Merge pull request #2109 from emekoi/fix-mingw
fixed libc command on mingw
2019-04-04 15:55:40 -04:00
Andrew Kelley be0f656c21 fix @divFloor returning incorrect value and add __modti3
Closes #2152
See #1290
2019-04-04 15:45:37 -04:00
Andrew Kelley e4d595a8ba fix thread local variables for non- position independent code
This fixes comes thanks to Rich Felker from the musl libc project,
who gave me this crucial information:

"to satisfy the abi, your init code has to write the same value
to that memory location as the value passed to the [arch_prctl]
syscall"

This commit also changes the rules for when to build statically
by default. When building objects and static libraries, position
independent code is disabled if no libraries will be dynamically
linked and the target does not require position independent code.

closes #2063
2019-04-04 01:08:26 -04:00
Andrew Kelley 025a1475c4 emit better debug info for enums
fixes llvm assertion when building for windows
2019-04-02 19:40:33 -04:00
Andrew Kelley 6a7b75b73c fix LLVM assertion failures 2019-04-02 19:09:25 -04:00
Andrew Kelley 15bd4aa54f fix setting union body twice 2019-04-02 18:43:25 -04:00
Andrew Kelley e9dc504141 avoid tripping assertion for setting struct body twice 2019-04-02 18:31:19 -04:00
Andrew Kelley d577dde636 passing all tests 2019-04-02 18:31:19 -04:00
Andrew Kelley 9780fd59f0 put the alignment hack in for unions too. fixes std tests 2019-04-02 18:31:19 -04:00
Andrew Kelley cb0241fe44 behavior tests passing again 2019-04-02 18:31:19 -04:00
Andrew Kelley 4c38a8cce1 more regression fixes. empty test passes again 2019-04-02 18:31:19 -04:00
Andrew Kelley 5aee17e888 regression fixes and fix packed struct abi size 2019-04-02 18:31:19 -04:00
Andrew Kelley ddb8aa73f5 more regression fixes 2019-04-02 18:31:18 -04:00
Andrew Kelley 30b2fb2fb5 bug fixes 2019-04-02 18:31:18 -04:00
Andrew Kelley d7bc7635c0 put the hack from master branch back in 2019-04-02 18:31:18 -04:00
Andrew Kelley d3f2fe2cef remove the lazy value stuff
let's try to keep this branch to solving one problem at a time
2019-04-02 18:31:18 -04:00
Andrew Kelley 3dc8448680 introduce lazy values
but I think it's a bad idea, so I'm going to back out the change
2019-04-02 18:31:18 -04:00
Andrew Kelley ee5064c053 decouple llvm types from zig types
Not tested yet, but it builds.

This closes #761, and lays the groundwork for fixing the remaining
false positive "foo depends on itself" bugs, such as #624.

It also lays the groundwork for implementing ability to specify
alignment of fields (#1512).
2019-04-02 18:31:17 -04:00
Andrew Kelley 2f96c55095 fix cache hash regression
fixes "warning: unexpected seek failure"

fix regression introduced by 27e31f0475

the fd should be closed only if returning with an error
2019-04-02 15:29:16 -04:00
Andrew Kelley 0cccba71d4 better error message when os_file_overwrite fails 2019-04-02 15:21:08 -04:00
Shawn Landden 27e31f0475 fix fd leak in stage1 cacheing code 2019-04-02 12:27:14 -04:00
Andrew Kelley 3c27d9c25a Merge pull request #2147 from emekoi/fix1940
added error for implicit cast from *const T to *[1]T.
2019-04-01 11:35:03 -04:00
emekoi 4a64f26627 added error for implicit cast from *const T to *[1]T. credit: @kristate 2019-03-31 16:47:34 -05:00
Michael Dusan aa794eb621 fix zig run to accept executable args
The `--` double-hyphen is now used to end further `zig` processing
of command line options. All arguments after `--` will be passed
on to the executable. eg. `--help` will be passed on.

`zig run foo.zig -- --help`

closes #2148
2019-03-31 17:01:11 -04:00
Andrew Kelley 25ac2fe8cd fix anon enum literal used with switch on union(enum)
closes #2141
closes #2142
2019-03-31 12:43:21 -04:00
emekoi 8fdf8b6972 fixed libc command on mingw 2019-03-29 23:16:17 -05:00
Shawn Landden 66f13ba807 stage1: better error message when comparing against null
Closes: #2104
2019-03-28 15:54:44 -04:00
Andrew Kelley 64b2cf776c implement target_c_type_size_in_bits for WASI 2019-03-27 16:08:45 -04:00