[lldb] Stop recognizing Swift mangled names in Mangled (#232930)
Currently Mangled recognizes Swift mangled names, even though LLDB on
llvm.org has no Swift support and can't demangle them.
This patch removes them, so that the Swift plugin can register a
proper Swift mangling scheme. On main, this means that Swift names are
now stored as plain names, which is how LLDB already displayed
them.
Assisted-by: Claude
Depends on: https://github.com/llvm/llvm-project/pull/232929
[OpenMP][NFC] Add a host triple to metadirective_runtime_implicit_map.cpp (#238893)
`metadirective_runtime_implicit_map.cpp` (added in #236432) uses
`-fopenmp-targets=x86_64-pc-linux-gnu` without a host `-triple`, so the
host defaults to the machine running the test. On 32-bit hosts this
fails with:
OpenMP target architecture 'x86_64-pc-linux-gnu' pointer size is
incompatible with host 'armv8l-unknown-linux-gnueabihf' CI failure:
https://lab.llvm.org/buildbot/#/builders/135/builds/5051
(clang-armv7-vfpv3-2stage).
This PR adds a triple.
[flang][OpenACC] Convert real DO controls for implicit acc.loop (#238833)
A DO loop inside an OpenACC compute construct with no !$acc loop
directive is lowered to an implicit acc.loop. When a DO control
expression is REAL, the lowering passed the REAL value straight to
acc.loop, which requires integer operands. A REAL upper bound with no
step also built the default step from that REAL type, so flang aborts in
IntegerAttr creation:
```
error: expected integer or index type
Assertion `succeeded(ConcreteT::verifyInvariants(...))' failed.
```
A REAL lower bound instead fails acc.loop verification with "operand #0 must be variadic of integer or index, but got 'f32'".
For implicit loops, convert a non-integer control (lower, upper, or step) to the induction variable's integer type, matching non-OpenACC DO lowering. Integer controls of any kind are used unchanged. Explicit !$acc loop directives keep their existing lowering, since OpenACC requires their bounds to be integer.
Add a test for REAL bounds and a REAL step on implicit loops.
[lldb] Move demangling into a minimal D language plugin (#232929)
Currently Mangled demangles D names itself, since there is no D
language plugin to hand them to.
This patch adds a minimal one, like the Rust plugin, that recognizes D
source files, registers the D mangling scheme, and demangles its names
with the code that moves out of Mangled, which leaves Mangled without
a demangler of its own.
Assisted-by: Claude
Depends on https://github.com/llvm/llvm-project/pull/232927
[lldb] Move demangling into a minimal Rust language plugin (#232927)
Currently Mangled demangles Rust v0 names itself, since there is no
Rust language plugin to hand them to.
This patch adds a minimal one, like the Fortran plugin, that
recognizes Rust source files, registers the Rust v0 mangling scheme,
and demangles its names with the code that moves out of Mangled.
Assisted-by: Claude
Depends on: https://github.com/llvm/llvm-project/pull/232926
[lldb][test] Delete 'types' test (#208402)
This removes the various `types/` tests in LLDB. These tests suffer from
various problems:
* They are slow. Their current runtime is nearly 90s on my new machine,
which is a lot for tests that only print a few integers/float vars.
* Their scope is very vague. E.g., `TestCharType` doesn't just test char
types, but also tests capturing them in block functions. Also while most
tests are related to basic types, some also test edge cases of struct
types and other things that belong into their own test folder.
* They are very overengineered. Tests should be stupid and not have
whole dedicated output-capturing-and-parsing system.
* They don't really test anything. There are no edge cases or
problematic values tested.
[7 lines not shown]
Allow constexpr defaulted postfix operators that call non-constexpr functions
Before C++23, an explicitly-defaulted function could only be declared
constexpr if it was constexpr-compatible. Defaulted postfix operators are
a C++2d feature, available in earlier modes only as an extension, so
don't apply that restriction to them; this follows the P3668R4 wording.
Whether such an operator is implicitly constexpr still depends on the
functions it invokes before C++23.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
Assert on unreachable failures in the defaulted postfix operator body
Building 'c', the declaration statement for 'tmp', and the prefix
operator call on an operand of class or enumeration type cannot fail,
so assert instead of checking. The remaining failure paths are covered
by tests; add one for an abstract class type C, the only way to make
'tmp' invalid.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
Move defaulted postfix operator tests to SemaCXX
clang/test/CXX is not where edge cases are tested.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[Object] Add an 'isCompressed' helper for offload binaries (#238931)
Summary:
Previous changes supports the version three with compressed binaries.
This adds a publically exposed helper so people can determine if it's
compressed without digging into the binary format themselves, if that
decision is important for something.
Revert init-prority-attr clangir run line (#238987)
This one has an ordering difference on the aarch64 server for some
reason, so revert it, since the goal of #238886 was to just do 'passing'
tests for now.
Removes the new 'run' line.
[AArch64] Fold CSEL of a CSEL with the same flags (#224992)
When an inner CSEL shares the same flag as the outer CSEL, substituting
the argument of the selected value can either 1) remove the select, or
2) break the dependency on the inner CSEL.
```
(CSEL (CSEL a b cc F) d cc F) => (CSEL a d cc F)
(CSEL (CSEL a b !cc F) d cc F) => (CSEL b d cc F)
(CSEL d (CSEL a b cc F) cc F) => (CSEL d b cc F)
(CSEL d (CSEL a b !cc F) cc F) => (CSEL d a cc F)
// (CSEL (OP x.. (CSEL a b cc F) y..) d cc F) => (CSEL (OP x.. a y..) d cc F)
// (CSEL (OP x.. (CSEL a b !cc F) y..) d cc F) => (CSEL (OP x.. b y..) d cc F)
// (CSEL d (OP x.. (CSEL a b cc F) y..) cc F) => (CSEL d (OP x.. b y..) cc F)
// (CSEL d (OP x.. (CSEL a b !cc F) y..) cc F) => (CSEL d (OP x.. a y..) cc F)
```
Where single use OP is folded, but multi-use OP is only folded if it can
be absorbed into a CSINC/CSINV/CSNEG.
[2 lines not shown]
[ThinLTO][NFC] Use a switch for ImportKind in exportToDot (#233610)
`ModuleSummaryIndex::exportToDot` used an if/else-if chain to choose the
"definition" or "declaration" comment for each summary. `ImportKind` has
only these two enumerators, so the else-if condition is always true when
it is reached.
Switch on the enum-typed `importType()` instead, without a `default`
label, so that `-Wswitch` flags this code if a new `ImportKind` is
added. With the previous code a new kind would silently get no comment.
No new test, since this is NFC. The dot-dumper tests in
llvm/test/ThinLTO/X86 exercise this function, and `dot-dumper.ll` is the
only test that checks these comments. They pass, as does `check-llvm`.
Assisted-by: Claude Code
AtomicExpand: Use RuntimeLibcallsInfo signatures for atomic libcalls
Take the function type and attributes of the emitted __atomic_* calls
from RuntimeLibcallsInfo instead of building them by hand.
This fixes missing extension attributes on the value operand and
result of the sized variants, which are unsigned integers of the
access size. On targets whose C ABI extends narrow integer arguments,
such as RISC-V and ARM, the callee could see unextended high bits. i8
and i16 values now get zeroext, and i32 values get signext on
RV64. Callers can also rely on the extended return value, which
removes redundant extensions after some calls.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[ci] Adapt the LNT tooling to LNT projects (#238898)
We just added a new way to group test suites into projects in LNT. This
allows giving more flexibility to different projects / teams sharing one
instance (e.g. keys can be scoped to a project, and the UI groups things
by project).
However, this means that submissions also have to specify a project, not
just a test suite, which is a breaking change (fine since this is still
early).
This patch mechanically updates the test suites to the following
projects and suites:
libcxx -> libcxx/microbenchmarks
libstdcxx -> libcxx/libstdcxx_microbenchmarks
llvm_test_suite -> llvm/test_suite
[CIR] Implement 'weak-ref' lowering (#238538)
This patch implements the weakref attribute, replacing 2 missing
features and quite a few 'NYI' diagnostics.
This is handled for both functions and variables, so it needs to be
threaded in a few places. For the most part, this is a copy of the
classic-codegen changes, though a few places cause us to have to do
things in slightly different orders, such as the CIRGenExprConstant
changes, where the CIR differentiation between a global view to variable
and function are different.
AI disclosure: Claude wrote up the test and got more cases than I came
up with in my attempt.
RuntimeLibcalls: Only apply vector math attributes to floating point vectors
i128 is now <2 x i64> on Win64, which made the vector type checks treat
integer helpers like __atomic_load_16 as vector math functions and mark
them nosync and nofree. Check for a floating point vector argument.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply at anthropic.com>
RuntimeLibcalls: Use <2 x i64> for i128 libcall types on Win64
Win64 passes __int128 by reference and returns it in XMM0. i128 uses
GPR pairs, and <2 x i64> uses the correct vector register. This
matches the type AtomicExpand and clang uses for these functions.
Also fix AtomicExpand to use the correct type for UEFI (which should
eventually use the type information in RuntimeLibcallsInfo).
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>