Jacob Young
a66cd54f94
llvm: cleanup even more unused LLVM API bindings
2023-08-08 21:32:50 -04:00
Jacob Young
a0cb03ed99
llvm: finish converting instructions
2023-08-08 21:32:50 -04:00
Jacob Young
49cc1bff08
llvm: finish converting intrinsics
2023-08-08 21:32:50 -04:00
Jacob Young
6577f52614
llvm: convert vector reduction intrinsics
...
Scratch that thing I said about one pass. :)
2023-08-08 21:32:50 -04:00
Jacob Young
e1efd4d3c2
Builder: simplify intrinsic table
...
This format removes back-references allowing it to be parsed in a single
pass. It also reduces the number of kinds, simplifying the code.
2023-08-08 21:32:50 -04:00
Jacob Young
5b79f08ee8
llvm: finish converting attributes to use Builder and the C LLVM API
2023-08-08 21:32:50 -04:00
Jacob Young
b63d9745b5
llvm: convert intrinsics to using Builder
2023-08-08 21:32:50 -04:00
Jacob Young
3ebf8ce970
Builder: fix builtin pseudo-instruction dumping
2023-08-08 21:32:50 -04:00
Jacob Young
f938404a45
Builder: fix attribute spacing
2023-08-08 21:32:50 -04:00
Philipp Lühmann
d34201c849
std.json: stringify enum literals ( #16742 )
2023-08-08 23:26:46 +00:00
Andrew Kelley
36c57c3ba1
Merge pull request #16707 from marler8997/jsonStringifyBigNumbers
...
std.json: fix roundtrip stringify for large integers
2023-08-08 12:08:21 -07:00
Andrew Kelley
ac95cfe449
Merge pull request #16721 from hryx/stage1-coverage
2023-08-06 21:57:22 -07:00
Stevie Hryciw
2ad6ca581d
Add behavior test for copying self-referential struct
...
Closes #6312 . In the C++ implementation this caused a stack overflow
from infinite recursion during analysis.
2023-08-06 18:23:28 -07:00
Stevie Hryciw
16dcefaca5
Add compile error test for comptime slice-of-struct copy
...
Closes #6305 . In the C++ implementation this hit a compiler assertion.
It is handled properly in the self-hosted version.
2023-08-06 18:11:49 -07:00
Stevie Hryciw
6bba5a39e4
Add behavior test for ptrCast on function pointer
...
Closes #6280 . In the C++ implementation this triggered a
compiler assertion.
2023-08-06 18:09:41 -07:00
Zachary Raineri
49244dc0ca
std: remove some unused imports ( #16710 )
2023-08-06 15:18:50 -04:00
Loris Cro
373e48c983
autodoc: new layout ( #16715 )
...
* autodoc: init guide TOC work
* autodoc: working guides toc navigation
* autodoc: more improvements
* autodoc: ui refinements
* autodoc: new layout and init descriptions for namespaces in std.zig
2023-08-06 18:12:05 +02:00
Jonathan Marler
2046880de8
std.json: josh review fixes
...
* renamed enum_big_numbers_quoted option to enum_nonportable_numbers_as_strings
* updated stringify doc to mention the option
I also reversed the logic to determine whether an integer is nonportable,
it seemed easier to reason about.
I also took a stab at applying the new option to floats, but, I got stuck
at trying to print large floats, not sure if Zig supports that yet.
2023-08-06 09:25:21 -06:00
Jacob Young
1cce539ddc
json.stringify: properly implement RFC8259 recommendation
...
The previous magic numbers used `1 << 52`, which did not account for the
implicit leading one in the floating point format. The RFC is correct
when it uses an exponent of 53. Technically these exclusive endpoints
are also representable, but everyone including the RFC seems to use them
exclusively.
Also, delete special case optimizations related to the type which have
already been implemented in the zig compiler to produce comptime values
for tautological runtime comparisons.
2023-08-06 00:35:10 -04:00
Jonathan Marler
7dacf77745
std.json: fix roundtrip stringify for large integers
...
std.json follows interoperability recommendations from RFC8259 to limit
JSON number values to those that fit inside an f64. However, since Zig
supports arbitrarily large JSON numbers, this breaks roundtrip data
congruence.
To appease both use cases, I've added an option `emit_big_numbers_quoted`
to StringifyOptions. It's disabled by default which preserves roundtrip
but can be enabled to favor interoperability.
2023-08-05 21:56:00 -06:00
Jacob Young
1c7798a3cd
Merge pull request #16705 from antlilja/builder-intrinsics
...
Implement more intrinsics in new LLVM IR builder API and remove uses of LLVM owns API
2023-08-05 23:05:02 -04:00
Robin Voetter
68f84964b3
llvm: add const addrspace cast
2023-08-05 17:11:57 -07:00
antlilja
e149f1e1de
Use new LLVM IR builder API in bit op lowering
2023-08-06 01:46:57 +02:00
antlilja
86f61a9d26
Implement bitop intrinsics in new LLVM IR builder
...
* llvm.bitreverse
* llvm.bswap
* llvm.ctpop
* llvm.ctlz
* llvm.cttz
2023-08-06 01:46:57 +02:00
antlilja
2b4ac7c6b3
Use new LLVM builder API in buildFloatOP
2023-08-06 01:46:56 +02:00
antlilja
63dcffdf9f
Implement fp intrinsics in new LLVM IR builder
...
Intrinsics implemented
* llvm.ceil
* llvm.cos
* llvm.exp
* llvm.exp2
* llvm.fabs
* llvm.floor
* llvm.log
* llvm.log10
* llvm.log2
* llvm.round
* llvm.sin
* llvm.trunc
* llvm.fma
2023-08-06 01:46:51 +02:00
Jacob Young
b8c9d5ae98
cbe: don't emit traps in naked functions
...
Closes #16680
2023-08-05 16:44:56 -07:00
none
f3fbdf2b44
wyhash: keep tail bytes on iterative update
...
Update calls with input longer then one block must ensure that
last sixteen bytes are available when final is called.
Fixes #16695
2023-08-05 15:30:50 -07:00
Ryan Liptak
90fde14c5f
std.testing.expectEqualSlices: On failure, print address for pointer types
...
When comparing slice elements, `std.meta.eql` is used which only compares pointer address and length to determine equality for pointer types. This previously led to confusing results where `expectEqualSlices` would appear to fail on seemingly equal slices (judging by the output of `expectEqualSlices`. For example:
try testing.expectEqualSlices(
[]const i64,
&[_][]const i64{ &[_]i64{ 1, 2, 3 }, &[_]i64{ 5, 5, 5 } },
&[_][]const i64{ &[_]i64{ 1, 2, 3 }, &[_]i64{ 5, 5, 5 } },
);
Previously, this would result in:
============ expected this output: ============= len: 2 (0x2)
[0]: { 1, 2, 3 }
[1]: { 5, 5, 5 }
============= instead found this: ============== len: 2 (0x2)
[0]: { 1, 2, 3 }
[1]: { 5, 5, 5 }
================================================
After this commit, it will result in:
============ expected this output: ============= len: 2 (0x2)
[0]i64@7ff7e2773758: { 1, 2, 3 }
[1]i64@7ff7e2773770: { 5, 5, 5 }
============= instead found this: ============== len: 2 (0x2)
[0]i64@7ff7e2773788: { 1, 2, 3 }
[1]i64@7ff7e27737a0: { 5, 5, 5 }
================================================
2023-08-05 11:54:26 -07:00
Jacob Young
a91a8df679
Sema: fix issues passing an invalid type to a generic method
...
Closes #16601
2023-08-05 11:21:50 -07:00
Prcuvu
fc6e575684
cmake: Fix typo: elif → elseif
2023-08-04 15:24:07 -07:00
Andrew Kelley
e7ba4b7f94
update .mailmap
2023-08-04 11:01:18 -07:00
David Gonzalez Martin
9c05810be6
debug: expose module debug info deinitialization
...
Before this commit, you could use readElfDebugInfo independently with
one catch: the data is not freed since the deinitialization functions
for ModuleDebugInfo are private. This change makes them public so the
users of such function and similar can free the memory after the
debug symbols have been used.
2023-08-04 09:24:11 +02:00
Jeremy Volkman
516eb33442
Fix typo: headerpat -> headerpad
2023-08-04 09:20:45 +02:00
Andrew Kelley
a327d8b995
start the 0.12.0 release cycle
2023-08-03 11:22:40 -07:00
Andrew Kelley
67709b6382
Release 0.11.0
0.11.0
2023-08-03 11:22:03 -07:00
Krzysztof Wolicki
b317ca4d6f
autodoc: Added line_comment tokens to ziglexer.js tokenizer
2023-08-03 19:07:33 +02:00
Andrew Kelley
c4e62be62e
Merge pull request #16058 from ziglang/frontend-lib-paths
...
compiler: resolve library paths in the frontend
2023-08-03 09:53:18 -07:00
Andrew Kelley
d0fd67cffe
std.zig.system.NativePaths: remove bad framework dir
...
This path actually has nothing useful in it.
2023-08-03 09:52:15 -07:00
Jakub Konka
f96d773d98
macho: append syslibroot to search dirs when resolving libSystem
2023-08-03 09:52:15 -07:00
Andrew Kelley
72fb58f107
CLI: fix a typo that made static/dynamic do the opposite
2023-08-03 09:52:15 -07:00
Andrew Kelley
4923e64199
Compilation: detect sysroot from libc installation
2023-08-03 09:52:15 -07:00
Andrew Kelley
4089f96def
darwin: pass -iframework to clang for system frameworks
2023-08-03 09:52:15 -07:00
Andrew Kelley
9dd9aa49a5
Compilation: fix incorrect non-optional assumption
2023-08-03 09:52:15 -07:00
Andrew Kelley
7360927afe
CLI: add native paths only if ABI is also native
2023-08-03 09:52:15 -07:00
Andrew Kelley
c012f5d55d
std.zig.system.darwin.isSdkInstalled: fix implementation
...
* don't assert that the child process doesn't crash
* don't give a false negative on warnings printed to stderr
Also fix getSdk from the same file in the same way
2023-08-03 09:52:15 -07:00
Andrew Kelley
e582a3642b
std.zig.system.darwin: fix redundant names
2023-08-03 09:52:15 -07:00
Andrew Kelley
da91ef5c28
zig libc: restore functionality on macOS
...
Regressed in 2006add8496c47804ee3b6c562f420871cb4ea0a.
References to native_darwin_sdk are no longer kept in the frontend.
Instead the darwin SDK is detected as part of NativePaths and as part of
LibCInstallation.
2023-08-03 09:52:15 -07:00
Andrew Kelley
c94bbebb91
std.zig.system.NativePaths: simplify and integrate with Darwin SDK
2023-08-03 09:52:15 -07:00
Andrew Kelley
ea0e6e737b
CLI: reduce code size bloat
...
Make a bunch of ArrayList objects use arena instead of gpa, eliminating
the `defer` expressions, which reduces code size of zig1.wasm by 1%
2023-08-03 09:52:15 -07:00