20276 Commits

Author SHA1 Message Date
Andrew Kelley
8edd7219c0 Sema: improve source location after as_node is used
+2 more passing compile error tests
2022-09-16 14:47:17 -04:00
Andrew Kelley
d3d24874c9 std: remove deprecated API for the upcoming release
See #3811
2022-09-16 14:46:53 -04:00
cod1r
7b32aacbaf fix ChildProcess crash when PATH is empty. 2022-09-15 22:54:17 -04:00
Andrew Kelley
2be72c719e ci: azure: macos: use an unstripped debug zig tarball
Hopefully will give us some insight into the spurious failures.

Follow-up from afba53f0f168365a9540a8c8bb39e85a44e0249c.
2022-09-15 13:56:18 -07:00
Andrew Kelley
9f4408d68b organize some compile error tests
Many of these tests check for the incorrect behavior of stage1 whereas
self-hosted correctly does not emit an error, so they are simply
deleted.

The remaining number of test cases within the stage1/ subdirectory is
reduced from 143 to 103.
2022-09-15 14:40:45 -04:00
Andrew Kelley
afba53f0f1 CI: swap out azure macos tarball for unstripped ReleaseSafe
Hopefully will give us some insight into the spurious failures.
2022-09-14 19:16:02 -07:00
Eric Joldasov
a86c7b13a3 docgen: add f80 to builtin types 2022-09-14 20:08:34 -04:00
Stephen Gregoratto
7ccb94fac8 Audit FreeBSD structs to match header files/ABI
The big outliers were `Stat` and `mcontext_t`. Also adds doc-comments
from the headers where possible.
2022-09-14 20:05:54 -04:00
alichraghi
8c9f468fdd std.ArrayList.ensureTotalCapacity: optimize and fix integer overflow
Fixes #12099
2022-09-14 20:05:15 -04:00
Andrew Kelley
78cd7b57ef
Merge pull request #12206 from koachan/sparc64-codegen
stage2: sparc64: Another batch of Air lowerings, bugfixes, etc.
2022-09-14 20:00:38 -04:00
Koakuma
86dc982e74 stage2: sparc64: Implement airSlicePtr 2022-09-14 16:58:13 -07:00
Koakuma
ed546a7aad stage2: sparc64: Add placeholder for some Air instructions
airAddSat airSubSat airMulSat airShlSat airUnaryMath airPopcount airPrefetch
airPtrElemVal airOptionalPayload airOptionalPayloadPtr airOptionalPayloadPtrSet
2022-09-14 16:58:13 -07:00
Koakuma
0910cb6fcb stage2: sparc64: Skip compile-failing tests for now 2022-09-14 16:58:12 -07:00
Koakuma
0e1c68d90a stage2: sparc64: Don't track condition_flags_inst in checked binOps
This stops the emission of spurious CCR spills.
2022-09-14 16:57:31 -07:00
Koakuma
0464512f2e stage2: sparc64: Implement airShlWithOverflow 2022-09-14 16:57:31 -07:00
Koakuma
de17fe66a5 stage2: sparc64: Tidy up binOp and enable more operations
sub, mul, addwrap, subwrap, mulwrap, shr, shr_exact
2022-09-14 16:57:31 -07:00
Koakuma
ab3d3b260b stage2: sparc64: Add airClz/airCtz placeholder 2022-09-14 16:57:31 -07:00
Koakuma
b9897c3b84 stage2: sparc64: Implement airMulOverflow for <= 32 bits 2022-09-14 16:57:31 -07:00
Koakuma
844d3a5a74 stage2: sparc64: Fix SPARCv9 shift opcodes encoding 2022-09-14 16:57:31 -07:00
Koakuma
2263bba6cd stage2: sparc64: Skip Sema-failing tests for now 2022-09-14 16:57:31 -07:00
Koakuma
61265fba04 stage2: sparc64: Implement airBinop for bool_and/or 2022-09-14 16:57:31 -07:00
Koakuma
4fc6df9f62 stage2: sparc64: Implement airTagName 2022-09-14 16:57:31 -07:00
Koakuma
f01867f78e stage2: sparc64: Implement airWrapOptional 2022-09-14 16:57:31 -07:00
Koakuma
b6307144c0 stage2: sparc64: Implement airPtrToInt 2022-09-14 16:57:31 -07:00
Koakuma
2c9ab03b0b stage2: sparc64: Add airCmpLtErrorsLen placeholder 2022-09-14 16:57:31 -07:00
Koakuma
5b0134e3ed stage2: sparc64: Change branch_link Mir field definition 2022-09-14 16:57:31 -07:00
Koakuma
64b61f0740 stage2: sparc64: Add airFloatToInt & airIntToFloat placeholder 2022-09-14 16:57:31 -07:00
Andrew Kelley
17596c79a9 stage2: fix compile error merge conflict
3250b20ceabea044bd4c7b1653d76d7069840058 had a silent merge conflict
with master branch; fixed now.
2022-09-14 16:41:53 -07:00
Jan Philipp Hafer
8cab0762d8 place zig-cache directory next to build.zig
* search upwards, if no build.zig is found
* if this fails or any error occurs, fallback to global zig-cache

Closes #11672
2022-09-14 19:39:25 -04:00
Manlio Perillo
3250b20cea src/print_env: print the native target
Add the native target triple to the zig env command output.

