[lldb][CommandObjectType] Print name of Python class when emitting warning about invalid synthetic provider (#181829)
Before:
```
(lldb) type synthetic add -l blah foo
warning: The provided class does not exist - please define it before attempting to use this synthetic provider
```
After:
```
(lldb) type synthetic add -l blah foo
warning: The provided class 'blah' does not exist - please define it before attempting to use this synthetic provider
```
Useful when many of these registration commands happen as part of
`~/.lldbinit`. Previously it wasn't immediately obvious which of those
commands failed.
[clang][ARM] Refactor argument handling in `EmitAArch64BuiltinExpr` (2/2) (NFC)
Refactor `EmitAArch64BuiltinExpr` so that all AArch64/NEON builtins
handled by this hook _and marked as overloaded_ share a common path
for generating LLVM IR arguments (collected into the `Ops`
`SmallVector<Value*>`) (*). This is a follow-up for #181794 - please
refer to that PR for more context.
As in the previous PR, the key change is implemented in
`HasExtraNeonArgument` , i.e. in the hook that identifies Builtins with
the extra argument. In this PR, I am replacing the ad-hoc switch
statement with a more principled approach borrowed from SemaARM.cpp,
namely:
```cpp
uint64_t mask = 0;
switch (BuiltinID) {
#define GET_NEON_OVERLOAD_CHECK
#include "clang/Basic/arm_fp16.inc"
#include "clang/Basic/arm_neon.inc"
[28 lines not shown]
config: add config_write_array() magic
With this we can insert new entries without the need to grab the entry
beforehand using config_read_array().
config_write_array('foo', 'bar', 'hello');
becomes
<foo>
<bar>hello</bar>
</foo>
[Toolchains][FreeBSD] Honor system libgcc
On Linux, the system libgcc may act as the compiler runtime, and Clang
provides -rtlib=compiler-rt to switch implementations.
FreeBSD ships libcompiler_rt.a (LLVM’s builtins) in the base system,
with libgcc.a as a symlink to it. These libraries are linked via -L and
-lgcc.
An interesting detail is that even if the Clang resource directory
(llvm-xx/lib/clang/xx) appears before the system path in the search
order, it is still not used. This is because the linker looks for
libgcc.a rather than libclang_rt.builtins.a.
Since FreeBSD does not currently support -rtlib, honor the system libgcc
by hardcoding its path. Detect and handle cases where a custom
compiler-rt is injected via -L as an override workaround.
[clang][ARM] Refactor argument handling in `EmitAArch64BuiltinExpr` (1/2) (NFC)
Refactor `EmitAArch64BuiltinExpr` so that all AArch64/NEON builtins
handled by this hook _and marked as non-overloaded_ share a common path
for generating LLVM IR arguments (collected into the `Ops`
`SmallVector<Value*>`) (*)
Previously, the argument emission loop unconditionally skipped the
trailing argument:
```cpp
for (unsigned i = 0, e = E->getNumArgs() - 1; i != e; ++i)
```
This was originally intended to ignore the extra Sema-only argument
used by overloaded NEON builtins (e.g. the type discriminator passed
by `__builtin_neon_*` intrinsics). However, this logic was applied
unconditionally.
[37 lines not shown]
17728 hasmntopt should take const pointers
Reviewed by: Dan McDonald <danmcd at edgecast.io>
Reviewed by: Andy Fiddaman <illumos at fiddaman.net>
Approved by: Gordon Ross <gordon.w.ross at gmail.com>
[libc++] Fix FreeBSD atomic timed wait system call (#180400)
This PR fixes atomic timed wait on FreeBSD platforms.
When we added timed wait support, on FreeBSD platform, we were looking
only the `UMTX_OP_WAIT` section of the FreeBSD doc
https://man.freebsd.org/cgi/man.cgi?query=_umtx_op&apropos=0&sektion=2&manpath=FreeBSD+16.0-CURRENT&format=html
. Somehow we missed the generic section that describes the timeout
parameter that applies to all operations. As a consequence, we missed
the part that the FreeBSD is expecting the `size` to be casted to
`uintptr_t`, then passed in to the `void*` parameter.
This PR fixes the issue by casting the type to what the system requires.
As drive by, this PR also
- uses simple `timespec` instead of the extended one
- as documentation suggests, "Interval counting is always performed by
the monotonic wall clock", and "If the flag is absent, the timeout value
is relative", which means that using the simple version is enough and
[9 lines not shown]
[AArch64] Consider MOVaddr* as cheap if fuse-adrp-add
These pseudo-instructions usually translate into a pair of adrp+add and
have a single cycle latency on some micro-architectures.
[DTLTO][Windows] Expand short 8.3 form paths in ThinLTO module IDs (#178303)
Windows supports short 8.3 form filenames (e.g. `compile_commands.json`
-> `COMPIL~1.JSO`) for legacy reasons. See:
https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#short-vs-long-names.
Short 8.3 form paths are undesirable in distributed compilation
scenarios because they are local mappings tied to a specific directory
layout on a specific machine. As a result, they can break or defeat
sandboxing and path-based isolation mechanisms used by distributed build
systems.
We have observed such failures with DTLTO even in simple scenarios. For
example, on Windows, running:
```
clang.exe hello.c -flto=thin -fuse-ld=lld -fthinlto-distributor=fastbuild.exe -###
```
[32 lines not shown]
[DTLTO][NFC] Minor improvements to the input file preparation class (#180824)
This change performs a small set of NFC refactors to improve clarity. In
particular, we make it clear that the responsibilities of this class now
extend beyond its original archive-handling role.
(cherry picked from commit 8b57b9730222cdc098d6a8708099e5b4986b1e2c)
[Windows][Support] Add helper to expand short 8.3 form paths (#178480)
Windows supports short 8.3 form filenames (for example,
`compile_commands.json` -> `COMPIL~1.JSO`) for legacy reasons. See:
https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#short-vs-long-names
Such paths are not unusual because, on Windows, the system temporary
directory is commonly derived from the `TMP`/`TEMP` environment
variables. For historical compatibility reasons, these variables are
often set to short 8.3 form paths on systems where user names exceed
eight characters.
Introduce `windows::makeLongFormPath()` to convert paths to their long
form by expanding any 8.3 components via `GetLongPathNameW`.
As part of this change:
- Extended-length path prefix handling is centralized by adding
`stripExtendedPrefix()` and reusing it in `realPathFromHandle()`.
- `widenPath()` is cleaned up to use shared prefix constants.
[5 lines not shown]
[Hexagon] Fix encoding of packets with fixups followed by alignment (#179168)
When a packet containing extended immediates and new-value compare-jump
instructions with fixups was followed by a .p2align directive, we would
incorrectly add nops to the packet. After reshuffling, the fixup offsets
would become invalid, causing corrupted encodings.
Fixes round-trip assembly for patterns like:
{
r18 = ##65536
if (!cmp.gtu(r1,r18.new)) jump:t .L1
}
.p2align 4
(cherry picked from commit 87d73f74713039cacf9d174a9d74de0db8eccb8b)
[hexagon] Add dylib cmake + toolchain_only (#177247)
The toolchains take up much less space when we enable dylib, so let's
create an option to build them that way.
Also: TOOLCHAIN_ONLY was ineffective in
hexagon-unknown-linux-musl-clang-cross.cmake because cmake takes the
first setting from hexagon-unknown-linux-musl-clang.cmake with
precedence. FORCE it to fix that issue.
Signed-off-by: Brian Cain <brian.cain at oss.qualcomm.com>
(cherry picked from commit cf4ce383b3c7776c06ee744acebfec1e0c1c946d)