[clang] fix getTemplateInstantiationArgs
This implements a new strategy for collecting the template arguments, by
relying on the qualifiers and template parameter lists to navigate the template
context of out-of-line definitions.
This greatly simplifies the signature of that function, by removing a bunch
of workarounds, and simpliffying a couple that weren't removed yet.
Since this now relies on qualifiers and template parameter lists,
this patch expends most of its effort making sure these are placed,
transformed and propagated to template instantiations.
Also makes the explicit specialization AST nodes stop abusing the template
parameter lists by storing it's own template parameter list, creating a
dedicated field for them, similar to partial specializations.
[clang-doc] Use llvm RTTI over handrolled casting (#202059)
Clang-Doc has a limited amount of polymorphism over Info types.
Historically, these have just been cast directly in a few places, but we
can use the existing llvm RTTI implementation to more rigorously
dispatch and query the types involved with only limited extra code.
This should make future changes a bit harder to get wrong.
[CodeGen][Transforms] Remove unused DenseMapInfo::getEmptyKey (#201994)
After #201281 DenseMapInfo<T>::getEmptyKey() is no longer used by
DenseMap. Remove the unused getEmptyKey definitions and dead sentinel
uses.
[SLP]Keep reuse mask in sync when reordering split node operand
When reorderBottomToTop uses an operand order for a split vectorize
node and the operand has both reordered and reused scalars, only the
reorder indices were cleared while the reuse mask was left stale. This
diverged the split node scalars from the operand effective order.
Fixes #202003
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/202084
[clang][clang-tools-extra] Remove unused DenseMapInfo::getEmptyKey (#201987)
After #201281 DenseMapInfo<T>::getEmptyKey() is no longer used by
DenseMap. Remove the unused getEmptyKey definitions and dead sentinel
uses.
[M68k] Disassemble index suppress in the full extension word correctly (#202080)
When the IS (Index Suppress) bit in the full extension word is set, we
need to use NoReg for the index register in the decoded MCInst. This was
not properly supported in the disassembler before.
This patch fixes this issue by using a pseudo 5-bit "register" binary
encoding for index register, where the first 4 bits carry the actual
register number and the last bit (at MSB) indicates whether we suppress
index register or not.
[DirectX][ObjectYAML] Fix SRCI Names parsing on Big Endian (#202020)
```
Names.Parameters = HeaderOnDisk;
```
converts SRCI Names section header from little endian to platform native
byte order (in converting constructor).
Therefore, extra
```
if (sys::IsBigEndianHost)
Names.Parameters.swapBytes();
```
can swap bytes of the header fields again, causing an error on SPARC:
```
SRCI Names section content ends beyond the section boundary
```
Fix that.
[IR][Analysis] Remove unused DenseMapInfo::getEmptyKey (#201997)
After #201281 DenseMapInfo<T>::getEmptyKey() is no longer used by
DenseMap. Remove the unused getEmptyKey definitions and dead sentinel
uses.
[VPlan] Prevent dangling references to trip count after expansion. (#201924)
Set trip count to Poison after expanding SCEVs to VPInstructions. getTripCount should not be used after that other than printing; setting to poison avoids accessing dangling references.
[lldb] Remove unused DenseMapInfo::getEmptyKey (#201990)
After #201281 DenseMapInfo<T>::getEmptyKey() is no longer used by
DenseMap. Remove the unused getEmptyKey definitions and dead sentinel
uses.
[llvm] Remove unused DenseMapInfo::getEmptyKey (#201996)
After #201281 DenseMapInfo<T>::getEmptyKey() is no longer used by
DenseMap. Remove the unused getEmptyKey definitions and dead sentinel
uses.
[mlir] Remove unused DenseMapInfo::getEmptyKey (#201991)
After #201281 DenseMapInfo<T>::getEmptyKey() is no longer used by
DenseMap. Remove the unused getEmptyKey definitions and dead sentinel
uses.
[clang-tidy] Fix `altera-id-dependent-backward-branch` false positives (#200660)
The check unconditionally marked the LHS of any assignment from a
variable or field as ID-dependent. As a result, ordinary assignments
like `x = y` or `i += chunk_size` could trigger false positives in later
loop conditions.
Only propagate ID-dependency when the RHS variable or field is already
known ID-dependent.
Based on the fix by @yeputons, with helper renaming and extra tests for
ordinary assignments, fields, macros, aliases, cv/ref cases, lambdas,
templates, concepts, and the #53777 range-for case.
Fix #52790
Fix #53777
Assisted by Codex.
[VPlan] Only print original trip count if it is used. (#202069)
Similarly to other VPlan-scope values, only print trip count when it has
users for consistency.
[InstCombine] Fix incorrect insert point when folding zext of deinterleave (#201977)
Fix invalid module crash in
https://github.com/llvm/llvm-project/pull/195330#issuecomment-4635245035
The problem was caused by incorrect IRBuilder insertion point. The
insertion point used when generating new instructions might not dominate
all the de-interleave fields users. This patch fixes this issue by
explicitly setting the insertion point to either
`llvm.vector.deinterleave2` or the earliest `shufflevector` instruction
(in the de-interleaving group) within the same basicblock.
[ASan] Skip high-shadow and gap setup when HighMem region is empty (#202037)
On targets where the shadow offset sits above all addressable user
memory (e.g. Alpha with ASAN_SHADOW_OFFSET=0x70000000000 and a 42-bit
user VAS), kHighMemBeg is set above kHighMemEnd so the HighMem region is
empty. Since MEM_TO_SHADOW is monotonically increasing, kHighMemBeg >
kHighMemEnd implies kHighShadowBeg > kHighShadowEnd. Calling
ReserveShadowMemoryRange(kHighShadowBeg, kHighShadowEnd) passes size =
kHighShadowEnd - kHighShadowBeg + 1, which underflows to a large
negative value, and mmap() fails with ENOMEM.
ProtectGap is also skipped: there is no meaningful shadow gap between
LowShadow and an empty HighShadow.
Guard both operations on kHighMemBeg <= kHighMemEnd.
[BOLT] Remove unused DenseMapInfo::getEmptyKey (#201986)
After #201281 DenseMapInfo<T>::getEmptyKey() is no longer used by
DenseMap. Remove the unused getEmptyKey definitions and dead sentinel
uses.
[Polly] Remove unused DenseMapInfo::getEmptyKey (#201992)
After #201281 DenseMapInfo<T>::getEmptyKey() is no longer used by
DenseMap. Remove the unused getEmptyKey definitions and dead sentinel
uses.
[lld] Remove unused DenseMapInfo::getEmptyKey (#201989)
After #201281 DenseMapInfo<T>::getEmptyKey() is no longer used by
DenseMap. Remove the unused getEmptyKey definitions and dead sentinel
uses.