The target triple is formatted the same way as it is done in the
zig targets command.
2022-09-14 19:28:47 -04:00
Andrew Kelley
1d041d3a10
Merge pull request #11664 from vincenzopalazzo/macros/docs
docs: add missed docs for some language feature like `defer` and `errdefer`
2022-09-14 19:26:28 -04:00
Andrew Kelley
0931dda9a9
Merge pull request #11663 from matu3ba/utf16
std.unicode: add utf16 byte length and codepoints counting routines
2022-09-14 19:25:15 -04:00
Andrew Kelley
d7a0fe67b3 disable spuriously failing test on Windows
See tracking issue #12844
2022-09-14 16:12:55 -07:00
Andrew Kelley
d834b18011
Merge pull request #11633 from SpexGuy
Remove `std.testing.zig_exe_path` in favor of `ZIG_EXE` environment variable
2022-09-14 18:02:21 -04:00
Andrew Kelley
85b10eb07c ZIG_EXE envirnoment variable instead of testing build options
No longer introduce build options for tests. Instead, ZIG_EXE
environment variable is added to any invocation of `zig run` or `zig
test`.

The end result of this branch is the same: there is no longer a
mandatory positional command line argument when invoking zig test
binaries directly.
2022-09-14 14:56:45 -07:00
Martin Wickham
5523e2061b Move std.testing.zig_exe_path into build options 2022-09-14 14:42:58 -07:00
Andrew Kelley
61aaef0b07 std: re-enable test case for fixed bug
The miscompilation in question has been fixed upstream in LLVM 14.

closes #9879
2022-09-13 18:36:39 -07:00
Andrew Kelley
68f2d6cb24 std: remove workaround for fixed bug
The miscompilation in question has been fixed upstream in LLVM 13.

closes #8117
2022-09-13 18:20:18 -07:00
Andrew Kelley
0a89624d59 stage2: support being built in ReleaseSafe mode 2022-09-13 18:08:59 -07:00
Veikka Tuominen
349d78a443 validate number literals in AstGen 2022-09-13 20:26:04 -04:00
Andrew Kelley
716d9237cb Merge remote-tracking branch 'origin/llvm15'
Upgrade to LLVM 15
2022-09-13 15:39:19 -07:00
Andrew Kelley
fda6d44778 zig cc: do not enable the cache for link operations
This commit makes `zig cc` match the equivalent behavior of
`zig build-exe` with regards to caching. That is - it will cache
individual .c to .o compilations (with the usual exceptions), but will
always repeat the linking process so that incremental linking has a
chance to happen.

Perhaps a future enhancement will provide a way to get the old behavior,
but I suspect this new behavior will be preferred by everyone, because
it is closer to what C compilers do. Note that the old behavior can be
obtained by switching to `zig build-exe` instead of `zig cc` and using
the `--enable-cache` parameter.

Closes #12317
2022-09-13 14:10:13 -07:00
Andrew Kelley
0a4cfb81bc Merge remote-tracking branch 'origin/master' into llvm15 2022-09-13 13:50:25 -07:00
Andrew Kelley
f9859c102d fix libc++ exceptions for musl targets
This reverts commit d31be31267523cadd6d59b52633f2d4a9758a3b4.

The problem was happening due to an LLVM bug exposed by having LTO
enabled for libunwind. The simple workaround is to disable LTO for
libunwind. It can be re-enabled in the future when the upstream bug
is fixed.

See #12828
2022-09-13 11:38:14 -07:00
Andrew Kelley
c25ce5bba0
Merge pull request #12820 from ziglang/pointless-discard-error
introduce compile error for pointless discards
2022-09-13 13:01:42 -04:00
Andrew Kelley
b2e94de358 add compile error test for pointless discards 2022-09-13 10:01:17 -07:00
Luuk de Gram
be94487029
Merge pull request #12823 from Luukdegram/wasm-linker
wasm-linker: misc improvements & cleanups
2022-09-13 17:42:51 +02:00
Andrew Kelley
cdb40936bd properly annotate nullability of ZigLLVMCreateDebugForwardDeclType
This bug manifested as a segfault in stage1 when calling this function.
The C++ code looks like this:

```c++
entry->llvm_di_type = ZigLLVMCreateDebugForwardDeclType(g->dbuilder,
    ZigLLVMTag_DW_structure_type(), full_name,
    import ? ZigLLVMFileToScope(import->data.structure.root_struct->di_file) : nullptr,
    import ? import->data.structure.root_struct->di_file : nullptr,
    line);
```

There is actually no problem here - what happened is that because
cross-language LTO was enabled between zig and c++ code, and because
Zig annotated the file parameter (3rd line) as being non-null, the C++
code assumed that parameter could not be null, and eagerly dereferenced
`import->...`, causing a segfault, since it was null.

I verified that this commit fixed the problem and I also verified this
hypothesis by disabling LTO and noticing that it indeed avoided the
problem.
2022-09-13 03:09:29 -07:00
Andrew Kelley
ebd082d3f6 remove pointless discards in test cases 2022-09-13 02:04:20 -07:00
Andrew Kelley
bec70a1a39 stage2: remove pointless discards from source code
Good riddance!
2022-09-13 02:04:20 -07:00