Commit Graph

25834 Commits

Author SHA1 Message Date
Loris Cro
c481510c99 autodoc: show more doc comments for namespaces and types
previously, in the container view (the type of view that you see when
you look at `std` for example), when listing types and namespaces, we
would only show doc comments places on the direct child decl, which in
the case of the `std` namespace, for example, it's just a bunch of
re-exports.

now, if we don't find a direct doc comment, we chase indirection and
display doc comments placed directly on the definition, if any.

this is the precise priority order:

```
/// 1
pub const Foo = _Foo;

/// 2
const _Foo = struct {
   //! 3
};
```
The numbers show the priority order for autodoc.
2023-09-20 19:17:00 +02:00
Andrew Kelley
a63a1c5cb9
Merge pull request #17202 from ziglang/llvm17
Update to LLVM 17
2023-09-19 14:37:46 -07:00
Andrew Kelley
f9f9c4a083 clang bindings: fix APFloatBaseSemantics enum
This wasn't caught due to missing C++ static asserts for this enum. This
commit adds them and fixes the enum.
2023-09-19 09:37:53 -07:00
Andrew Kelley
c442fbf82a update libcxx to latest LLVM release/17.x
upstream commit 0176e8729ea4a2cff1ec6689c7620a9f37ce9904
2023-09-19 09:37:53 -07:00
Andrew Kelley
2145cc0dd1 disable failing test: standalone.c_compiler on aarch64-windows
Regressed by LLVM 17

Tracked by #16965
2023-09-19 09:37:53 -07:00
Andrew Kelley
3dfa0c8df1 c_compiler standalone test: use more descriptive exe names 2023-09-19 09:37:53 -07:00
Andrew Kelley
660b3e2090 langref: disable var args example on aarch64-windows
See tracking issues #14096 and #16961.

Also, any time a test is skipped it should link to the open bug report
for it.
2023-09-19 09:37:53 -07:00
Andrew Kelley
31ff6e3fc1 disable failing test: standalone.load_dynamic_library on aarch64-windows
Regressed by LLVM 17

Tracked by #16960
2023-09-19 09:37:53 -07:00
Andrew Kelley
e04bb4c007 disable failing test: standalone.shared_library on aarch64-windows
Regressed by LLVM 17

Tracked by #16959
2023-09-19 09:37:53 -07:00
Andrew Kelley
e36ec537f2 nvptx: omit sm_90a from the CPU target features for now
There seems to be an LLVM bug with this feature. Since it's new, let's
collect more information before adding it.
2023-09-19 09:37:53 -07:00
Andrew Kelley
fe63d15d07 CI: update all tarball URLs
These contain LLVM 17 as well as a fix to zig to add
`-fno-sanitize=function` to the clang command line.
2023-09-19 09:37:53 -07:00
Andrew Kelley
5d92cc8cf6 skip all mips tests due to LLVM 17 regressions
Tracked by #16846
2023-09-19 09:37:53 -07:00
Andrew Kelley
5b8af7a2a9 skip regressed LLVM 17 std lib test on powerpc
Tracked by #16951
2023-09-19 09:37:53 -07:00
Andrew Kelley
66312c0b51 clang: -fno-sanitize=function workaround
It is very common, and well-defined, for a pointer on one side of a C ABI
to have a different but compatible element type. Examples include:

- `char*` vs `uint8_t*` on a system with 8-bit bytes
- `const char*` vs `char*`
- `char*` vs `unsigned char*`

Without this flag, Clang would invoke UBSAN when such an extern
function was called.

Might be nice to file an upstream issue and find out if there is a more
precise way to disable the problematic check.
`-fsanitize-cfi-icall-generalize-pointers` looks promising according to
the documentation, but empirically it does not work.
2023-09-19 09:37:53 -07:00
Andrew Kelley
75b8b21cc1 CI: update bootstrap tarballs to latest
Updates llvm libraries to 17.0.0rc3 which contain bug fixes that
affected the zig test suite.
2023-09-19 09:37:53 -07:00
Andrew Kelley
9e21e16f6d re-enable passing behavior test
See #16797 - it was fixed in the most recent LLVM 17 release candidate.
2023-09-19 09:37:53 -07:00
Andrew Kelley
1df4efc4bc disable failing wasm linking tests
These started failing after the LLVM 17 upgrade.

