[WebAssembly] Move a wide-arithmetic test (NFC) (#184950)
Other individual feature tests appear before CPU tests, so this moves
this test there to make it consistent.
[JSON] Consistently reset moved-from object (#185125)
Before the patch moved from object was in consistent state.
For some types it resets contents and switch to T_Null, for others
it preserves type and value.
So make sure to set T_Null for all.
When we set T_Null we need to destroy the value.
It's important for particular types, like std::string. With
Asan it must unpoison SSO buffer.
Fixes false container overflows after #184693:
https://lab.llvm.org/buildbot/#/builders/169/builds/20655/steps/11/logs/stdio
[dsymutil] Use DebugMapFilter when parsing --allow/--disallow YAML input (#185061)
PR https://github.com/llvm/llvm-project/pull/182083 forgot to switch
over to use the newly added `DebugMapFilter` when parsing
`--allow/--disallow` YAML input. It was still using
`ObjectFileList`/`ObjectFileEntry`, which was added initially in the
same PR and was later intended to be replaced by `DebugMapFilter`.
This patch switches over to use `DebugMapFilter`, adds necessary YAML
traits, and removes `ObjectFileList`/`ObjectFileEntry`.
[lldb] Implement PluginInfo move constructor (#185137)
The default move constructor wasn't nulling out the callbacks. Combined
with the fact that llvm::sys::DynamicLibrary has no explicit move
constructor and hence library.isValid() still returned true after having
moved-from, we would end up calling plugin_term_callback() when
destroying the moved-from PluginInfo, calling it prematurely.
[lldb] Use llvm::SmallVector in the PluginManager (NFC) (#184912)
Most of the plugins have only a small number of instances. Use
`llvm::SmallVector` instead of `std::vector`.
Depends on https://github.com/llvm/llvm-project/pull/184837
[SelectionDAG] Optimize 32-bit udiv with 33-bit magic constants on 64-bit targets (#181288)
This PR optimizes 32-bit unsigned division by constants when the magic
constant is 33 bits (IsAdd=true case in UnsignedDivisionByConstantInfo)
on 64-bit targets.
## Overview
Compiler optimization for constant division of `uint32_t` variables
(such as `x / 7`) is based on the method
proposed by Granlund and Montgomery in 1994 (hereafter referred to as
the GM method).
However, the GM method for the IsAdd=true case was optimized for 32-bit
CPUs, not 64-bit CPUs.
This patch provides optimizations specifically for 64-bit CPUs (such as
x86_64 and Apple M-series).
A simple benchmark demonstrates over 60% speedup on both Intel Xeon and
Apple M4 processors.
[66 lines not shown]
[clang][Dependency Scanning] Fix the In-Memory Buffer Used for By-Name Scanning (#183396)
This PR fixes two issues of the in-memory buffer we use for the input
file when a dependency scanner performs by-name queries.
First, it renames the buffer. The temporary file was named
`ScanningByName-%%%%%%%%.input`, which leads to weird diagnostics such
as
```
ScanningByName-2d42a1e9.input:1:1: fatal error: could not build module 'X'
```
This PR changes the name of the file buffer, so we get diagnostics such
as
```
module-include.input:1:1: fatal error: could not build module 'X'
```
which is more indicative.
[10 lines not shown]
[lldb] Use range-based for loops over plugins (#184837)
This PR replaces the Get*CallbackAtIndex pattern in the PluginManager
with returning a snapshot of callbacks that the caller can iterate over
using a range-based for loop. This is a continuation of #184452 which
added thread safety by using snapshots. However, that introduced a bunch
of unnecessary copies which are largely eliminated again by getting the
snapshot once when gather all the callbacks, rather than doing that on
each iteration when querying a plugin for a given index. It also
eliminates the possibility of the snapshot changing underneath you when
iterating over the plugins.
This change was largely mechanical and I used Claude to do the menial
work of updating the signatures and call sites.
[clang-doc] Introduce Serializer class
Serialization has mostly been done with static functions, but soon we
will need to share state, like alocator references. To avoid blowing up
our parameter lists, we can just wrap the local functions within a
class.
[clang-doc][NFC] Introduce Vector and Array abstractions
Introduce OwningVec and OwningArray aliases for vector types we want to
eventually update for arena allocations.