Commit Graph

3643 Commits

Author SHA1 Message Date
Andrew Kelley
0b58b61799 Merge remote-tracking branch 'origin/master' into llvm12
Conflicts:
 * src/clang.zig
 * src/llvm.zig
   - this file got moved to src/llvm/bindings.zig in master branch so I
     had to put the new LLVM arch/os enum tags into it.
 * lib/std/target.zig, src/stage1/target.cpp
   - haiku had an inconsistency with its default target ABI, gnu vs
     eabi. In this commit we make it gnu in both places to match the
     latest changes by @hoanga.
 * src/translate_c.zig
2021-02-25 21:04:23 -07:00
Andrew Kelley
4360f45d7f std.os: remove special case for haiku
This is an accident from a merge conflict introduced in
7edb204edf.

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
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
Hubert Jasudowicz
3c0238e731 std/build: Add support for LTO configuration 2021-02-25 22:25:42 +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
9b8a94265a zig fmt: fix extern function with missing param name
Regressed in d7049fc8e0.
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
9ada7638a5 zig fmt: function with labeled block as return type 2021-02-24 16:42:46 -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 bf642204b3 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
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
Andrew Kelley
1e3a200ba6 zig fmt: array literal with hint
This regresses the test case of `zig fmt` deleting empty line comments.
Two open questions here:

 * What should the rules be about deleting empty line comments?
   It makes sense usually, but for array initization, empty line
   comments cause a line break, affecting the row/column alignment.
   Perhaps we should therefore respect all empty line comments?
   Or should we special case array initializations?

 * If we decide to special case some kinds of line comments to respect
   them (which is status quo!), how should that be implemented?
2021-02-22 23:25:12 -07:00
Andrew Kelley
1253903fef zig fmt: struct literal containing a multiline expression
I modified this test case to expect different results.

Now, the trailing comma on a list of struct fields is the only deciding
factor, not whether or not the field init expressions contain a newline.
2021-02-22 21:33:21 -07:00
Andrew Kelley
8379fff804 zig fmt: alignment in anonymous literal 2021-02-22 21:04:22 -07:00
Andrew Kelley
a6038f0375 zig fmt: function params should align nicely 2021-02-22 18:17:26 -07:00
Andrew Kelley
fec51ad7c5 zig fmt: while 2021-02-22 17:55:19 -07:00
Andrew Kelley
20cfa0b5b6 zig fmt: if condition has line break, no fn call comma 2021-02-22 17:34:30 -07:00
Andrew Kelley
ec987a7a46 zig fmt: if condition has line break but must not wrap 2021-02-22 16:39:50 -07:00
Andrew Kelley
b301999cd3 zig fmt: if condition wraps 2021-02-22 16:21:19 -07:00
Andrew Kelley
253906fb93 zig fmt: 2nd arg multiline string 2021-02-22 16:00:21 -07:00
Isaac Freund
45634851de
zig fmt: fix firstToken() for extern fn_protos 2021-02-22 23:51:54 +01:00
Isaac Freund
550688f427
zig fmt: insert trailing comma in switches 2021-02-22 23:51:54 +01:00
Isaac Freund
f3ee10b454
zig fmt: fix comments ending with EOF after decls
Achieve this by reducing the amount of special casing to handle EOF so
that the already correct logic for normal comments does not need to be
duplicated.
2021-02-22 18:32:37 +01:00
Isaac Freund
ce9b3ee0f9
parser: anytype is not a vaild return type 2021-02-22 17:38:09 +01:00
Isaac Freund
34c08a91d5
zig fmt: fix formatting of parser tests 2021-02-22 17:37:17 +01:00