[ObjectYAML] Remove extraneous .c_str() (NFC) (#167189)
maskedBitSetCase takes StringRef, so we can "implicitly cast"
std::string to StringRef.
Identified with readability-redundant-string-cstr.
[libc++] Treat P0513R0 as a defect report against C++11 (#166690)
P0513R0 is essentially a collective resolution paper of LWG2543,
LWG2791, LWG2809, and LWG2817.
Among these LWG issues, LWG2543 (conditionally enabled `hash`) and
LWG2817 (`hash<nullptr_t>`) affect pre-C++17 utilities. We generally
backport changes from LWG issues, so this patch backports the relevant
parts of P0513R0.
Although we provide `hash<unique_ptr>` as an extension in C++03 mode, as
C++03 mode isn't encouraged now, this patch leaves `hash<unique_ptr>`
unchanged in C++03 mode.
[MLIR] Fix FileCheck annotations and add 32-bit coverage (#167149)
Addresses #93154 by ensuring the test RUN/FILECHECK prefixes across
`mlir/test/Conversion/FuncToLLVM/` and related files match their
expected outputs, and adds an `index-bitwidth=32` variant of
`expand-then-convert-to-llvm.mlir` that exercises
`@collapse_shape_dynamic_with_non_identity_layout` through the same
MemRef-to-LLVM pipeline so the 32-bit layout descriptors are verified.
[llvm] Use static_assert on getEmptyKey and getTombstoneKey (NFC) (#167167)
Note that DenseMapInfo<unsigned>::getEmptyKey() and getTombstoneKey()
are constexpr.
This patch removes assertion messages as they don't state any more
than what's expressed in the assertion condition.
Identified with misc-static-assert.
[llvm] Allow Rust personality name to contain arbitrary prefix (#166095)
LLVM needs to figure out the type of EH personality for various reasons.
To do this, it currently matches against a hardcoded list of names. In
Rust, we would like to mangle our personality function to better support
linking multiple Rust standard libraries via staticlib. We have
currently mangled all symbols except the personality, which remains
unmangled because of this LLVM hardcoding.
Instead, this now does a suffix match of the personality name, which
will work with the mangling scheme used for these internal symbols (e.g.
`_RNvCseCSg29WUqSe_7___rustc12___rust_alloc`).
Companion Rust PR: https://github.com/rust-lang/rust/pull/148413
[llvm-rc] Don't interpret integer literals as octal numbers in rc.exe mode (#166915)
It turns out that rc.exe doesn't interpret integer literals as octal
numbers - but GNU windres does. Previously, llvm-rc did interpret them
as octal.
Fix the issue by stripping away the leading zeros during tokenization.
The alternative (which would be somewhat cleaner, as visible in
tokenizer.test) would be to retain them in the RCToken object, but strip
them out before calling
StringRef::getAsInteger. Alternatively to handle the radix detection
locally in llvm-rc code and not rely on getAsInteger to autodetect it.
Both of those solutions require propagating the IsWindres flag so that
it is available within RCToken, or at least when calling
RCToken::intValue().
Fixes: https://github.com/llvm/llvm-project/issues/144723
[libc++abi][libunwind] Enable AT&T syntax explicitly (#166818)
Implementation files using the Intel syntax typically explicitly specify
it. Do the same for the few files where applicable for AT&T.
This enables building LLVM with `-mllvm -x86-asm-syntax=intel` in one's
Clang config files (i.e. a global preference for Intel syntax).
[libc++] Run macOS buildbot under xcrun (#167072)
This ensures that run-buildbot can find the appropriate build tools
without having to go through a bunch of hoops inside run-buildbot
itself. When we eventually run the bootstrapping build on macOS, it also
allows the bootstrapped Clang to find the SDK headers it requires.
This also allows simplifying run-buildbot a bunch since we should be
able to find build tools in the current $PATH.
[Driver] Remove extraneous c_str() (NFC) (#167156)
Note that addMultilibFlag takes StringRef for its second parameter.
Identified with readability-redundant-string-cstr.
[WebAssembly] Clean up CustomMappingTraits<BBNumberMap> (NFC) (#167155)
This patch does two things for readability:
- Use structured bindings.
- Remove extraneous .c_str().
Note that YamlIO.mapRequired takes StringRef as the key type. As
such, we can implicitly construct StringRef from std::string.
[ObjectYAML] Remove redundant .str().c_str() (NFC) (#167154)
We can drop .str().c_str() here because all of the following are of
type StringRef:
- E.Name
- the second parameter of llvm::yaml::IO::enumCase
- the second parameter of llvm::yaml::IO::bitSetCase
Identified with readability-redundant-string-cstr.
[NVPTX] Remove redundant declarations (NFC) (#167153)
initializeNVPTXCtorDtorLoweringLegacyPass is declared twice in
NVPTX.h.
initializeGenericToNVVMLegacyPassPass is declared in NVPTX.h.
Identified with readability-redundant-declaration.