[lldb] Harden PolicyStack against cross-thread Guard misuse (#195774)
Two related correctness/clarity improvements to the `Policy`
infrastructure introduced by 504a112:
`PolicyStack::Guard` now stores the std::thread::id of the thread that
created it. Destruction and move operations call
`llvm::report_fatal_error` when they happen on a different thread, since
the `PolicyStack` is `thread_local`: popping from the wrong thread would
silently corrupt that thread's stack.
`Push`/`Pop` on `PolicyStack` are now private. Callers go through named
factories (`PushPrivateState`, `PushPublicStateRunningExpression`) that
return RAII Guards. The transition factories on Policy
(`CreatePrivateState`, `CreatePublicStateRunningExpression`) inherit
from `PolicyStack::Get().Current()` and apply their named change on top,
so pushed policies preserve existing stack state rather than resetting
unrelated fields. `CreatePublicState` remains the baseline reference
value (returns a default `Policy{}`); the stack returns to public state
[13 lines not shown]
[clang] fix typo correction crash with template destructor names
Disables typo correction for template destructor names,
as typo correction is not aware of destructors and would
provide suugestions which would form an invalid name.
Since this fixes a regression that was never released, there are no release
notes.
Fixes #206992
[CIR][NFC] Re-enable invalid linkage test (#205459)
The CIR verification test for a cir.global op with a missing linkage
attribute was broken by a change to the MLIR asm parser back in April.
At that time, I marked the test as XFAIL and added a check that would
prevent it from randomly passing. In the meantime, another MLIR parser
changed (https://github.com/llvm/llvm-project/pull/188008) fixed the
original problem.
This change reverts the test to its previous state since it now passes.
graphics/nvidia-drm-*-kmod*: Fix GPF in some configs
Fix General Protection Fault in __nv_drm_gem_nvkms_handle_vma_fault,
lkpi_vmf_insert_pnf_prot_locked, vm_page_busy_acquire in specific
configurations, notably KDE on Wayland.
PR: 296195
Reported by: keivan at motavalli.me
Reviewed by: ashafer
Tested by: keivan at motavalli.me
Differential Revision: https://reviews.freebsd.org/D57989
Co-authored by: ashafer at FreeBSD.org
[lldb-mcp] Link liblldb instead of the full initialization stack (#206852)
lldb-mcp linked liblldb but also pulled in lldbInitialization, which
drags in lldbCore and the entire plugin stack as a second, static copy
of LLDB alongside the dylib. It bootstrapped that copy through the
private SystemInitializerCommon.
lldb-mcp is a thin stdio proxy: it locates and forwards I/O to an lldb
subprocess and never creates a debugger. It only needs the FileSystem,
HostInfo, and Socket subsystems. Drop lldbInitialization, get the heavy
code from liblldb, and initialize just those subsystems directly (as
lldb-dap does) rather than via SystemInitializerCommon.
rdar://181054260
[clang][SYCL] Add -fsycl-device-image-split option (#206870)
Add the -fsycl-device-image-split= driver option to control how SYCL
device code is split into separate device images. Supported values:
- kernel: one device image per SYCL kernel
- translation_unit: one device image per translation unit
- link_unit: one device image per linking unit
The bare -fsycl-device-image-split flag is an alias for
-fsycl-device-image-split=translation_unit, which is also the default.
clang-sycl-linker module-split-mode option values were updated
accordingly to simplify options forwarding logic.
Co-Authored-By: Claude
[HLSL][DXIL] InterlockedOr and InterlockedOr64 builtins (#180804)
This includes the first phase of implementation of the InterlockedOr
intrinsic. This covers the usage of the intrinsic/builtin on
RWByteAddressBuffers, Typed Buffers, and Structured Buffers. Not covered
are textures, groupshared memory, and the standalone
InterlockedOr(buf[index], val, ret) intrinsics.
SPIRV implementation is not covered in this commit.
Contributes to, but does not address
https://github.com/llvm/llvm-project/issues/99126
[lldb] Find the default source file's main by base name (#207043)
SourceManager::GetDefaultFileAndLine locates the executable's main to
pick a default source file, used for input like "break set -l N" with no
file specified. It searched for main by full name, but a function's
linkage name can differ from its source name, in which case a full-name
search for "main" does not find it and no default file is chosen.
For example, wasi-libc renames main to __main_argc_argv, so on
WebAssembly the debug function for main was never matched and "break set
-l N" failed with "no default file available".
When we can't find "main", fall back to searching by base name.
[libc][realpath] Implement symbolic path resolution (#204467)
This PR contains an incremental implementation of `realpath` that just
simplifies path traversals (e.g. `"/a/./../b"` -> `"/b"`). The complete
implementation would perform `getcwd`/`statx`/`readlinkat` to actually
resolve symlinks, validate paths, etc. This PR aims to add as much
functionality/error handling as possible without making any syscalls.
This implementation lives in `libc/src/stdlib/linux/`, since follow-on
PRs will rely on linux-specific syscalls. For testing purposes, I've
added the entrypoint for x86-64 linux when
`LLVM_LIBC_ENABLE_EXPERIMENTAL_ENTRYPOINTS` is enabled.
Follow-on PRs to add: path validation (e.g.
paths must exist), support for cwd-relative paths, and symlink
resolution.
[HLSL] Enable invoking a method on a constant buffer struct (#206596)
Structs in constant buffers are in the `hlsl_constant` address space and
in a specific constant buffer layout. In order to invoke a method on
such struct, it first needs to be copied out into const temporary
variable with a standard layout. This change adds `LValueToRValue` cast
to the method `this` argument which takes care of that.
Fixes #190299
sysutils/ezjail: Update 3.4.2 => 3.4.3
Changelog:
- Install man pages to $DEST/share/man, not $DEST/man.
- Make distribution now needs to be called from /usr/src, not
/usr/src/etc.
- Fix tyop: snapshot => snapshots.
- Incorporate fixes from port: provide shutdown script.
- for freebsdup-update -b, --currently-running now is mandatory.
- Fix superfluous asteriks in multiplication.
- Fix man page typos.
- Typo fixes.
- Incorporate Makefile patch from port.
Improve port:
- Replace PORTVERSION with DISTVERSION.
- Add LICENSE block.
- Sort plist.
[3 lines not shown]
[lldb][test] Use a valid main signature in the inlines test (#207093)
lang/c/inlines/main.c declared "int main(int argc)", a single-int-
parameter main that clang warns about (-Wmain) and that argc is never
used for. Declare it as "int main()".
rescue/ldd: Add a couple new symbols for recent rtld changes.
Should fix:
# link rescue/rescue
...
/tmp/build/2026.07.01.20.39.44-i386/tools/lib/gcc/i486--netbsdelf/14.3.0/../../../../i486--netbsdelf/bin/ld: /tmp/build/2026.07.01.20.39.44-i386/obj/usr.bin/ldd/elf32/libldd_elf32.a(load.o): in function `_rtld_load_object':
load.c:(.text+0x23b): undefined reference to `_rtld_objgen'
/tmp/build/2026.07.01.20.39.44-i386/tools/lib/gcc/i486--netbsdelf/14.3.0/../../../../i486--netbsdelf/bin/ld: load.c:(.text+0x256): undefined reference to `_rtld_objrelocpending'
PR lib/59751: dlclose is not MT-safe depending on the libraries
unloaded
[lldb] Don't trust unwind information for outlined functions (#204500)
clang/llvm has a feature to take identical sequences of instructions
from multiple functions, put them in a separate utility function, and
call that utility function, reducing overall codesize. Primarly useful
in memory constrained environments.
The CFI unwind instructions for these OUTLINED_FUNCTIONs in
eh_frame/debug_frame is entirely incorrect; clang does not emit any
directives for them.
Furthermore, the callers sometimes call the OUTLINED_FUNCTION in a
non-ABI call manner. For instance, if the last few instructions of a
function (including the epilogue) are put in an OUTLINED_FUNCTION, a
function will simply tail-call/jump to the outlined function.
If a function prologue is separated into an OUTLINED_FUNCTION, a non ABI
call to preserve the return-address-register may be used, e.g. on RISCV
a `jal t0, OUTLINED_FUNCTION_nn` may be used, putting the return address
[36 lines not shown]
[clangd] Use plaintext newline handling for escaped markdown hover style (#185197)
For clangd 22 there are [3 new
options](https://clangd.llvm.org/config#documentation) to control the
content of the hover information. Using the default Plaintext option,
Markdown syntax is escaped.
But whitespaces (like newlines etc.) are not "escaped" anymore as it was
before the introduction of Markdown and Doxygen rendering.
Some clients do not render Markdown even if they request Markdown
content from the server.
At least the [neovim client](https://github.com/clangd/clangd/issues/95)
does not render Markdown whitespace correctly.
Therefore, with clangd 22, the rendering for these clients looks
different, especially for newlines.
Without the escaping, newlines are rendered as written in the
documentation comment, which is not desired for these clients.
This patch fixes the regression by using the same whitespace escaping as
clangd < 22.
[RISCV][P-ext] Tighten checks for what scalar<->vector bitcasts are legal (#207038)
We were incorrectly treating i64<->vector casts as legal on RV32. This
only shows up when the D extension is enabled because it marks i64
bitcast as custom for i64<->f64 conversions.
Rewrite the checks in terms of XLenVT.