[clang][CodeGen][Coro] Fix missing EHCleanup for eagerly returned GRO (#206392)
When the GRO is returned eagerly, its value is emitted directly to the
return-value slot. However, we failed to emit EHCleanup for it, leading
to resource leaks if an exception was thrown inside the ramp function.
#202279 fixed this for the period before `initial-await-resume-called`
is set to `true`. This patch extends that fix to cover the entire ramp
function.
Close #199627
[LifetimeSafety] Add separate diagnostic groups for constructor annotation suggestions (#206254)
Reason:
* Better selective enablement.
* In experience, constructor annotations are the most useful and
improves detection by manifolds.
[lldb][test] Skip TestBreakpointConditions.py on Windows on Arm (#206433)
Has been failing a lot lately on the buildbot, see #206141.
Which part fails seems to vary so I'm disabling all of it.
[lldb] Ignore notification packets (#204788)
The gdb-protocol spec says
> Recipients should silently ignore corrupted notifications and
notifications they do not understand.
This changes `WaitForPacketNoLock` so that it ignores all notifications
(I'm not sure about corrupted ones).
An example of a notification that causes issues without this change is
that OpenOCD sends `%ookeepalive:00` notifications during memory
accesses.
Fixes #197944
[RFC][SIInsertWaitCnts] Remove VMemTypes
This can be considered a RFC. I'd personally like to get rid of VMEMTypes
but I don't know if anyone feels strongly that they should be kept.
My motivation for removing VMemTypes is simple: They are just a repeat
of VMEM events, just under a different name, and messier (defined as a
basic enum but actually stored as a bitmask later). It's just confusing.
This patch eliminates the need for them by:
- Adding a new entrypoint in AMDGPUHWEvents to get the basic set of
VMEM events issued by a VMEM Instruction.
- Set BVH/SAMPLER events irrespective of whether the HW can track them.
These events exist anyway, it should be up to InsertWaitCnt to deal with them
properly (which is easy, only `counterOutOfOrder` needed work).
- Tracking an additional set of per-VGPR "PendingEvents" which is
set using the "basic set of VMEM events" and cleared as needed.
[3 lines not shown]
[AMDGPU][InsertWaitCnts] Improve testing coverage for VMemTypes
The next patch will get rid of VMEMTypes, but some of its functionality
was not tested well. This patch adds more tests to fix gaps in testing
so that the next patch in the stack can be shown to have no impact
on codegen.
The 2 issues I had noticed was that we didn't have a test for mixed
vmem types w/ BVH, only for sampler; we also did not have a test
that was affected by `clearVmemTypes`, so removing that call
had no effect.
This patch adds tests for both cases.
[lldb] Add option to log in JSONL format (#205758)
This patch adds a -j option to the log command that prints all log
messages as their own single-line JSON objects. The resulting output log
file is then a valid JSONL file with the message and metadata as their
own fields.
The motivation for this change is that writing any tooling that
analyzses LLDB logs is currently very difficult to get right. Our
current log messages often span multiple lines, and even the metadata
(e.g., stacktraces) span multiple lines. Even worse, the message content
is effectively arbitrary bytes (such as memory values) that need can
only be parsed back into a series of log messages via several
heuristics.
assisted-by: claude
[clang-doc] Remove unused simple_ilist comparison operators (NFC) (#206309)
These operator== and operator!= templates in YAMLGenerator.cpp were
never called. They went in as infrastructure that never got wired up,
and now a cleanup exposed them under -Wunused-template. Remove the dead
code.
NFC. Part of #202945.
[VPlan] Remove internal linkage from findUserOf templates (NFC) (#202974)
The `findUserOf` function templates are `static` in a header, so every
translation unit that includes it gets its own internal-linkage copy.
That's a latent ODR hazard, and it trips `-Wunused-template` in TUs that
don't instantiate them. Dropping `static` gives them external linkage
(templates are implicitly inline, so nothing else changes).
NFC: linkage-only change.
Part of #202945.
[JITLink][ORC] Clean up unused and assert-only function templates (NFC) (#202973)
These function templates trip `-Wunused-template`.
In `aarch32.cpp`, `writeRegister` has no callers, so it's removed.
`checkRegister` is only used inside `assert`, so it gets compiled out in
release builds (`-DNDEBUG`) and never instantiates; it's marked
`[[maybe_unused]]`. Same story for `stubAndPointerRangesOk` in
`OrcABISupport.cpp`, which is only used in asserts.
NFC.
Part of #202945.
[Mips] Remove unused function templates (NFC) (#202971)
A few function templates in the Mips MC layer have no callers anywhere,
so they never get instantiated and trip `-Wunused-template`. They all
live in `.cpp` files, so this is plain dead-code removal.
`MipsELFObjectWriter.cpp`: `copy_if_else` and `find_best` lost their
only user when `sortRelocs` was rewritten in #104723. The
`FindBestPredicateResult` enum existed only for `find_best`, so it goes
too.
`MipsDisassembler.cpp`: `DecodeDAHIDATIMMR6` isn't referenced by any
`DecoderMethod`. The r6 DAHI/DATI instructions decode through its
sibling `DecodeDAHIDATI`, which is what the generated tables actually
call.
NFC: removes uninstantiated templates only.
Part of #202945.
[Object][ELF] Remove internal linkage from header function templates (NFC) (#202969)
These `static` function templates live in a header, so every translation
unit that includes it gets its own internal-linkage copy. That's a
latent ODR hazard, and it trips `-Wunused-template` in every TU that
doesn't instantiate them. Dropping `static` gives them external linkage
(templates are implicitly inline, so nothing else changes). This matches
`getElfArchType` in the same file, which is already a plain `inline`
helper.
NFC: linkage-only change.
Part of #202945
[Clang][Sema] Fix crash on init-list of array with incomplete element type (#205973)
## Summary
Fixes #140685.
clangd (and clang itself, with assertions enabled) crashes on:
```cpp
struct MoveOnly;
void test() {
MoveOnly (&&list)[1] = {};
}
```
with
```
Assertion failed: (CanDeclareSpecialMemberFunction(RD) && "doing special member lookup into record that isn't fully complete"), function LookupSpecialMember, file SemaLookup.cpp
[41 lines not shown]
[Clang] Handle deduced auto types within AtomicType (#197874)
This patch fixes handling of deduced types nested inside AtomicType.
Previously, GetContainedDeducedTypeVisitor did not recurse through
AtomicType nodes, causing getContainedDeducedType() to incorrectly
return null for types such as:
**_Atomic(__auto_type)**
As a result, undeduced AutoType instances could bypass semantic checks
and later reach codegen/type layout paths, eventually triggering
assertions such as:
_!A->getDeducedType().isNull() && "cannot request the size of an
undeduced or dependent auto type_
This patch adds AtomicType traversal support to
GetContainedDeducedTypeVisitor so contained deduced types are properly
[15 lines not shown]
[clang][Lex] Optimize the FileCheckPoints search in Preprocessor (#206356)
Resolves a FIXME and improved linear search by replacing with a binary
search on the FileCheckPoints SmallVector in Lex/Preprocessor.
- used std::upper_bound to find the upper bound of the Start position.
- handle special case if the Start is less than all elements in
FileCheckPoints so returns a nullptr;
- else return the dereferenced value of the CheckPoint just before Start
point.