[libc++] Revert changes to locale_base_api.h accidentally committed in f5b6e4f (#198413)
These changes weren't intended to be in the patch and don't make sense
as-is, so this reverts them.
[NFC] Optimize `SetImpliedBits` (#193289)
This function sometimes shows up on my profiles of slow compiles as
using up to ~3% of CPU cycles. This change reduces this to ~0%. So, it's
not a huge improvement, but it's not nothing.
Currently, this function recursively sets all implied bits for every
feature, which does a lot of redundant work. Many features are implied
by multiple different other features.
This changes the algorithm to only process newly implied bits.
I suspect that a better fix would be to avoid so many calls to
`SetImpliedBits` in the first place, but this is a deeper change that is
probably best made by someone who understands the structure of the
surrounding code.
Fixes #155808
[lldb-dap] Add process picker command to VS Code extension (#197513)
Adds a process picker command to the LLDB DAP extension that will prompt
the user to select a process. It's based on #128943 but uses lldb-dap to
provide the list of processes through the platform abstraction
(#197330).
The new command is hidden from the command palette, but can be used in
an "attach" debug configuration to select a process at the start of a
debug session. It also comes with a new debug configuration snippet
called "LLDB: Attach to Process" that will fill in the appropriate
variable substitution.
```
{
"type": "lldb-dap",
"request": "attach",
"name": "Attach to Process",
"pid": "${command:pickProcess}"
[8 lines not shown]
[DWARFLinker] Fix .debug_names emission for -gmodules in parallel linker (#198047)
The parallel linker tripped up the DWARF verifier for the .debug_names
section when the input contained -gmodules skeleton CUs. The issue was
caused by, link(), which reset UniqueUnitID to zero. By that point
addObjectFile() had already handed out IDs to clang module CUs loaded
from .pcm files, so the regular compile units loaded after the reset
reused those IDs. emitDWARFv5DebugNamesSection then collapsed two
distinct CUs onto the same CUidToIdx slot, sending one CU's .debug_names
entries to the other CU's index. Stop resetting the counter since the
constructor already initializes it.
[lldb] Fix "Debugger::Initialize called more than once!" (#198409)
When running multiple tests from the same binary,
1bac9410365260e250ab9483f096a411da5936b0 caused debugger_initialize_flag
to be called more than once.
We use the shared location: TestUtilities::g_debugger_initialize_flag to
ensure that the flag is initialized only once, following what is done in
other tests.
[CI] Build/test LLVM/Clang/libcxx on shared libc changes (#198379)
libc is now being used/planned on being used in more places around the
repo, particularly inside of APFloat, for constexpr evaluation, and
inside of libc++. Setup premerge to handle this. I'm only aware of the
APFloat planned usage that should reland soon, but running the clang
tests should not hurt.
[llvm][ABI] Revert "Add NonTrivialCopyConstructor and NonTrivialDestructor RecordFlags" (#198402)
Reverts #194427 (`4f11693`). That breakout was merged before @nikic
and @vortex73 finished review.
We are not landing this work from our fork; Narayan owns the LLVM ABI
Lowering Library on #140112. #194433 is closed.
Sorry for the premature merge.
[llvm] Add missing include in SSAUpdaterImpl.h (#198400)
Add a missing include file in SSAUpdaterImpl.h. This fixes the module
build failure when including this header.
[VPlan] Add helpers to get header, latch and middle VPBB from CFG (NFC) (#198378)
Retrieving header, latch and middle VPBBs from the plain CFG is a
somewhat common operation. Add dedicated helpers.
[flang] Add diagnostics for conflicting EXTERNAL/INTRINSIC and TARGET attributes (#197831)
Flang silently accepted declarations with both EXTERNAL and TARGET (or
INTRINSIC and TARGET) attributes on the same entity. This violates the
Fortran standard since TARGET requires a variable, but EXTERNAL/INTRINSIC
makes the entity a procedure.
Add CheckConflicting calls in CheckProcEntity to diagnose both cases.
All other major Fortran compilers already reject these combinations.
Fixes #197830
Assisted-by: Claude Opus 4.6.
Co-authored-by: Matt P. Dziubinski <matt-p.dziubinski at hpe.com>
[CIR] Add support for partial array cleanup with ILE (#198000)
This adds support for partial array cleanup when an array of a
destructed type is initialized, or partially initialized with an init
list expression.
In the case where the array is only partially initialized with the ILE
and the remainder gets implicit initialization, the cleanup for both
pieces of initialization is handled by the same cleanup scope. This is a
difference from classic codegen, but there is a FIXME in the classic
codegen implementation suggesting exactly this change.
Assisted-by: Cursor / claude-opus-4.7-thinking-xhigh
[llvm][ABI] Add NonTrivialCopyConstructor and NonTrivialDestructor RecordFlags (#194427)
Breakout from @vortex73's PR #140112.
Add HasNonTrivialCopyConstructor and HasNonTrivialDestructor flags to
RecordFlags, with accessor methods on RecordType. These flags are needed
by target-specific ABI classifiers (e.g. X86_64) to determine whether a
C++ record type must be passed indirectly per the Itanium ABI.
Also adds unit test infrastructure for the ABI library
(llvm/unittests/ABI/) with tests for the new flags and their interaction
with existing flags.
This is Narayan's design and logic from the LLVM ABI Lowering Library,
adapted to the current upstream API.
Made with [Cursor](https://cursor.com)
Co-authored-by: Narayan Raul Kamath <vortex73 at users.noreply.github.com>
[CIR] Allow implicit truncation in CharacterLiteral codegen (#197269)
`VisitCharacterLiteral` is calling the `IntAttr::get(Type, int64_t)`
builder, which builds the underlying `APInt` with
`isSigned=type.isSigned()` and no implicit truncation. That asserts the
moment a high-bit character literal like `'\xFF'` (which the AST stores
as `CharacterLiteral 'int' 4294967295`) comes through with `int` as the
destination type:
```
APInt.h:121: Assertion `llvm::isIntN(BitWidth, val) &&
"Value is not an N-bit signed value"' failed.
```
Classic CodeGen passes `IsSigned=false, ImplicitTrunc=true` here, with a
comment that says character literals are stored unsigned even for signed
char. Just mirror that: build the `APInt` explicitly with those flags
and hand it to `IntAttr::get`. After this the CIR const folder produces
`#cir.int<-1> : !s8i` for `signed char c = '\xFF';` and the lowered
[7 lines not shown]
[DWARFVerifier] Don't require .dwo for non-skeleton CUs (#198112)
The presence of `DW_AT_(GNU_)dwo_id` alone does not make a compile unit
a skeleton: a regular `DW_TAG_compile_unit` is allowed to carry a DWO
id. DWARF 5 marks skeleton CUs with `DW_TAG_skeleton_unit` while older
pre DWARF 5 identifies them by absence of children.
Before this change, the verifier would any CU whose header reported a
DWO id as a skeleton, then tried and failed to load its (non-existent)
.dwo and reported an error. This updates the verifier to gate the check
on the CU being an actual skeleton CU.
[flang][openacc] add optional extension to allow default none scalars (#197718)
Adds the flag, `-facc-allow-default-none-scalars`. When this flag is
enabled, Flang reverts to the pre-3.2 behavior: scalar variables
referenced inside a `default(none)` compute region without an explicit
data clause do not produce an error. Instead, Flang infers implicit data
attributes for those scalars via the same implicit-copy logic applied in
regions without `default(none)`.
- Adds tests and documentation.
- Makes an explicit extensions doc for OpenACC to mirror the OpenMP
extensions doc.
- Moves the intentional deviations to from the standard to the
extensions doc.
[LLDB] Support reading size of constant values from DWARF directly (#198392)
Some type systems (such as Swift) cannot determine a type's byte size
without an execution context (e.g. types whose layout depends on runtime
metadata). In those cases the debug info might still carry the static
size of the value's box, which is enough if the value is a constant.
This patch adds a unit test that mocks up an analogous situation using
TypeSystemClang.
Assisted-by: claude
[VPlan] Conservatively handle VPPhi in isUniformAcrossVFsAndUFs. (#198387)
Should be NFC in terms of optimizations, but fixes a infinite cycle when
running the VPlan verifier for extracts of a lane mask on RISCV
(https://github.com/llvm/llvm-project/issues/198274).
[AMDGPU] Use shorter form for i16 operands
For 16-bit operands an inline constant is zero extended
which in particular allows to use FP constants. These
will have 16 bits of zeroes in the high half and FP16
value in the low 16 bits.