[LLDB] Simplify the hint when po-ing an object with no object descrip… (#200499)
…tion
The current wording of the hint is so long that the output obscures the
output of the command, which can be confusing. By shortening the message
the command output hopefully comes back into the center of attention.
[os_log] Fix a CodeGen crash for non-trivial C++ arguments (#200320)
The earlier fix in commit 8a0d145d90df (#158744) only emitted a hard
error for os_log arguments of record or complex type that took the
VarArgKind::Valid / ValidInCXX11 path in checkFormatExpr. Arguments of
non-trivial C++ class type (non-trivial copy/move ctor or dtor) instead
take the VarArgKind::Undefined path, which only emitted the
-Wnon-pod-varargs warning and let compilation proceed into CodeGen.
There, emitBuiltinOSLogFormat passes the argument expression to
EmitScalarExpr, which requires a scalar type. A non-trivial class
argument is not a scalar, so CodeGen crashes (asserting in
hasScalarEvaluationKind in assertions builds).
Emit the hard error err_format_conversion_argument_type_mismatch on the
Undefined path too, so compilation stops before CodeGen.
rdar://174747930
[X86] Use kmovw, not kmovq, for VK16 copies without BWI (#200337)
`copyPhysReg` selected `KMOVQkk_EVEX` for a `$k -> $k` VK16 copy on a
`+egpr` (APX) subtarget even without BWI, but `KMOVQ` requires BWI. Use
`KMOVW` instead.
This bug was found by a large run of Opus 4.7 looking for bugs in LLVM.
[Support] Add path-based setLastAccessAndModificationTime overload (#199256)
The existing setLastAccessAndModificationTime takes a file descriptor.
Add a const Twine & overload that opens the path internally so callers
no longer need to manage the fd themselves. The new overload accepts
both files and directories: on POSIX, O_RDONLY opens directories and the
existing fd-based implementation accepts a directory fd. On Windows,
FILE_FLAG_BACKUP_SEMANTICS is required to obtain a handle for a
directory.
The path overload pair mirrors the existing (Twine &) / (int FD) shape
used by setPermissions and resize_file.
[ExpandIRInsts] Fix sitofp/uitofp to float producing garbage instead of inf (#200291)
[ExpandIRInsts] Fix sitofp/uitofp producing garbage instead of inf
s/uitofp of an integer larger than the max finite floating-point value
should produce inf. This can't happen with e.g. an int32 -> float32
conversion, but can happen for e.g. int256 -> float32.
Before this change we'd produce garbage.
Fixes #189054.
Co-Authored-By: Claude Opus 4.8 <noreply at anthropic.com>
[lldb][Darwin] Correct jGetLoadedDynamicLibrariesInfos typeo & fallback (#200515)
Jonas caught that I had a typeo in checking for the
`sizeof_mh_and_loadcmds` key in the `jGetLoadedDynamicLibrariesInfos`
response from debugserver in DyanmicLoaderDarwin. Fix that.
Also I originally picked a fallback value for the mach header + load
commands as a guess. I've sinced looked at a large UI app's binaries and
based on the size of their actual mh+load commands, picked a default
that will read all the data needed in the majority of cases.
rdar://178283767
workflows/issue-write: Do not read pr number from file for pull_request events (#200474)
For pull_request events, the author of the pull request has full control
over the workflow job and can potentially write any pull request number
to the file. This would allow them to modify comments on any pull
request not just their own.
The reading of the pull request number from the file was added in
53ff447b64186ff51181cd6050a9613983ff80be to support issue_comment events
so we don't need it for pull_request events anyway.
[lldb-server] Add accelerator plugin infrastructure for debugging hardware accelerators like gpus (#198907)
This is the first patch of many related to
https://discourse.llvm.org/t/upstreaming-basic-support-for-accelerators/89827/6
### What this patch adds
- **`LLDBServerAcceleratorPlugin`** base class in
`source/Plugins/Process/gdb-remote/` so accelerator can implement the
own plugin
- **`accelerator-plugins+`** feature in `qSupported` response, only
advertised when at least one plugin is installed
- **`jAcceleratorPluginInitialize`** GDB remote packet and its
implementation in handlers, request and response.
- **`AcceleratorActions`** struct so every plugin can return the actions
that needs to be on the initilaize. in the future we will extend this
install breakpoints etc.
- **Mock accelerator plugin** for testing, gated by CMake option
`LLDB_ENABLE_MOCK_ACCELERATOR_PLUGIN` (default OFF)
[6 lines not shown]
[lldb] Halve the size of indexes in DemangledNameInfo (NFC) (#200506)
Mangled should not be more than 4GB. This will halve the size of
`DemangledNameInfo` from 128 to 64 bytes.
[mlir][vector] Fix incorrect byte-alignment assumption in ConvertVectorStore (#189235)
When `ConvertVectorStore` emits the narrow-type emulation for a
`vector.store` into a 2-D memref, it previously assumed that if the
trailing dimension of the memref exactly matches the vector size
(`trailingDimsMatch`), then the last-dimension index must be zero and no
sub-byte alignment adjustment is needed. This assumption is wrong: a
valid store such as
vector.store %v, %src[%c0, %c1] : memref<3x4xi2>, vector<4xi2>
has a non-zero column index (%c1 == 1) even though trailingDim (4)
equals the vector size (4). The incorrect shortcut caused the pattern to
fall into the "aligned" path and emit a plain bitcast + store at byte
offset 0, silently dropping elements [1], [2], [3] of the first byte and
overwriting the wrong memory.
Fix: use `linearizedInfo.intraDataOffset` when it can be folded, so
constant non-zero offsets emit the required partial RMW stores. If the
[11 lines not shown]
[CIR] Add RunCleanupsScope RAII around loop bodies (#200461)
This fixes yet another problem where a ternary operator in a loop body
was leading to an unterminated region. We have long had a comment
suggesting that we should consider loop-specific cleanup handling to
mimic the cleanup exit block that classic codegen creates. I previously
believed that wasn't really necessary because CIR's structured
representation handles branching through cleanups during later lowering.
That's true, but not having something to trigger the cleanup stack
handling when we exit the loop's body region was causing us to miss
emitting a yield after the loop operation.
This change introduces the RAII object for cleanups. This also allows me
to remove some handling in LexicalScope::cleanup that was basically
there to smooth over terminator insertion problems.
Assisted-by: Cursor / claude-opus-4.7
[clang-doc] Add specialization info to record references (#191252)
Class specializations listed in a namespace's page had the problem of
being indistinguishable from each other since they couldn't display
their template arguments. They would just be displayed as a series of
the base
template's name. Now, we can display those arguments in HTML
for a better experience.
In JSONGenerator, we query the set of Infos to find the Reference's
corresponding RecordInfo. That requires keeping a pointer to the map in
JSONGenerator.
Fixes #181771
[clang][scan-deps] Add option to disable caching stat failures (#200484)
While the source code isn't supposed to change during a build, in some
environments it does. This adds an option that disables caching of stat
failures, meaning that source files can be added to the build during
scanning.
This adds a `-no-cache-negative-stats` option to clang-scan-deps to
enable this behavior. There are no tests for clang-scan-deps as there's
no reliable way to do so from it. A unit test has been added that
modifies the filesystem between scans to test it.
Co-authored-by: Michael Spencer <bigcheesegs at gmail.com>
[OpenMP] Fix RPC register segfaulting without PM initialized (#200494)
Summary:
This happens in practice if you link libomptarget without initializing
it in the Flang RPC IO handling.
[NVPTX][FIX] Ensure memmove are kept if not lowered to loops (#200469)
Memmove lowering can fail, so we cannot unconditionally remove the
intrinsic.
Issue found by Robert Imschweiler <robert.imschweiler at amd.com>