Commit Graph

5588 Commits

Author SHA1 Message Date
Andrew Kelley
c61e0a078c
fix union init with void payload
all std lib tests passing now
2019-06-25 11:31:38 -04:00
Marc Tiehuis
f5af349bd6
Merge pull request #2714 from ziglang/fmt-overhaul
Add positional, precision and width support to std.fmt
2019-06-25 20:15:33 +12:00
hryx
8435351581
Escape C string literals 2019-06-24 22:37:19 -07:00
Carter Sande
cd02630da8 compiler-rt: Support thumb versions older than armv6
Add versions of __aeabi_memset and __aeabi_memclr which do not use mov
instructions between low registers, as this is unsupported on thumbv4t
and thumbv5.
2019-06-24 22:32:50 -07:00
Marc Tiehuis
08e8d30dd6 Add parsing of fill and alignment in std.format
These options are now available to use when printing, however nothing
currently makes use of these.
2019-06-25 17:11:18 +12:00
Michael Dusan
de2b0cd722 fix compile error when building zig w/ clang
errors as reported on macOS w/ Xcode 10.1, 10.2 and 11.0:

src/ir.cpp:23285:16: error: variable 'bits' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
    } else if (float_type->id == ZigTypeIdFloat)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ir.cpp:23288:13: note: uninitialized use occurs here
    switch (bits) {
            ^~~~
src/ir.cpp:23285:12: note: remove the 'if' if its condition is always true
    } else if (float_type->id == ZigTypeIdFloat)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ir.cpp:23281:18: note: initialize the variable 'bits' to silence this warning
    unsigned bits;
2019-06-24 16:25:18 -04:00
Michael Dusan
3021e5ca67 align (vector -> array) store to result location 2019-06-24 14:52:57 -04:00
hryx
f845994839
transBinaryOperator: Add, Sub 2019-06-23 17:17:21 -07:00
hryx
69b90e0681
transStringLiteral 2019-06-23 15:06:16 -07:00
hryx
b2e06c3bf4
Observe translate mode in stage2 2019-06-23 14:32:45 -07:00
Andrew Kelley
24400d5882
Merge branch 'shawnl-simd2' 2019-06-23 17:14:28 -04:00
Andrew Kelley
7f4de2dfdb
remove stray abort 2019-06-23 17:14:10 -04:00
Andrew Kelley
b2cbc59e4c
Merge branch 'simd2' of https://github.com/shawnl/zig into shawnl-simd2 2019-06-23 17:10:33 -04:00
emekoi
ca3660f6bf increase stack size for mingw 2019-06-23 16:51:12 -04:00
hryx
226a23d977
stage1: always render space after fn like stage2 2019-06-23 12:46:17 -07:00
hryx
c423697c78
Merge branch 'master' into translate-c-userland 2019-06-23 12:31:22 -07:00
hryx
1c86a191da
Fix order of tokens; omit 'pub' for fn types 2019-06-23 01:03:28 -07:00
Andrew Kelley
020d5b529e
compile error tests only for debug mode 2019-06-23 02:06:57 -04:00
hryx
4c8b460fec
Fix recursive self-referential block 2019-06-22 22:30:15 -07:00
Andrew Kelley
036cc48a82
Merge remote-tracking branch 'origin/master' into copy-elision-3 2019-06-23 01:29:48 -04:00
Andrew Kelley
5e58aa4884
uncomment passing std lib tests
these ones getting skipped need to get fixed before merging the branch
2019-06-23 01:29:18 -04:00
Andrew Kelley
38568318a0
fix some legacy coroutine stuff 2019-06-23 00:41:11 -04:00
Andrew Kelley
9153b17c92
Merge pull request #2733 from emekoi/write-strings
various fixes for mingw
2019-06-22 23:51:21 -04:00
emekoi
f1c57a7f84 supress warnings for format strings on msys64 2019-06-22 20:21:48 -05:00
emekoi
3ac9e3c888 make string literal const on windows 2019-06-22 19:54:11 -05:00
hryx
4ae95d7ffc
Translate assignment BinaryOperator statements 2019-06-22 17:29:36 -07:00
hryx
6325ffc3f1
Assign undefined literal (instead of null) when no init value 2019-06-22 17:29:10 -07:00
Andrew Kelley
7e303fa28f
fix another crash 2019-06-22 19:02:59 -04:00
Andrew Kelley
2b1695b1b0
fix std.json regression 2019-06-22 18:54:27 -04:00
Andrew Kelley
86f362ce8e
elide redundant safety check when switching on tagged unions 2019-06-22 16:18:42 -04:00
Shawn Landden
71e014caec stage1: add @sin @cos @exp @exp2 @ln @log2 @log10 @fabs @floor @ceil @trunc @round
and expand @sqrt

