4985 Commits

Author SHA1 Message Date
Veikka Tuominen
593d23c0d7 stage2: get formatted printing (somewhat) working 2022-02-27 10:05:29 +02:00
Al Hoang
db82c1b982 add constant for haiku
* re-enable zig build on haiku
2022-02-26 10:53:13 +02:00
Endel Dreyer
cd9a6fed4f fix typo on Thread's getHandle docs 2022-02-26 10:48:37 +02:00
protty
5d30e8016d
time: introduce Instant (#10972) 2022-02-24 18:51:44 -05:00
Isaac Freund
52a2aa11e2 std: work around current packed struct situation
As of 6249a24, align() is not allowed on packed struct fields
and as such the align(4) was removed from the first field of
EdidOverrideProtocolAttributes. The endgame here is packed struct
backed by explicit integers, in this case a u32, but until that
is implemented put the align(4) on the pointer to avoid breaking
someone's UEFI code in a hard to debug way.
2022-02-24 16:08:37 -05:00
Andrew Kelley
5ab5e2e673 Revert "Merge pull request #10950 from hexops/sg/responsefiles"
This reverts commit 136a43934bc08dc3aee85f1182904b97456601d3, reversing
changes made to 9dd839b7ed15d1191f3303d069cffe0473e03e83.

This broke the behavior of `zig run`.
2022-02-24 12:11:11 -07:00
Andrew Kelley
6249a24e81 stage2: integer-backed packed structs
This implements #10113 for the self-hosted compiler only. It removes the
ability to override alignment of packed struct fields, and removes the
ability to put pointers and arrays inside packed structs.

After this commit, nearly all the behavior tests pass for the stage2 llvm
backend that involve packed structs.

I didn't implement the compile errors or compile error tests yet. I'm
waiting until we have stage2 building itself and then I want to rework
the compile error test harness with inspiration from Vexu's arocc test
harness. At that point it should be a much nicer dev experience to work
on compile errors.
2022-02-23 23:59:25 -07:00
Jakub Konka
136a43934b
Merge pull request #10950 from hexops/sg/responsefiles
Do not fail to build if 'zig build-lib' etc. arguments exceed OS limits
2022-02-23 22:54:25 +01:00
Jakub Konka
9dd839b7ed
Merge pull request #10976 from ziglang/x64-macos-fixes
x64: print test runner results on macos
2022-02-23 22:40:06 +01:00
Jan Philipp Hafer
5d89955543 compiler_rt: specify goals, organize README and compiler_rt.zig
* goals
  - zig as linker for object files generated by other compilers
  - zig-specific runtime features for eventual standardisation

* changes
  - missing routines are marked with `missing`
  - structure inspired by libgcc docs, but improved order and wording
  - rename misspelled functions
  - reorder and rephrase compiler_rt.zig to reflect documentation
  - potential decimal float or fixed-point arithmetic support:
    * 'Decimal float library routines' ca. 120 functions
    * 'Fixed-point fractional library routines' ca. 300 functions

thanks to @Vexu for multiple reviews and @scheibo for review
2022-02-23 16:38:51 -05:00
Andrew Kelley
ecf56d85ef
Merge pull request #10969 from Vexu/stage2
stage2: fn typeinfo params
2022-02-23 16:10:17 -05:00
Jakub Konka
b7760ad742 std: re-enable result printing in the test runner for macos 2022-02-23 19:39:50 +01:00
Evan Haas
9716a1c3ab translate-c: Add support for cast-to-union
Fixes #10955
2022-02-23 14:11:46 +02:00
Veikka Tuominen
92beb2b490 stage2: misc fixes in Sema 2022-02-23 10:40:40 +02:00
xReveres
b2805666a7 stage1-wasm: implement shared memory 2022-02-23 08:57:20 +01:00
Veikka Tuominen
f8154905e7 stage1: rename TypeInfo.FnArg to Fn.Param 2022-02-23 09:44:36 +02:00
Felix Queißner
6fdcf1ad2d
std.os.linux.socketpair: fd is an out parameter 2022-02-23 09:32:54 +02:00
Jakub Konka
8abd30019c x64: completely ignore printing tests on macos until I fix the linker 2022-02-22 21:57:44 +01:00
Jakub Konka
d657ede324 x64: disable printing results on macos until I fix the linker
Hopefully, this will make the CI green, and in the meantime I can
fix the bugs in the MachO linker.
2022-02-22 21:57:44 +01:00
Jakub Konka
a94267b290 std: export ceil builtins in stage2 2022-02-22 21:56:34 +01:00
Jakub Konka
150006d216 std: enable print results in test_runner for stage2_x86_64 2022-02-22 21:56:34 +01:00
Motiejus Jakštys
e620b692c6 [std.ArrayList] return explicit errors
All errors from std.ArrayList are allocation errors. Mark them as such.
This is helpful when one wants to obtain a function pointer.
2022-02-22 13:57:51 -05:00
Stephen Gutekanst
efd473bbfc std: Builder: use response files for zig test invocations too
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-02-21 13:06:23 -07:00
Stephen Gutekanst
9c1c4747f4 std: Builder: account for null term considering response files
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-02-21 12:58:13 -07:00
gwenzek
628e9e6d04
enable Gpu address spaces (#10884) 2022-02-21 14:05:27 -05:00
Ali Chraghi
a4df443f96 Update Tokenizer Dump Function
fix missed `loc` field
2022-02-20 17:47:42 -05:00
Stephen Gutekanst
2bd10f4db9 std: have Builder use response files if zig build args exceed OS limits
In Mach engine we're seeing command line arguments to `zig build-lib`
exceed the 32 KiB limit that Windows imposes, due to the number of
sources and compiler flags we must pass in order to build gpu-dawn.

This change fixes the issue by having `Builder` check if the arguments
to a `zig build-*` command are >30 KiB and, if so, writes the arguments
to a file `zig-cache/args/<SHA2 of args>`. Then the command invocation
merely becomes `zig build-lib @<that file>`.

Fixes #10693

Fixes hexops/mach#167

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-02-20 14:44:39 -07:00
Veikka Tuominen
65aa333197 fix formatting in openbsd.zig
CI was failing for unrelated reasons so this went unnoticed
2022-02-20 11:58:42 +02:00
Dante Catalfamo
ec59a04138
Add OpenBSD auth functions 2022-02-20 09:58:58 +02:00
Andrew Kelley
8841a71aa6 AstGen: evaluate comptime var init expressions in a comptime context 2022-02-19 15:11:18 -07:00
Lee Cannon
b0cdd3d0e6 StackIterator should not try to check validity on freestanding 2022-02-19 15:38:56 -05:00
Veikka Tuominen
2f0204aca3 parser: fix "previous field here" pointing to wrong field 2022-02-19 10:15:54 +02:00
Andrew Kelley
2e1c16d649
Merge pull request #10924 from ziglang/air-independence-day
AIR independence day
2022-02-19 02:57:48 -05:00
Andrew Kelley
123076ea88 ArrayList: add unusedCapacitySlice to the unmanaged API
This function is super nice thank you whoever added it 👍
2022-02-18 19:35:39 -07:00
Cody Tapscott
ef417f19e1 stage2: Implement @bitReverse and @byteSwap
This change implements the above built-ins for Sema and the LLVM
backend. Other backends have had placeholders added for lowering.
2022-02-18 14:28:32 -07:00
Lee Cannon
dee96e2e2f
std.testing.refAllDecls: force decl to be analyzed with just @field
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-02-18 21:21:21 +02:00
Andrew Kelley
2c24bf2f79
Merge pull request #10604 from fifty-six/master
std/os/uefi: additional improvements/fixes
2022-02-18 14:16:30 -05:00
Andrew Kelley
736b9dcdd6
Merge pull request #10858 from topolarity/stage2-bitcast
stage2 sema: Fix sign handling of exotic integers in `@bitCast`
2022-02-18 13:49:00 -05:00
chip2n
ab43c045ed Fix incorrect documentation for std.HashMap.remove() 2022-02-18 13:47:38 -05:00
Veikka Tuominen
53241f288e
Merge pull request #10913 from Vexu/err
further parser error improvements
2022-02-18 13:53:47 +02:00
J87
b837855317 Replace magic numbers with clearer representation
Replaces two magic numbers with the procedure used to generate them, in order to keep consistent with other implementations for f64 & f128.
2022-02-17 21:20:04 -05:00
Andrew Kelley
5aa35f62c3 Revert "reduce build error noise"
This reverts commit baead472d7641bdd96130354bafadc1fb1ed223b.

Let's go through the proposal process on this one. I want to push back
on this. My position is that, at the very least, a full trace of command
lines of sub-processes should be printed on failure, with the exception
of opt-in flags such as `--prominent-compile-errors`.
2022-02-17 14:30:12 -07:00
Veikka Tuominen
6b65590715 parser: add notes to decl_between_fields error 2022-02-17 22:16:26 +02:00
Andrew Kelley
63cbec1a96 stage2: add more functions to freestanding libc
The log functions are not passing behavior tests.
2022-02-17 13:11:58 -07:00
Veikka Tuominen
92f2767814 parser: add error for missing colon before continue expr
If a '(' is found where the continue expression was expected and it is
on the same line as the previous token issue an error about missing
colon before the continue expression.
2022-02-17 20:51:26 +02:00
Jonathan Marler
baead472d7 reduce build error noise
Address https://github.com/ziglang/zig/issues/3477
This provides a mechanism for builds to fully report an error to the user and prevent zig from piling on extra noise.
2022-02-17 14:48:22 +02:00
Veikka Tuominen
35e989235b parser: get rid of "invalid token" error 2022-02-17 14:23:42 +02:00
Veikka Tuominen
9c36cf92f0 parser: make some errors point to end of previous token
For some errors if the found token is not on the same line as
the previous token, point to the end of the previous token.
This usually results in more helpful errors.
2022-02-17 14:23:35 +02:00
iddev5
77e5b042a0 fmt: allow uppercase prefix to be parsed in std.fmt.parseInt()
std.fmt.parseHexFloat allow both 0x and 0X as prefix, so in order to
keep things consistent. This commit modifies std.fmt.parseWithSign to
check for the prefix case insensitively in order to allow both upper
case and lower case prefix.

This change now allows: 0O, 0B and 0X as prefixes for parsing.
2022-02-16 11:27:10 +01:00
Veikka Tuominen
cf5009f9af
Merge pull request #10003 from viriuwu/nt-thread-name
std.Thread.getName/setName: rework windows implementation
2022-02-15 13:23:09 +02:00