[clang] fix a bug matching constrained out-of-line definitions of class member functions
The method which gathered the template arguments for transforming constraints
was incorrectly skipping adding the arguments for function templates which are
class members.
This fixes that, and removes an undocumented workaround for template alias CTAD.
Also adds a test case showing #139276 causes a profiling issue with PackIndexExprs,
which for the tests added in that PR gave the false impression they were fixing the
problem, but were actually causing the implementation to be too accepting, which
masked the bug solved in this patch.
[clang] fix a bug matching constrained out-of-line definitions of class member functions
The method which gathered the template arguments for transforming constraints
was incorrectly skipping adding the arguments for function templates which are
class members.
This fixes that, and removes an undocumented workaround for template alias CTAD.
Also adds a test case showing #139276 causes a profiling issue with PackIndexExprs,
which for the tests added in that PR gave the false impression they were fixing the
problem, but were actually causing the implementation to be too accepting, which
masked the bug solved in this patch.
[clang] fix a bug matching constrained out-of-line definitions of class member functions
The method which gathered the template arguments for transforming constraints
was incorrectly skipping adding the arguments for function templates which are
class members.
This fixes that, and removes an undocumented workaround for template alias CTAD.
Also adds a test case showing #139276 causes a profiling issue with PackIndexExprs,
which for the tests added in that PR gave the false impression they were fixing the
problem, but were actually causing the implementation to be too accepting, which
masked the bug solved in this patch.
[clang] fix a bug matching constrained out-of-line definitions of class member functions
The method which gathered the template arguments for transforming constraints
was incorrectly skipping adding the arguments for function templates which are
class members.
This fixes that, and removes an undocumented workaround for template alias CTAD.
Also adds a test case showing #139276 causes a profiling issue with PackIndexExprs,
which for the tests added in that PR gave the false impression they were fixing the
problem, but were actually causing the implementation to be too accepting, which
masked the bug solved in this patch.
Revert "[FileCheck] Add a diff output option for FileCheck (#187120)" (#192803)
This reverts commit 40333cde2bbd62936d67478eab15ed1fa55b0532.
The implementation is buggy. There are thousands of failures in
```
FILECHECK_OPTS=--diff ninja -C /tmp/Rel check-llvm-mc
FILECHECK_OPTS=--diff ninja -C /tmp/Rel check-lld-elf
```
[lldb] Avoid NotRequired for Python < 3.11 compatibility (#192723)
NotRequired was added in Python 3.11, while the minimum supported Python
for LLDB is 3.8. Avoid it by using `Dict[str, Any]` instead.
[flang][OpenMP] Move directive deprecation check to semantic checks
Replace IssueNonConformanceWarning in resolve-directives.cpp with
CheckDirectiveDeprecation in check-omp-structure.cpp.
[AMDGPU] Report only local per-function resource usage when object linking is enabled
With object linking the linker aggregates resource usage across TUs, so
compile-time pessimism and call-graph propagation duplicate the linker's work or
pollute its inputs.
In this mode, skip the per-callsite conservative bumps in
`AMDGPUResourceUsageAnalysis` and assign each resource symbol in
`AMDGPUMCResourceInfo` a concrete local constant instead of building call-graph
`max`/`or` expressions.
[VPlan] Strip vp_post_order_{deep,shallow} (NFC) (#192787)
Post 691a130 ([ADT] Refactor post order traversal, #191047),
PostOrderTraversal's lifetime needs to exceed the lifetime of the
iterator. The vp_post_order_{deep,shallow} helpers now have the
potential for being used incorrectly: hence, strip them, and require the
PostOrderTraversal to be constructed explictly, similar to RPOT.
[flang][OpenMP] Move ALLOCATE + privatize check to semantic checks
Move the check from symbol resolution to semantic checks.
The check now seems to be more accurate, catching some cases that were
not detected before.
[clang][ssaf] Rework NestedBuildNamespaces of TU and LU summaries (#191489)
Problem:
ASTEntityMapping::getEntityName() creates EntityName with an empty
NestedBuildNamespace, but the linker expected the TU namespace to
already be present in the EntityName. This caused internal linkage
symbols to conflict during linking: since their NestedBuildNamespace was
empty, they all inherited the same LU namespace during resolution,
making internal symbols from different TUs appear identical. For
example, two "static inline" functions with the same USR in separate TUs
would be incorrectly merged into a single LU entity instead of remaining
distinct.
This is now fixed and demonstrated by the
InternalLinkageWithEmptyNamespaceAcrossTUs test, which creates two
internal linkage symbols across two TUs and verifies they remain
separate after linking.
[27 lines not shown]
[AArch64][GISel] Regbank G_BITCAST using src regbank. (#191522)
This takes the regbank of a G_BITCAST from the input srcreg that has
already been allocated, keeping the bitcast on the same bank. A copy
then might be added to the dst if needed.
onlyUsesFP is also improved for G_BITCAST, allowing operations to guess
the correct type through a onlyUsesFP too.
Originally from #177158 by Ryan Cowan with modifications.
[clang-format] Preserve trailing NOLINTEND placement with SeparateDefinitionBlocks (#190741)
Fixes https://github.com/llvm/llvm-project/issues/189384.
When `SeparateDefinitionBlocks: Always` is enabled, clang-format may
separate a clearly trailing comment block by inserting an empty line
before it.
For example, it may format:
```c++
// NOLINTBEGIN
int x = 1;
int y = 2;
// NOLINTEND
void some_function() {}
```
[23 lines not shown]
[lldb][Utility] Add FileSpecList::Append(const FileSpecList &) API (#191446)
Adds a new API to `FileSpecList` that allows appending another
`FileSpecList`.
This is used in another PR where I didn't want to iterate over the list
and push_back manually.
Assisted-by: Claude
- Used Claude to write the skeleton of the test before manually cleaning
it up.
[Clang] diagnosing missing Vulkan environment when using SPIR-V triple (#190840)
When a user passes '-target spirv' without specififying a vulkan
environment ttriple, SPIRVTargetInfo will fire an assert instead of
throwing an error diagnostic. Added this diagnostic in
CompilerInstance::createTarget() before target is initialized. Fixes
https://github.com/llvm/llvm-project/issues/189964
[X86] combineINSERT_SUBVECTOR - attempt to widen mask predicate as scalar integer instead of inserting into a zero vXi1 vector (#192699)
Fold vXi1 insert_subvector(zero_vector(),bitcast(scalar_mask),idx) ->
bitcast(shl(zext(scalar_mask),idx))
vXi1 zero widening and insertion has to rely on kshiftl/kshiftr pairs,
but if the mask was a scalar it can be a lot cheaper to just widen it to
a wider (legal) scalar first.
Cleans up some codegen for #192034 - first step towards pruning all the
VMOVSH patterns we've ended up :/