This revealed that the accuracy of ln is not as good as the current algorithm in
musl and glibc, and should be ported again.

v2: actually include tests
v3: fix reversal of in and out arguments on f128M_sqrt()
    add test for @sqrt on comptime_float
    do not include @nearbyInt() until it works on all targets.
2019-06-22 14:34:34 -05:00
Sahnvour
987c209b40 heap: make one global instance of DirectAllocator
it is now stateless, so the de/init are not necessary anymore
2019-06-22 14:10:53 -04:00
Andrew Kelley
3c4b255a3c
fix implicit cast fn call result to optional in field result 2019-06-22 13:37:13 -04:00
Andrew Kelley
65997f816b
Merge remote-tracking branch 'origin/master' into copy-elision-3 2019-06-22 01:19:06 -04:00
Gray Olson
be51511d29 Update langref.html.in 2019-06-22 01:15:47 -04:00
Andrew Kelley
726674b2bd
fix ArenaAllocator 2019-06-22 01:13:10 -04:00
Andrew Kelley
b5f9033d82
uncomment passing std lib tests 2019-06-21 19:29:34 -04:00
Andrew Kelley
727af307c6
fix return result loc and then switch with range...
...implicit casted to error union
2019-06-21 18:21:12 -04:00
Andrew Kelley
ff6d563b04
fix implicit cast to optional to error union to return result loc 2019-06-21 17:49:54 -04:00
Andrew Kelley
5441f77672
fix implicit cast bitcast result to error union by returning 2019-06-21 16:54:46 -04:00
Andrew Kelley
142e77abbb
fix extern functions returning byval structs 2019-06-21 14:44:49 -04:00
Andrew Kelley
48ccf427af
fix nested orelse and nested catch 2019-06-21 14:06:01 -04:00
Andrew Kelley
4299cd4446
blocks have result location semantics 2019-06-21 13:16:55 -04:00
Shawn Landden
ebde2ff899 stage1: update fn_key_eql() for @mulAdd() on vectors 2019-06-21 08:44:20 -05:00
Marc Tiehuis
948dc7b304 Link formatting workaround to issue 2019-06-21 20:23:53 +12:00
Marc Tiehuis
11526b6e9d breaking: Add positional, precision and width support to std.fmt
This removes the odd width and precision specifiers found and replacing
them with the more consistent api described in #1358.

Take the following example:

    {1:5.9}

This refers to the first argument (0-indexed) in the argument list. It
will be printed with a minimum width of 5 and will have a precision of 9
(if applicable).

Not all types correctly use these parameters just yet. There are still
some missing gaps to fill in. Fill characters and alignment have yet to
be implemented.
2019-06-21 20:11:15 +12:00
Andrew Kelley
4f21dc8a80
fix regression with zero sized array
thanks mikdusan!
2019-06-21 00:58:18 -04:00
Andrew Kelley
708f153288
BRANCH_TODO file moved to the pull request comments 2019-06-20 22:39:13 -04:00
Andrew Kelley
0498bd40d9
fix loops with multiple break statements 2019-06-20 22:38:40 -04:00
Matthew Murray
2cbcf3f38b Fix absFloat 2019-06-20 19:34:22 -04:00