See tracking issues #16937 and #16938
2023-09-19 09:37:53 -07:00
Andrew Kelley
3acf0f637e disable failing mips tests due to LLVM 17 regressions
tracked by #16846
2023-09-19 09:37:53 -07:00
Andrew Kelley
cd6a236279 libcxx: update for llvm 17.0.0rc3 2023-09-19 09:37:53 -07:00
Jacob Young
8a9f8a1d77 behavior: disable another test regressed by LLVM 17 for mips
Tracked by #16846
2023-09-19 09:37:53 -07:00
Jacob Young
401de6dd2f compiler_rt: fix arm hard-float f16 abi
Closes #16848
2023-09-19 09:37:53 -07:00
Jacob Young
17e3fcc3a5 compiler_rt: fight off @as invasion
Importantly, fixes incorrectly annotated types in `__aeabi_?2h`.
2023-09-19 09:37:52 -07:00
Jacob Young
d65318847f compiler_rt: fix fp sub being optimized to call itself
Closes #16844
Reduces #16846
2023-09-19 09:37:52 -07:00
Andrew Kelley
8219711063 disable behavior tests regressed by LLVM 17
See #16844
See #16845
See #16846
See #16848
2023-09-19 09:37:50 -07:00
Jacob Young
b1b155feac llvm: update riscv floating-point c abi for LLVM 17 2023-09-19 09:37:32 -07:00
Jacob Young
d7daf7c203 start: workaround for LLVM 17 regression
Tracking issue #16799
2023-09-19 09:37:32 -07:00
Jacob Young
39f1d96a2f behavior: disable test that regressed with LLVM 17
Tracking issue #16797
2023-09-19 09:37:32 -07:00
Jacob Young
3506bc61b7 llvm: update data layout computation to LLVM 17 2023-09-19 09:37:32 -07:00
Jacob Young
cad594372e llvm: update address space definitions to LLVM 17 2023-09-19 09:37:32 -07:00
Andrew Kelley
749b88c7f3 CI: enable for llvm17 branch 2023-09-19 09:37:32 -07:00
Andrew Kelley
0bd1058d5a CI: update x86_64-linux tarball 2023-09-19 09:37:32 -07:00
Andrew Kelley
78e95e1062 update LLVM static library list to 17
release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8
2023-09-19 09:37:32 -07:00
Jacob Young
05e01301b0 Builder: further constant select cleanup 2023-09-19 09:37:32 -07:00
Andrew Kelley
8366d53499 zig cc: update clang CLI data to LLVM 17
release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8
2023-09-19 09:37:32 -07:00
Andrew Kelley
5d4439cc3e libcxx: update to LLVM 17
release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8

This adds the flag `-D_LIBCPP_PSTL_CPU_BACKEND_SERIAL`. A future
enhancement could possibly pass something different if there is a
compelling parallel implementation. That libdispatch one might be worth
looking into.
2023-09-19 09:37:31 -07:00
Andrew Kelley
9ddfacd8e6 libcxxabi: update to LLVM 17
release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8
2023-09-19 09:37:31 -07:00
Andrew Kelley
571a4c86c3 libunwind: update to LLVM 17
release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8
2023-09-19 09:37:31 -07:00
Andrew Kelley
6a07b7024a LLVM: update backend to LLVM 17
* LLVMConstSelect is removed (see
   https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179)
 * a couple functions use uint64_t instead of int now which means we
   no longer need `@intCast`.

release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8
2023-09-19 09:37:31 -07:00
Andrew Kelley
62a12e0631 LLVM 17 std lib updates and fixes
* some manual fixes to generated CPU features code. in the future it
   would be nice to make the script do those automatically. I suspect
   the sm_90a thing is a bug in LLVM.
 * add liteos to various target OS switches. I know nothing about this
   OS; someone will need to work specifically on support for this OS
   when the time comes to support it properly in zig.
 * while waiting for the compiler, I went ahead and made more
   conservative choices about when to use `inline` in std/Target.zig
2023-09-19 09:37:31 -07:00
Andrew Kelley
1861036f3b update C language headers to LLVM 17
release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8
2023-09-19 09:37:31 -07:00
Andrew Kelley
3ed40b1140 update CPU features to LLVM 17
release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8
2023-09-19 09:37:31 -07:00
Andrew Kelley
1c7adf5064 update zig_clang C++ API wrapper bindings to LLVM 17
release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8
2023-09-19 09:37:31 -07:00
Andrew Kelley
cd8234c3ba update for LLVM 17 new target data
New OSs:
* UEFI
* LiteOS

New ABI:
* OpenHOS

Also update the LLD driver API wrappers.
2023-09-19 09:37:30 -07:00
Andrew Kelley
dbf8fb7843 llvm-ar patch: update main function 2023-09-19 09:37:30 -07:00
Andrew Kelley
d123c70d5f clang patch: update main function 2023-09-19 09:37:30 -07:00
Andrew Kelley
68a338cc10 update ar and clang C++ files to LLVM 17 2023-09-19 09:37:30 -07:00
Andrew Kelley
3882ce4f4b update cmake files to LLVM 17 2023-09-19 09:37:26 -07:00
r00ster91
ee4ced9683 write function types consistently with a space before fn keyword
Currently, the compiler (like @typeName) writes it `fn(...) Type` but
zig fmt writes it `fn (...) Type` (notice the space after `fn`).
This inconsistency is now resolved and function types are consistently
written the zig fmt way. Before this there were more `fn (...) Type`
occurrences than `fn(...) Type` already.
2023-09-19 15:15:05 +03:00
Andrew Kelley
3e79315d19 x86 backend: don't read bogus safety flag
Safety is not a global flag that should be enabled or disabled for all
stores - it's lowered by the frontend directly into AIR instruction
semantics. The flag for this is communicated via the `store` vs
`store_safe` AIR instructions, and whether to write 0xaa bytes or not
should be decided in `airStore` and passed down via function parameters.

This commit is a step backwards since it removes functionality but it
aims our feet towards a better mountain to climb.
2023-09-19 00:43:21 -07:00
Jay Petacat
f91ff9a746 translate-c: Struct fields default to zero value
C99 introduced designated initializers for structs. Omitted fields are
implicitly initialized to zero. Some C APIs are designed with this in
mind. Defaulting to zero values for translated struct fields permits Zig
code to comfortably use such an API.

Closes #8165
2023-09-18 23:09:47 -07:00