LLVM/project 6f47c92clang/docs ReleaseNotes.md, clang/include/clang/Basic DiagnosticGroups.td

Revert "[Clang] Enable -Wunused-template under -Wall" (#207848)

Reverts llvm/llvm-project#206123

See the Flang Runtime unit test failures, we probably should fix those
before merging this to keep buildbots green.
DeltaFile
+0-5clang/docs/ReleaseNotes.md
+1-1clang/include/clang/Basic/DiagnosticGroups.td
+0-2clang/test/Misc/warning-wall.c
+1-1clang/test/SemaCXX/warn-func-not-needed.cpp
+1-1clang/test/SemaCXX/warn-variable-not-needed.cpp
+3-105 files

LLVM/project 5275ff2clang/lib/Headers __clang_gpu_device_functions.h __clang_gpu_intrinsics.h, clang/test/Driver hip-device-libs-llvm-env.hip

[Clang][HIP] Add LLVM vendored device headers for `*-llvm` triple (#203980)

Summary:
We already have the `*-llvm` vendor triple to imply a hermetic LLVM
toolchain for HIP. This adds the device portion of the headers that can
be used without a ROCm installation. These are vendored just like the
CUDA ones. Despite being HIP, these are actually generic because it onyl
uses clang builtins and the `gpuintrin` shims.
DeltaFile
+411-0clang/lib/Headers/__clang_gpu_device_functions.h
+242-0clang/lib/Headers/__clang_gpu_intrinsics.h
+142-0clang/test/Headers/gpu-device-functions.cpp
+71-0clang/lib/Headers/__clang_gpu_builtin_vars.h
+23-0clang/test/Driver/hip-device-libs-llvm-env.hip
+9-0clang/test/Preprocessor/predefined-macros.c
+898-03 files not shown
+912-09 files

LLVM/project 1fd4654lldb/test/API/tools/lldb-dap/exception TestDAP_exception.py, lldb/test/API/tools/lldb-dap/exception/asan TestDAP_asan.py

[lldb-dap] Migrate DAP exceptions test. (#207029)

Migrate all the tests in the `lldb-dap/exception` folder.
DeltaFile
+53-36lldb/test/API/tools/lldb-dap/exception/objc/TestDAP_exception_objc.py
+72-13lldb/test/API/tools/lldb-dap/exception/cpp/TestDAP_exception_cpp.py
+19-12lldb/test/API/tools/lldb-dap/exception/ubsan/TestDAP_ubsan.py
+15-13lldb/test/API/tools/lldb-dap/exception/asan/TestDAP_asan.py
+16-11lldb/test/API/tools/lldb-dap/exception/TestDAP_exception.py
+11-0lldb/test/API/tools/lldb-dap/exception/cpp/main.cpp
+186-851 files not shown
+190-867 files

LLVM/project 95dd950clang/test/CodeGen attr-counted-by.c, llvm/test/CodeGen/AMDGPU lower-buffer-fat-pointers-contents-legalization-alignment.ll regalloc-hoist-spill-live-range-upd.ll

Rebase

Created using spr 1.3.7
DeltaFile
+3,280-0llvm/test/CodeGen/AMDGPU/lower-buffer-fat-pointers-contents-legalization-alignment.ll
+0-2,870llvm/test/CodeGen/AMDGPU/regalloc-hoist-spill-live-range-upd.ll
+0-2,755clang/test/CodeGen/attr-counted-by.c
+1,793-835llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-fadd.ll
+1,490-652llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-fmax.ll
+1,490-652llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-fmin.ll
+8,053-7,7641,793 files not shown
+74,233-35,5091,799 files

LLVM/project e27218ellvm/lib/DebugInfo/DWARF DWARFDebugLine.cpp DWARFDebugAbbrev.cpp, llvm/lib/DebugInfo/GSYM DwarfTransformer.cpp

Reapply "DebugInfo: Shrink-to-fit some containers to reduce peak memory usage" (#199145) (#201160)

Starting with posting this as a draft PR to run presubmit checks to
understand what failed.

This reverts commit #199145,
effectively reapplying #198935.
DeltaFile
+3-4llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
+3-0llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
+1-0llvm/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp
+1-0llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
+8-44 files

LLVM/project c63adb2clang/docs ReleaseNotes.md, clang/lib/AST MicrosoftMangle.cpp

[clang] Cap MS RTTI TypeDescriptor name strings like MSVC does (#206317)

On the Microsoft ABI, an RTTI TypeDescriptor stores the type's decorated
name as an inline string. Unlike symbol names, this string was never run
through the MD5 shortening that MSVC applies to over-long decorated
names. Deeply nested template types therefore produced unbounded
writable .data COMDATs: for example a type whose template arguments
contain a local lambda, whose mangled name re-spells the enclosing
template context at every level of nesting, grows exponentially with
depth. A five-level repro emitted an 82 MB object file.

Wrap the TypeDescriptor name string in the same msvc_hashing_ostream
already used for the RTTI symbol. When the name reaches the length limit
it is replaced by ??@<md5>@, mimicking MSVC. MSVC counts the leading .
of the name string toward the 4096-character limit but excludes it from
the hashed input, so the threshold here is one lower than for symbols.

Fixes #206313
DeltaFile
+36-0clang/test/CodeGenCXX/mangle-ms-md5.cpp
+11-5clang/lib/AST/MicrosoftMangle.cpp
+6-0clang/docs/ReleaseNotes.md
+53-53 files

LLVM/project ff11bbcclang/include/clang/AST DeclTemplate.h, clang/lib/AST DeclTemplate.cpp

[clang] Reland: fix getTemplateInstantiationArgs (#207825)

Relands https://github.com/llvm/llvm-project/pull/199528
Previous: https://github.com/llvm/llvm-project/pull/202088

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

    [5 lines not shown]
DeltaFile
+194-429clang/lib/Sema/SemaTemplateInstantiate.cpp
+291-165clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+151-147clang/lib/Sema/SemaTemplate.cpp
+96-95clang/include/clang/AST/DeclTemplate.h
+59-129clang/lib/Sema/SemaConcept.cpp
+60-92clang/lib/AST/DeclTemplate.cpp
+851-1,05762 files not shown
+1,558-1,73168 files

LLVM/project 94b3254clang/include/clang/Basic DiagnosticSemaKinds.td, clang/lib/Sema SemaChecking.cpp

Revert "[Clang][Sema] Add -Wstringop-overread warning for source buffer overreads (#183004)" (#207840)

This reverts commit 86f2e71cb8d165b59ad31a442b2391e23826133e.

And revert followup ab1ef459069d1dbf4ee9e5a802537ababe294b25 (#205201).

Causes crashes:
https://github.com/llvm/llvm-project/pull/183004#issuecomment-4897195939
DeltaFile
+82-163clang/lib/Sema/SemaChecking.cpp
+0-175clang/test/Sema/warn-stringop-overread.c
+10-10clang/test/AST/ByteCode/builtin-functions.cpp
+3-5clang/test/Sema/warn-fortify-source.c
+0-4clang/include/clang/Basic/DiagnosticSemaKinds.td
+0-4clang/test/Analysis/bstring.c
+95-3617 files not shown
+100-37113 files

LLVM/project cb0b826.ci compute_projects_test.py compute_projects.py, .github/workflows libclang-python-tests.yml

CI: move libclang python byindings tests to main CI

This removes the separate python bindings CI, which run on the GitHub free
runners and take more than one hour to build libclang.

The tests are executed instead in the monolithic pipelines,
whenever clang would be tested.

This is fine in terms of resources because all the dependencies are
built anyway, and the tests themselves take less than one second to
run on the free runners.
DeltaFile
+0-59.github/workflows/libclang-python-tests.yml
+13-12.ci/compute_projects_test.py
+8-3clang/bindings/python/tests/cindex/test_source_range.py
+3-1clang/bindings/python/tests/cindex/test_translation_unit.py
+1-1.ci/compute_projects.py
+25-765 files

LLVM/project 2e42fddllvm/lib/Target/BPF BPFMIPeephole.cpp BPFCodeGenPassBuilder.cpp

[𝘀𝗽𝗿] changes to main this commit is based on

Created using spr 1.3.7

[skip ci]
DeltaFile
+119-53llvm/lib/Target/BPF/BPFMIPeephole.cpp
+122-0llvm/lib/Target/BPF/BPFCodeGenPassBuilder.cpp
+60-29llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp
+37-28llvm/lib/Target/BPF/BPFCheckAndAdjustIR.cpp
+56-8llvm/lib/Target/BPF/BPF.h
+14-47llvm/lib/Target/BPF/BPFTargetMachine.cpp
+408-1655 files not shown
+437-16511 files

LLVM/project 39ad957llvm/lib/Target/BPF BPFMIPeephole.cpp BPFCodeGenPassBuilder.cpp

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+119-53llvm/lib/Target/BPF/BPFMIPeephole.cpp
+122-0llvm/lib/Target/BPF/BPFCodeGenPassBuilder.cpp
+60-29llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp
+66-10llvm/lib/Target/BPF/BPF.h
+33-33llvm/lib/Target/BPF/BPFMIChecking.cpp
+37-28llvm/lib/Target/BPF/BPFCheckAndAdjustIR.cpp
+437-1536 files not shown
+483-20212 files

LLVM/project 4ddf6a9llvm/test/CodeGen/AMDGPU lower-buffer-fat-pointers-contents-legalization-alignment.ll regalloc-hoist-spill-live-range-upd.ll

Rebase

Created using spr 1.3.7
DeltaFile
+3,280-0llvm/test/CodeGen/AMDGPU/lower-buffer-fat-pointers-contents-legalization-alignment.ll
+0-2,870llvm/test/CodeGen/AMDGPU/regalloc-hoist-spill-live-range-upd.ll
+1,793-835llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-fadd.ll
+1,490-652llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-fmin.ll
+1,490-652llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-fmax.ll
+1,471-539llvm/test/CodeGen/AMDGPU/lower-buffer-fat-pointers-mem-transfer.ll
+9,524-5,548918 files not shown
+40,115-18,192924 files

LLVM/project 77be60dclang/docs ReleaseNotes.md, clang/include/clang/Basic DiagnosticGroups.td

Revert "[Clang] Enable -Wunused-template under -Wall (#206123)"

This reverts commit f348d964af441ec454e5fc12ab1b599cfc1e7d14.
DeltaFile
+0-5clang/docs/ReleaseNotes.md
+1-1clang/include/clang/Basic/DiagnosticGroups.td
+0-2clang/test/Misc/warning-wall.c
+1-1clang/test/SemaCXX/warn-variable-not-needed.cpp
+1-1clang/test/SemaCXX/warn-func-not-needed.cpp
+3-105 files

LLVM/project 2651bd7llvm/lib/Target/BPF BPFMIPeephole.cpp BPFCodeGenPassBuilder.cpp

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+119-53llvm/lib/Target/BPF/BPFMIPeephole.cpp
+122-0llvm/lib/Target/BPF/BPFCodeGenPassBuilder.cpp
+60-29llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp
+37-28llvm/lib/Target/BPF/BPFCheckAndAdjustIR.cpp
+56-8llvm/lib/Target/BPF/BPF.h
+14-47llvm/lib/Target/BPF/BPFTargetMachine.cpp
+408-1655 files not shown
+437-16511 files

LLVM/project fc83fd7llvm/lib/Target/BPF BPFMIPeephole.cpp BPFCodeGenPassBuilder.cpp

[𝘀𝗽𝗿] changes to main this commit is based on

Created using spr 1.3.7

[skip ci]
DeltaFile
+88-39llvm/lib/Target/BPF/BPFMIPeephole.cpp
+123-0llvm/lib/Target/BPF/BPFCodeGenPassBuilder.cpp
+60-29llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp
+37-28llvm/lib/Target/BPF/BPFCheckAndAdjustIR.cpp
+12-45llvm/lib/Target/BPF/BPFTargetMachine.cpp
+45-6llvm/lib/Target/BPF/BPF.h
+365-1475 files not shown
+393-14711 files

LLVM/project 7c04585clang/include/clang/ScalableStaticAnalysis/Analyses/OperatorNewDelete OperatorNewDeletePointers.h, clang/lib/ScalableStaticAnalysis/Analyses SSAFAnalysesCommon.h

address comments
DeltaFile
+9-8clang/lib/ScalableStaticAnalysis/Analyses/SSAFAnalysesCommon.h
+7-4clang/include/clang/ScalableStaticAnalysis/Analyses/OperatorNewDelete/OperatorNewDeletePointers.h
+4-4clang/unittests/ScalableStaticAnalysis/Analyses/OperatorNewDelete/OperatorNewDeletePointersExtractorTest.cpp
+20-163 files

LLVM/project 3a98f5dllvm/lib/Target/BPF BPFCodeGenPassBuilder.cpp

update

Created using spr 1.3.7
DeltaFile
+1-0llvm/lib/Target/BPF/BPFCodeGenPassBuilder.cpp
+1-01 files

LLVM/project 5499c56llvm/lib/Target/BPF BPFCodeGenPassBuilder.cpp BPFMIPeephole.cpp

[𝘀𝗽𝗿] changes to main this commit is based on

Created using spr 1.3.7

[skip ci]
DeltaFile
+122-0llvm/lib/Target/BPF/BPFCodeGenPassBuilder.cpp
+78-39llvm/lib/Target/BPF/BPFMIPeephole.cpp
+60-29llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp
+37-28llvm/lib/Target/BPF/BPFCheckAndAdjustIR.cpp
+12-45llvm/lib/Target/BPF/BPFTargetMachine.cpp
+37-6llvm/lib/Target/BPF/BPF.h
+346-1475 files not shown
+373-14711 files

LLVM/project b3867c5llvm/lib/Target/BPF BPFMIPeephole.cpp BPFCodeGenPassBuilder.cpp

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+88-39llvm/lib/Target/BPF/BPFMIPeephole.cpp
+122-0llvm/lib/Target/BPF/BPFCodeGenPassBuilder.cpp
+60-29llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp
+37-28llvm/lib/Target/BPF/BPFCheckAndAdjustIR.cpp
+12-45llvm/lib/Target/BPF/BPFTargetMachine.cpp
+45-6llvm/lib/Target/BPF/BPF.h
+364-1475 files not shown
+392-14711 files

LLVM/project 1b6f152llvm/include/llvm/DebugInfo/DWARF DWARFDie.h, llvm/lib/DebugInfo/DWARF DWARFDie.cpp

[llvm][DebugInfo] Add DW_LNAME_ support to DWARFDie::getLanguage (#207151)

Currently `DWARFDie::getLanguage` only looks at `DW_AT_language`.
However, with DWARFv6 we may not have such attribute, and instead have a
`DW_AT_language_name` (and optional `DW_AT_language_version`).

This patch adjusts the implementation to also consider the DWARFv6
language name/version codes. In this patch I just convert it back to
`DW_LANG_` (similar to what we do for the `AsmPrinter`'s
`DwarfUnit::getSourceLanguage`). Added a FIXME to investigate whether we
want to return a variant-like type that can be either an DW_LANG vs.
DW_LNAME code.

The way I initially observed this was looking at a DWARFv6 dwarfdump for
a `const char[]` type. It displayed as follows:
```
DW_AT_type  (0x... "const char[[?, ? + 3)]")
```
which is our representation for when we [can't derive the default lower

    [12 lines not shown]
DeltaFile
+197-0llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp
+108-0llvm/test/tools/llvm-dwarfdump/X86/array-type-lower-bound-dwarf6.s
+18-6llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
+1-0llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h
+324-64 files

LLVM/project 7b7508b.ci compute_projects_test.py compute_projects.py, .github/workflows libclang-python-tests.yml

CI: move libclang python byindings tests to main CI

This removes the separate python bindings CI, which run on the GitHub free
runners and take more than one hour to build libclang.

The tests are executed instead in the monolithic pipelines,
whenever clang would be tested.

This is fine in terms of resources because all the dependencies are
built anyway, and the tests themselves take less than one second to
run on the free runners.
DeltaFile
+0-59.github/workflows/libclang-python-tests.yml
+13-12.ci/compute_projects_test.py
+8-3clang/bindings/python/tests/cindex/test_source_range.py
+3-1clang/bindings/python/tests/cindex/test_translation_unit.py
+1-1.ci/compute_projects.py
+25-765 files

LLVM/project fab843ellvm/lib/Target/BPF BPFCodeGenPassBuilder.cpp BPFMIPeephole.cpp

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+122-0llvm/lib/Target/BPF/BPFCodeGenPassBuilder.cpp
+78-39llvm/lib/Target/BPF/BPFMIPeephole.cpp
+60-29llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp
+37-28llvm/lib/Target/BPF/BPFCheckAndAdjustIR.cpp
+12-45llvm/lib/Target/BPF/BPFTargetMachine.cpp
+37-6llvm/lib/Target/BPF/BPF.h
+346-1475 files not shown
+373-14711 files

LLVM/project 7b79135llvm/lib/Target/BPF BPFCodeGenPassBuilder.cpp BPFMISimplifyPatchable.cpp

[𝘀𝗽𝗿] changes to main this commit is based on

Created using spr 1.3.7

[skip ci]
DeltaFile
+122-0llvm/lib/Target/BPF/BPFCodeGenPassBuilder.cpp
+60-29llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp
+37-28llvm/lib/Target/BPF/BPFCheckAndAdjustIR.cpp
+42-23llvm/lib/Target/BPF/BPFMIPeephole.cpp
+8-44llvm/lib/Target/BPF/BPFTargetMachine.cpp
+35-6llvm/lib/Target/BPF/BPF.h
+304-1305 files not shown
+331-13011 files

LLVM/project 3df648cllvm/test/Transforms/InstCombine select-abs-positive-mul.ll

[InstCombine] Add tests for select-abs through multiply (NFC) (#207833)

Add tests from approved https://github.com/llvm/llvm-project/pull/207539
DeltaFile
+361-0llvm/test/Transforms/InstCombine/select-abs-positive-mul.ll
+361-01 files

LLVM/project 8014a1dllvm/include/llvm/Support LEB128.h, llvm/unittests/Support LEB128Test.cpp

[Support] Fix undefined shift in decodeULEB128/decodeSLEB128 for overlong encodings (#205907)

When a (signed or unsigned) LEB128 value is encoded with extra trailing
bytes that only carry zero- or sign-extension, the decode loop could
keep
running with the shift amount at 64 or beyond and then evaluate
`Slice << Shift`, which is undefined behavior for a 64-bit type.

The DWARF expression parser feeds attacker-controlled LEB128 operands
(such as `DW_OP_bregN` / `DW_OP_constu`) through
`DataExtractor::getULEB128` / `getSLEB128`, so the
`lldb-dwarf-expression-fuzzer` reaches this under UBSan.  The unsigned
case:

```
LEB128.h:152:20: runtime error: shift exponent 70 is too large for
64-bit type 'uint64_t' (aka 'unsigned long long')
    #0 llvm::decodeULEB128(...) LEB128.h:152
    #1 getLEB128<unsigned long long>(...) DataExtractor.cpp:227

    [27 lines not shown]
DeltaFile
+12-2llvm/include/llvm/Support/LEB128.h
+11-0llvm/unittests/Support/LEB128Test.cpp
+23-22 files

LLVM/project 61b2337llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/RISCV reordered-buildvector-scalars.ll

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+16-14llvm/test/Transforms/SLPVectorizer/RISCV/reordered-buildvector-scalars.ll
+11-7llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+12-1llvm/test/Transforms/SLPVectorizer/X86/trunc-node-reused.ll
+2-2llvm/test/Transforms/SLPVectorizer/X86/commutative-copyable-external-phi-use.ll
+1-1llvm/test/Transforms/SLPVectorizer/X86/copyable-operand-non-scheduled-parent-node.ll
+42-255 files

LLVM/project c9c7fddflang/lib/Optimizer/HLFIR/Transforms SeparateAllocatableAssign.cpp, flang/test/HLFIR separate-allocatable-assign.fir

[flang] keep runtime allocator for pinned allocations (#207822)

If an allocatable is pinned, use the flang runtime instead of lowering
to normal memcpy/free.

---------

Co-authored-by: Yebin Chon <ychon at nvidia.com>
DeltaFile
+29-0flang/test/HLFIR/separate-allocatable-assign.fir
+8-0flang/lib/Optimizer/HLFIR/Transforms/SeparateAllocatableAssign.cpp
+37-02 files

LLVM/project 61d7668clang/lib/CodeGen CGExpr.cpp, clang/test/CodeGen attr-counted-by-nested-structs.c

[Clang][counted_by] Use the expr's RecordDecl that transitively contains the counter field (#205903)

The counted field could be in nested structs. This can happen when the
Expr is pointing to a field that has a struct type. The original code
didn't do a good job at finding the best RecordDecl to build the GEP off
of. It made too many assumptions about how structs' layouts.

This rewrite finds the RecordDecl that transitively contains the
__counted_by__'s counter field.

Fixes: #205652
DeltaFile
+127-0clang/test/CodeGen/attr-counted-by-nested-structs.c
+40-18clang/lib/CodeGen/CGExpr.cpp
+167-182 files

LLVM/project c81b3dbflang/lib/Semantics check-io.cpp mod-file.cpp, flang/test/Semantics enumeration-type-io.f90

Corrected IO restrictions to handle components and make restrictions consistent.
DeltaFile
+65-0flang/lib/Semantics/check-io.cpp
+16-0flang/test/Semantics/enumeration-type-io.f90
+4-4flang/lib/Semantics/mod-file.cpp
+85-43 files

LLVM/project 23a01e9llvm/lib/Target/AArch64 AArch64InstrInfo.cpp, llvm/test/CodeGen/AArch64 stack-guard-width.ll

[AArch64] Support 4-byte stack protector with large code model. (#205956)

This is a simple extension to existing code. We might need this in the
future.
DeltaFile
+14-7llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+7-0llvm/test/CodeGen/AArch64/stack-guard-width.ll
+21-72 files