[ASTMatchers][NFC] Replace `makeMatcher` function with CTAD (#147197)
C++17's CTAD obsoletes `makeMatcher` (and many `make*` functions like
it).
The deduction guide is written out explicitly to avoid
`-Wctad-maybe-unsupported` warnings.
[AArch64] Fix the emission of WinCFI for pac-ret+leaf and SCS (#147518)
This commit fixes WinCFI opcodes being incorrectly emitted for test
cases in sign-return-address.ll.
Emit SEH_Nop opcode in emitShadowCallStackEpilogue the same way it is
done in emitShadowCallStackPrologue function - this fixes
12 bytes of instructions in range, but .seh directives corresponding to 8 bytes
error being reported for the epilogue of non_leaf_scs function.
Emit SEH_PrologEnd on the code path in emitPrologue function that may be
taken when pac-ret protection is emitted for a leaf function - this
fixes errors like the following:
starting epilogue (.seh_startepilogue) before prologue has ended (.seh_endprologue) in leaf_sign_all_v83
Stray .seh_endepilogue in leaf_sign_all_v83
[Test] Mark a number of libcall tests `nounwind` (#148329)
Many tests for floating point libcalls include CFI directives, which
isn't needed for the purpose of these tests. Mark some of the relevant
test functions `nounwind` in order to remove this noise.
[Support/BLAKE3] Make g_cpu_features thread safe (#147948)
`g_cpu_features` can be updated multiple times by `get_cpu_features()`,
which reports a thread sanitizer error when used with multiple lld
threads.
This PR updates BLAKE3 to v1.8.2.
[Clang] Improve diagnostics for 'placement new' with const storage argument (#144270)
Before this patch, the following code gave misleading diagnostics about
absence of `#include <new>`:
```cpp
#include <new>
struct X { int n; };
int foo() {
const X cx = {5};
// error: no matching 'operator new' function for non-allocating placement new expression; include <new>
(void)new(&cx) X{10};
};
```
Now it gives correct diagnostics about constness of passed argument:
```cpp
#include <new>
struct X { int n; };
[11 lines not shown]
[clang-tidy] Add new check `llvm-prefer-static-over-anonymous-namespace` (#142839)
Finds function and variable declarations inside anonymous namespace and
suggests replacing them with ``static`` declarations.
The check will enforce that
[restrict-visibility](https://llvm.org/docs/CodingStandards.html#restrict-visibility)
rule in LLVM Coding Standards is followed correctly (by adding `static`
to functions instead of putting them in anonimous namespace).
The check has additional levels of "strictness" represented by Options.
By default, the check works in the most relaxed way by giving warning
only for methods and functions defined in anonymous namespaces. Also, It
finds `static` functions that are placed inside anonymous namespace -
there is no point in keeping them inside.
[clang] Don't pass sanitizers' rtlibs to linker with `-r` (#147905)
If clang is invoked with `-r` (relocatable linking) then we shouldn't
construct sanitizer arguments and then pass sanitizer runtime libs to
the linker
GCC also skips runtime linking if `-r` is also here
[RISCV] Use Predicates instead of Added Complexity to prefer QC_SELECTEQI over QC_MVEQI. NFC (#148312)
IMHO AddedComplexity should be used as a last resort. We should use
other mechanism like Predicates and PatFrag predicates to give priority.
[RISCV] Remove unneeded AddedComplexity from Xqcibi patterns. NFCI (#148301)
We don't have any tests that show why this AddedComplexity is needed.
ImmLeafs are automatically ranked higher than register operands so there
is no ambgiuity with the base ISA here.
[CIR] Add bit reverse and byte reverse operations (#147200)
This patch adds support for the following two builtin functions:
- `__builtin_bswap`, represented by the `cir.byte_swap` operation.
- `__builtin_bitreverse`, represented by the `cir.bit.reverse`
operation.
X86: Support dollar symbol for AT&T syntax and add output-asm-variant to llc
'$' indicates immediate values in AT&T syntax, so symbol names starting
with '$' need to be quoted or wrapped in parentheses. Parentheses are
preferred to support expressions with relocation specifiers without
modifying MCExpr internals, aligning with GCC (https://gcc.gnu.org/PR91298).
Add `-output-asm-variant` to llc for testing Intel syntax, avoiding
`-x86-asm-syntax` which affects MCAsmInfo used by input assembly
(-x86-asm-syntax=intel doesn't work with AT&T module asm)
Note: In these positions the symbol name cannot be quoted: `$var:`
`.globl $var` `.type $var, @object`
Close #147587
Pull Request: https://github.com/llvm/llvm-project/pull/147876