Andrew Kelley
490654c332
std.ascii: add lessThanIgnoreCase and orderIgnoreCase
...
For sorting ascii strings, case insensitively.
2021-02-27 01:21:01 -07:00
Andrew Kelley
4a548002af
translate-c: upgrade to new std.zig.fmtEscapes API
...
fixes regressions from previous commit
2021-02-27 01:20:19 -07:00
Andrew Kelley
3f844cba0b
std.zig.fmt escaped string formatting recognizes single quote style
...
This introduces {'} to indicate escape for a single-quoted string,
and {} to indicate escape for a double quoted string.
Without this, there would be unnecessary \' inside double quoted
strings, and unnecessary \" inside single quoted strings.
Motivated by the llvm12 branch, in the new tool I am writing for
updating target CPU features.
2021-02-27 00:27:53 -07:00
Evan Haas
0816981561
translate-c: add typeof support
2021-02-25 22:33:42 -08:00
Andrew Kelley
fd208d9d59
stage2: implement the error_value AST tag
2021-02-25 18:21:22 -07:00
Andrew Kelley
4360f45d7f
std.os: remove special case for haiku
...
This is an accident from a merge conflict introduced in
7edb204edfa41e11776ac009da5a20fb1c907f5f.
The new pipe2 code I believe is supposed to work for all posix-like
systems. If haiku needs special handling here, it should be
re-introduced.
2021-02-25 17:42:14 -07:00
g-w1
153c97ac9e
improve stage2 to allow catch at comptime:
...
* add error_union value tag.
* add analyzeIsErr
* add Value.isError
* add TZIR wrap_errunion_payload and wrap_errunion_err for
wrapping from T -> E!T and E -> E!T
* add anlyzeInstUnwrapErrCode and analyzeInstUnwrapErr
* add analyzeInstEnsureErrPayloadVoid:
* add wrapErrorUnion
* add comptime error comparison for tests
* tests!
2021-02-25 16:41:16 -08:00
Andrew Kelley
7edb204edf
Merge pull request #7546 from hoanga/haiku-support
...
initial support for haiku
2021-02-25 16:00:00 -08:00
Andrew Kelley
37a1d08de2
haiku: minor fixups
...
* no isHaiku() function since there is not more than one os tag that
this applies to.
* clean up some control flow into a switch
* add some TODO comments to investigate panics that suspiciously look
like they should be compile errors (see #363 )
2021-02-25 16:54:32 -07:00
Al Hoang
96a08c1698
initial support for haiku defer debug
2021-02-25 16:41:42 -07:00
Al Hoang
c17396691c
initial support for haiku sync update
...
* add cpu count
* use haiku find_directory
* add definitions and exports for building in haiku
2021-02-25 16:41:42 -07:00
Al Hoang
6b0372229d
initial support for haiku continue clean up
...
* remove unused definitions
* setup os specific blocks
2021-02-25 16:41:42 -07:00
Al Hoang
025635c3f8
initial support for haiku past stage0
2021-02-25 16:41:42 -07:00
joachimschmidt557
297eabd4ac
stage2 ARM: Save callee-saved registers
...
Add a new allocated_registers bitmap to keep track of all callee-saved
registers allocated during generation of this function.
Function(.arm).gen uses this data to generate instructions in the
function prologue and epilogue to push and pop these registers
respectively.
2021-02-25 22:27:19 +02:00
Hubert Jasudowicz
3c0238e731
std/build: Add support for LTO configuration
2021-02-25 22:25:42 +02:00
Evan Haas
4f11a88b9f
translate-c: Add support for pointer subtraction
...
When two pointers are subtracted, both shall point to elements of the
same array object, or one past the last element of the array object;
the result is the difference of the subscripts of the two array elements.
The size of the result is implementation-defined, and its type
(a signed integer type) is ptrdiff_t defined in the <stddef.h> header.
If the result is not representable in an object of that type,
the behavior is undefined.
See C Standard, §6.5.6 [ISO/IEC 9899:2011]
Fixes #7216
2021-02-25 22:24:11 +02:00
LemonBoy
53cc63f0c9
std: Clear old memory on free
...
Re-enable the clear-on-free step, it was previously disabled due to
translate-c using freed memory.
2021-02-25 22:20:30 +02:00
Andrew Kelley
449f4de382
zig fmt src/
2021-02-24 21:54:23 -07:00
Andrew Kelley
9b8a94265a
zig fmt: fix extern function with missing param name
...
Regressed in d7049fc8e0709619b8aa6766b37abeae946703b2.
2021-02-24 21:50:57 -07:00
Andrew Kelley
5f35dc0c0d
zig fmt the std lib
2021-02-24 21:29:23 -07:00
Andrew Kelley
d7049fc8e0
Merge pull request #7920 from ziglang/ast-memory-layout
...
Rework AST memory layout for better memory usage and performance
2021-02-24 18:49:07 -08:00
Andrew Kelley
9ada7638a5
zig fmt: function with labeled block as return type
2021-02-24 16:42:46 -07:00
Andrew Kelley
c79ee1fc8d
build.zig: expose a strip option
2021-02-24 16:36:27 -07:00
Andrew Kelley
8e6c2b7a47
Merge remote-tracking branch 'origin/master' into ast-memory-layout
2021-02-24 15:08:23 -07:00
Andrew Kelley
38441b5eab
MultiArrayList: use @memcpy as a workaround
...
Reverts bf642204b373e01314ecfb0c50a643dc4b05746f and uses a different
workaround, suggested by @LemonBoy.
There is either a compiler bug or a design flaw somewhere around here.
It does not have to block this branch, but I need to understand exactly
what's going on here and make it so that nobody ever has to run into
this problem again.
2021-02-24 12:49:12 -07:00
Isaac Freund
52c45bf44d
zig fmt: rework single statement if/while/for indentation
...
This approach properly handles nesting unlike the approach in the
previous commit.
2021-02-24 17:28:29 +01:00
Josh Wolfe
8b9434871e
Avoid concept of a "Unicode character" in documentation and error messages ( #8059 )
2021-02-24 08:26:13 -05:00
Isaac Freund
371b21bdfb
zig fmt: fix comment indent after multiline single statement if/while/for
2021-02-24 13:46:11 +01:00
Isaac Freund
15c7c6ab97
zig fmt: handle comments in switch case value list
2021-02-24 12:29:17 +01:00
Isaac Freund
1b8eca030e
zig fmt: fix firstToken() for switch_case
2021-02-24 12:14:15 +01:00
Andrew Kelley
db4c15be50
zig fmt: respect extra newline between fn and pub usingnamespace
2021-02-23 23:01:16 -07:00
Andrew Kelley
bf642204b3
std.MultiArrayList: add workaround for LLVM bug
2021-02-23 22:24:59 -07:00
Andrew Kelley
05f304807f
zig fmt: add 3 more disabled failing test cases
...
Found by running `zig fmt` on the std lib.
2021-02-23 18:48:01 -07:00
Andrew Kelley
4420fe97be
zig fmt: for loop with ptr payload and index
2021-02-23 18:33:13 -07:00
Andrew Kelley
988f1c6a6f
zig fmt: fn proto end with anytype and comma
...
also
zig fmt: space after top level doc comment
2021-02-23 18:23:49 -07:00
Andrew Kelley
08107a555e
zig fmt: fix inline assembly test cases
...
All zig fmt test cases are now passing again in this branch.
2021-02-23 17:19:01 -07:00
Andrew Kelley
bb89c619ed
zig fmt: multiline string literals + array init
2021-02-23 17:00:33 -07:00
Andrew Kelley
6f4a1bafcf
zig fmt: fn call with comments and multiline strings
...
forcing the parameters over multiple lines
2021-02-23 16:09:51 -07:00
Isaac Freund
4ee368c4b3
zig fmt: comments/line breaks in field access chain
2021-02-23 23:17:38 +01:00
Andrew Kelley
ca9259340d
zig fmt now intentionally respects all empty line comments
2021-02-23 14:30:21 -07:00
Andrew Kelley
f041425e48
translate-c: fix using wrong slice and AST tag
2021-02-23 13:55:12 -07:00
Andrew Kelley
01e89c9171
translate-c: update to latest AST tag changes
2021-02-23 12:39:50 -07:00
Isaac Freund
b028a92a60
zig fmt: handle comments in array type/init/access
2021-02-23 19:56:56 +01:00
Isaac Freund
abfe213830
zig fmt: enable array init trailing comment insertion test
...
Modify the test case slightly to match similar modifications done in
5820bd0 and 0f24b61.
2021-02-23 19:40:34 +01:00
Isaac Freund
6b9f19a644
zig fmt: remove stray std.debug.print()
2021-02-23 19:18:36 +01:00
Isaac Freund
0f24b61ed5
zig fmt: insert trailing comma in struct init with comment
2021-02-23 19:17:11 +01:00
Isaac Freund
5820bd0e64
zig fmt: insert trailing comma in fn params with comment
2021-02-23 19:11:50 +01:00
Isaac Freund
5306b1a9ab
zig fmt: container doc comments
2021-02-23 18:32:47 +01:00
johnLate
d9e46dceec
std.Thread.Semaphore: Fix wrong variable name
...
Fixes ziglang#8052
2021-02-23 11:10:24 +02:00
Veikka Tuominen
1f62e87031
fix formatting in translate-c test case
2021-02-23 10:53:25 +02:00