[lldb] Define breakpoint location "." to mean the location(s) at which the current thread is stopped (#194272)
Adds `.` as a new `breakpt-id` syntax. Users can specify `.` to mean the breakpoint
location(s) that caused the current thread to stop.
I selected `.` to mean the current breakpoint locations for two reasons. In a shells,
period means <ins>current</ins> directory. In prose, a period is a <ins>stop</ins>.
My workflow often starts with multiple breakpoint locations, such as with regex
breakpoints, or basename breakpoints for overloaded/overridden names. As locations are
hit, I realize which locations are no longer needed. This new syntax makes it quick and
easy to disable the currently stopped location(s).
Another use case for this is to quickly repeat commands for the current location:
``` break com add -o 'p someVar' . ```
Usage example:
[15 lines not shown]
[AMDGPU][MIRFormatter] Printer & parser for S_WAITCNT human-readable mask (#193895)
This patch implements a printer and parser for the S_WAITCNT mask. It
prints the mask in a human-readable format, showing the counter values
like `Vmcnt_<NUM>_Expcnt_<NUM>_Lgkmcnt_<NUM>`.
The format matches the printing style of S_WAITCNT_DEPCTR. For example:
```
S_WAITCNT .Vmcnt_0_Expcnt_0_Lgkmcnt_0
S_WAITCNT .Expcnt_0
S_WAITCNT .AllOff
```
Counters at their maximum value (meaning "don't wait") are omitted. When
all counters are at max, `.AllOff` is printed.
Co-Authored-By: Claude Opus 4 <noreply at anthropic.com>
[HLSL] Make load methods take const attribute (#193858)
Previously, HLSL shaders that declare a local resource const, cannot use
the `Load` method, since it is not attributed with const.
Load does not change a resource, it is a read-only operation, so the
method should be marked const.
This PR changes the methods so that they are marked const.
Fixes https://github.com/llvm/llvm-project/issues/192557
Assisted by: Github Copilot
[clang][NFC] Mark CWG2810 as implemented and add a test (#194683)
CWG2810 (https://cplusplus.github.io/CWG/issues/2810.html) just removes
some wording that could be misinterpreted as saying "a compiler must not
emit any warnings in uninstantiated templates". Clang has never
misinterpreted it that way, so we don't need to do anything here.
[TableGen] Use guarded assert in constexpr functions
The constexpr functions in question take a scoped enum as an argument
and a switch statement returns a value for each value of the enum.
These are all legal statements in a constexpr function in C++14.
Under constexpr rules, the evaluation of a constexpr function cannot
lead to an evaluation of any prohibited forms of expressions. An
evaluation of the functions being discussed with a valid argument
will terminate at the switch, and an code that follows will not be
evaluated.
Using "llvm_unreachable" after the switch should be ok as long as
the expansion of the llvm_unreachable macro does not contain any
statements not allowed to appear in a constexpr function.
At the same time, GCC before v9 did not tolerate any unguarded calls
to non-constexpr functions after the switch.
To avoid using "llvm_unreachable", which can have multiple expansions,
[2 lines not shown]
[LLDB] Add module hook implementation (#185465)
Introduce a unified target hook command system for LLDB that handles
multiple target lifecycle events (module load, module unload, process
stop) through a single Hook class.
The existing target stop-hook commands remain unchanged for now, meaning
stop-hooks can now be created through either target stop-hook add or
target hook add -S.
A future follow-up can alias target stop-hook to the unified system to
consolidate the two paths.
New commands:
- target hook add [-o cmd] [-P class] [-u] [-S] - create a hook (fires
on module load by default, optionally on unload/stop)
- target hook add-filter [filter-opts] <hook-id> - attach stop-event
filters (shlib, function, file/line, thread) to an existing hook
- target hook list / delete / enable / disable - manage hooks
- target hook {enable,disable} {module-loaded|module-unloaded|stop-hook}
[10 lines not shown]
[clang][SSAF][NFC] Remove redundant overrides from analysis templates (#193086)
This PR removes redundant:
- `initialize()` and `finalize()` overrides from `SummaryAnalysis` already provided by `SummaryAnalysisBase`.
- `step()` and `finalize()` overrides from `DerivedAnalysis<>` already provided by `DerivedAnalysisBase`.
[lldb] Fix test failures on arm introduced by #184815 (#194157)
@jasonmolenda I don't have access to arm hardware, so I'm relying
heavily on Claude's recommendation.
[OpenMP] Fix use of uninitialized Dl_info when dladdr fails in ompd_init (#193643)
When dladdr() fails, dl_info is left uninitialized. The code printed the
error but then fell through to unconditionally call
strrchr(dl_info.dli_fname, '/'), accessing an uninitialized pointer --
typically NULL on the stack -- causing a SIGSEGV.
Fix by turning the second 'if' into 'else if', so the path-extraction
block is only reached when dladdr() succeeded and dl_info is valid.
Assisted-by: Claude Sonnet 4.6
[CIR] Implement return for void lambda with static invoker (#194704)
We had an errorNYI call for emitting the return statement for a static
invoker for a lambda with a void return. All that was needed was to emit
a return operation and add a test case.
[flang][OpenMP] Frontend support for BEGIN/END METADIRECTIVE (#194402)
This implements parsing of BEGIN/END METADIRECTIVE, plus a minimal
semantic check for the association of a directive in a WHEN/OTHERWISE
clauses.
The same semantic checks for the context selectors apply here as in the
case of a standalone METADIRECTIVE.
[libc] implement recursive mutex and fix wrong initializer (#193992)
Fix #193892.
This is found during libc++ bringing up process. This patch:
- implement recursive mutex support for real.
- fix the issue that pthread mutex initializer and public mutex
interface misalign with internal representation. this was the root cause
that hangs the libc++ test as padding bytes effectively pollute the
futex state if default initializer was used.
- additionally, we changed the field to bitfield to allow encoding more
data. (e.g. the error checking flag that is not yet added). timed bit is
removed as we always support it anyway. PI bit is added instead.
[lldb] Add repeat command for `frame variable` (#194195)
Introduce repeat command functionality for `frame variable`. The repeat behavior
increments the printing depth.
For example, when the default depth value (`target.max-children-depth`) is not enough,
hitting enter one or more times will expand the displayed data as deeply as needed.
See #149282 and then #178717.
[clang] Fix interaction of __ob_wrap with signed divide. (#194474)
At first glance, signed divide overflow seems similar to other forms of
signed overflow, but it's significantly different: it's the only form of
signed overflow that is not affected by -fwrapv, it has undefined
behavior at the LLVM IR level, and it can trigger trap on x86.
Given that, make ubsan trigger on signed divide overflow even if a type
is marked __ob_wrap.
[clang] fix crash with c-style casts involving dependent member-pointer types (#194696)
A dependent member-pointer type doesn't necessarily have a class
declaration.
This simplifies the check performed in a helper for diagnosing a cast
which removes qualifiers, so it doesn't rely on this assumption.
This fixes a regression introduced in
https://github.com/llvm/llvm-project/pull/132401, which landed in the
last release, and this will be back ported, so no release notes.
Fixes #194524
[clang] instantiate base classes even if they are instantiation-dependent-only
This makes sure base classes are fully instantiated, even if only
instantiation-dependent.
This fixes a lack of diagnostics for substitution failures in such cases,
and also avoids leaking these instantiation-dependent types to
CodeGen.
Fixes #193932
[CIR] Implement null check for CXXNewExpr (#192848)
When operator new is allowed to return null (e.g. nothrow new), the
initialization needs to be guarded by a null check,Previously this was
an errorNYI.
This wraps the initialization in a cir.if conditioned on the allocation
being non null, then uses cir.select to pick between the allocation
pointer and null as the result. Also removes
MissingFeatures::exprNewNullCheck.
part of https://github.com/llvm/llvm-project/issues/192328
[WebAssembly] Fix EHPadStack calculation in fixCallUnwindMismatches (#194184)
After #187484, `fixCallUnwindMismatches` now runs after
`fixCatchUnwindMismatches`. But `fixCallUnwindMismatches` was not
handling newly generated `try_table`s and trampoline BBs in
`fixCatchUnwindMismatches` correctly. See the comments for details.
This is mean to replace #192968 and adds its test case to
`cfg-stackify-eh.ll` and `cfg-stackify-eh-legacy.ll`. (The bug only
happens in the standard (exnref) EH so `cfg-stackify-eh.ll`, but I added
the same test to `cfg-stackify-eh-legacy.ll` as well for more coverage.)
`exception.ll`'s `inlined_cleanupret`'s results have changed because we
were generating unnecessary `try_table`s, thinking there were call
unwind mismatches when there weren't. (This wouldn't have resulted in
incorrect execution; it just added more unnecessary instructions.) This
also fixes some comments for `inlined_cleanupret`, because "throw_ref
targets the top level cleanuppad" is confusing. (This comment was
probably copy-pasted from "delegate targets ...".)
Closes #192968.
[AMDGPU] Add gfx13 HSA tests
Add HSA tests for gfx13, largely mirroring the gfx12 tests, but
covering the 32 user SGPR limit and related error handling.
[GISel] Fix -Wunused-variable (#194710)
b46a51d9c29519666f70807b52301d94be804f07 introduced some variables only
used in assertions. Mark them [[maybe_unused]] given they are used
multiple times, but only in assertions.
[unittest] Use TempDir() in gtest death-test stream capture on Linux (#194142)
gtest's CapturedStream on Linux hardcoded /tmp/ for its temp file
without consulting the environment, causing failures in sandboxed
environments where /tmp is read-only. Use TempDir() instead, which
checks TEST_TMPDIR then TMPDIR and falls back to /tmp/, matching the
behavior already present on Android and macOS/iOS.
See also upstream PR: https://github.com/google/googletest/pull/4962
Assisted-by: Claude Code