Changes

Summary

  1. [docs] Fix broken link rendering in the LLVM Coding Standards. (details)
  2. [clang] Support __float128 on DragonFlyBSD. (details)
  3. Revert "[fir] Add Character helper" (details)
  4. [libcxx] Support allocators with explicit c-tors in vector<bool> (details)
  5. [libcxx] Throw correct exception from std::vector::reserve (details)
  6. [NFC][LoopIdiom] Make for loops more readable (details)
  7. [lldb] Add omitted abstract formal parameters in DWARF symbol files (details)
  8. [mlir] Use empty() calls where possible. (details)
  9. [mlir] Fix a crash when creating a 1d zero element LLVM constant (details)
  10. [lldb] Remove ConstString from GetPluginNameStatic of some plugins (details)
  11. [lldb] Silence -Wpessimizing-move warning (details)
  12. Revert "AddGlobalAnnotations for function with or without function body." (details)
  13. [clang][deps] Ensure reported context hash is strict (details)
  14. [clang][deps] NFC: Remove redundant CompilerInstance reference (details)
  15. [clang][deps] NFC: Rename scanning CompilerInstance (details)
  16. [clang][deps] NFC: Rename building CompilerInvocation (details)
  17. [ARM] Add new abs test. NFC (details)
  18. [MIPS] Fix switching between 32/64-bit variants of r6 target triples (details)
  19. [SVE] Fix selection failure when splitting extended masked loads (details)
  20. [lldb] Fix a thinko in 2ace1e57 (details)
  21. [clang][deps] Make resource directory deduction configurable (details)
  22. Relax assert in ExprConstant to a return None. (details)
Commit 9635b2951da18ade951341f7ec6b9a7b8eb7cba3 by fred
[docs] Fix broken link rendering in the LLVM Coding Standards.
The file was modifiedllvm/docs/CodingStandards.rst
Commit b471e25a59241b6b60e75494ca7b8d775a4131a2 by fred
[clang] Support __float128 on DragonFlyBSD.

Differential Revision: https://reviews.llvm.org/D111760
The file was modifiedclang/lib/Basic/Targets/OSTargets.h
Commit 7bbd7e9c1d1d7feabe6639b1df4a11e648e2f886 by clementval
Revert "[fir] Add Character helper"

This reverts commit e4ce92245c96cea9492767d7149eb9e30dee0d16.

Buildbots not happy with the tests.
The file was modifiedflang/unittests/Optimizer/CMakeLists.txt
The file was modifiedflang/unittests/Optimizer/Builder/FIRBuilderTest.cpp
The file was removedflang/include/flang/Optimizer/Builder/Character.h
The file was modifiedflang/include/flang/Optimizer/Builder/FIRBuilder.h
The file was modifiedflang/include/flang/Optimizer/Dialect/FIROpsSupport.h
The file was modifiedflang/lib/Optimizer/Builder/FIRBuilder.cpp
The file was removedflang/unittests/Optimizer/Builder/CharacterTest.cpp
The file was removedflang/lib/Optimizer/Builder/Character.cpp
The file was modifiedflang/lib/Optimizer/Builder/CMakeLists.txt
The file was modifiedflang/include/flang/Optimizer/Dialect/FIRType.h
Commit 49be23a1eb5743fa92a8367b6081674a8a392da3 by mikhail.maltsev
[libcxx] Support allocators with explicit c-tors in vector<bool>

std::vector<bool> rebinds the supplied allocator to construct objects
of type '__storage_type' rather than 'bool'. Allocators are allowed to
use explicit conversion constructors, so care must be taken when
performing conversions.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D112150
The file was modifiedlibcxx/test/std/containers/sequences/vector.bool/reserve.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector.bool/insert_iter_iter_iter.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector.bool/insert_iter_size_value.pass.cpp
The file was modifiedlibcxx/include/vector
The file was modifiedlibcxx/test/std/containers/sequences/vector.bool/insert_iter_value.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector.bool/resize_size.pass.cpp
Commit 05a2d1766864f60210d8f337a7ea709fa0707b53 by mikhail.maltsev
[libcxx] Throw correct exception from std::vector::reserve

According to the standard [vector.capacity]/5, std::vector<T>::reserve
shall throw an exception of type std::length_error when the requested
capacity exceeds max_size().

This behavior is not implemented correctly: the function 'reserve'
simply propagates the exception from allocator<T>::allocate. Before
D110846 that exception used to be of type std::length_error (which is
correct for vector<T>::reserve, but incorrect for
allocator<T>::allocate).

This patch fixes the issue and adds regression tests.

Reviewed By: Quuxplusone, ldionne, #libc

Differential Revision: https://reviews.llvm.org/D112068
The file was modifiedlibcxx/test/std/containers/sequences/vector.bool/reserve.pass.cpp
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp
The file was modifiedlibcxx/include/vector
Commit 9ba5bb43099db70031e0df6a438e7cb56fb05540 by dawid_jurek
[NFC][LoopIdiom] Make for loops more readable

Patch simplifies for loops in LIR following LLVM guidelines: https://llvm.org/docs/CodingStandards.html#use-range-based-for-loops-wherever-possible.

Differential Revision: https://reviews.llvm.org/D112077
The file was modifiedllvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
Commit 5a3556aa5563fb89693935303463881df44094de by jarin
[lldb] Add omitted abstract formal parameters in DWARF symbol files

This patch fixes a problem introduced by clang change
https://reviews.llvm.org/D95617 and described by
https://bugs.llvm.org/show_bug.cgi?id=50076#c6, where inlined functions
omit unused parameters both in the stack trace and in `frame var`
command. With this patch, the parameters are listed correctly in the
stack trace and in `frame var` command.

Specifically, we parse formal parameters from the abstract version of
inlined functions and use those formal parameters if they are missing
from the concrete version.

Differential Revision: https://reviews.llvm.org/D110571
The file was modifiedlldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
The file was addedlldb/test/API/functionalities/unused-inlined-parameters/main.c
The file was addedlldb/test/Shell/SymbolFile/DWARF/x86/unused-inlined-params.test
The file was addedlldb/test/Shell/SymbolFile/DWARF/x86/Inputs/unused-inlined-params.s
The file was addedlldb/test/API/functionalities/unused-inlined-parameters/Makefile
The file was modifiedlldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
The file was addedlldb/test/API/functionalities/unused-inlined-parameters/TestUnusedInlinedParameters.py
Commit 376c1389f6f33615871cbbe986b75372cd411616 by akuegel
[mlir] Use empty() calls where possible.

These are based on findings from the ClangTidy
readability-container-size-empty check.
The file was modifiedmlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
Commit 898e80964c950fb49a133ff6018079fe8a7c922b by benny.kra
[mlir] Fix a crash when creating a 1d zero element LLVM constant

Fixes a regression introduced in f9be7a7afda3c90b99c9f50e5eff1624da5a6511

Differential Revision: https://reviews.llvm.org/D112208
The file was modifiedmlir/lib/Target/LLVMIR/ModuleTranslation.cpp
The file was modifiedmlir/test/Target/LLVMIR/llvmir.mlir
Commit 2ace1e5753a49195ca17f3e175c7e189cf147760 by pavel
[lldb] Remove ConstString from GetPluginNameStatic of some plugins

This patch deals with ObjectFile, ObjectContainer and OperatingSystem
plugins. I'll convert the other types in separate patches.

In order to enable piecemeal conversion, I am leaving some ConstStrings
in the lowest PluginManager layers. I'll convert those as the last step.

Differential Revision: https://reviews.llvm.org/D112061
The file was modifiedlldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.h
The file was modifiedlldb/source/Core/PluginManager.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h
The file was modifiedlldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
The file was modifiedlldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
The file was modifiedlldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
The file was modifiedlldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h
The file was modifiedlldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp
The file was modifiedlldb/include/lldb/Core/PluginManager.h
The file was modifiedlldb/source/API/SBProcess.cpp
The file was modifiedlldb/source/Target/OperatingSystem.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
The file was modifiedlldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h
The file was modifiedlldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
The file was modifiedlldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h
The file was modifiedlldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp
The file was modifiedlldb/source/Commands/CommandObjectProcess.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.h
The file was modifiedlldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h
The file was modifiedlldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
The file was modifiedlldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
Commit 39724158d38766f7d8683f78f54d80d174cae96a by benny.kra
[lldb] Silence -Wpessimizing-move warning

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:3635:10: error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move]
  return std::move(merged);
         ^
The file was modifiedlldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
Commit aad244dfc566236e9d3ef48c7aea3616bb6aab14 by aaron
Revert "AddGlobalAnnotations for function with or without function body."

This reverts commit 121b2252de0eed68f2ddf5f09e924a6c35423d47.

The following code causes a crash in some circumstances:

  struct k {
    ~k() __attribute__((annotate(""))) {}
  };
  void m() { k(); }
The file was modifiedclang/test/CodeGen/annotations-global.c
The file was modifiedclang/test/CodeGenCXX/attr-annotate.cpp
The file was modifiedclang/lib/CodeGen/CodeGenModule.cpp
Commit 954d77b98dd69c6bcf808e3dac871171d4832bad by Jan Svoboda
[clang][deps] Ensure reported context hash is strict

One of main goals of the dependency scanner is to be strict about module compatibility. This is achieved through strict context hash. This patch ensures that strict context hash is enabled not only during the scan itself (and its minimized implicit build), but also when actually reporting the dependency.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D111720
The file was addedclang/test/ClangScanDeps/Inputs/modules-context-hash/b/dep.h
The file was modifiedclang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
The file was addedclang/test/ClangScanDeps/Inputs/modules-context-hash/cdb.json.template
The file was addedclang/test/ClangScanDeps/Inputs/modules-context-hash/module.modulemap
The file was addedclang/test/ClangScanDeps/Inputs/modules-context-hash/mod.h
The file was addedclang/test/ClangScanDeps/Inputs/modules-context-hash/a/dep.h
The file was addedclang/test/ClangScanDeps/modules-context-hash.c
The file was addedclang/test/ClangScanDeps/Inputs/modules-context-hash/tu.c
Commit 24616664afd455d7fde9cf4c631ff30347196bbc by Jan Svoboda
[clang][deps] NFC: Remove redundant CompilerInstance reference

The `ModuleDepCollectorPP` class holds a reference to `ModuleDepCollector` as well as `ModuleDepCollector`'s `CompilerInstance`. The fact that these refer to the same object is non-obvious.

This patch removes the `CompilerInvocation` reference from `ModuleDepCollectorPP` and accesses it through `ModuleDepCollector` instead.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D111724
The file was modifiedclang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
The file was modifiedclang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
Commit 207e9fdea704dd8c6db077971d958abb8b4d6d84 by Jan Svoboda
[clang][deps] NFC: Rename scanning CompilerInstance

The dependency scanner works with multiple instances of `Compiler{Instance,Invocation}`. From names of the variables/members, their purpose is not obvious.

This patch gives a distinct name to the `CompilerInstance` that's used to run the implicit build during dependency scan.

Depends on D111724.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D111725
The file was modifiedclang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
The file was modifiedclang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
The file was modifiedclang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
Commit c62220f9623dde699b88baf47c0a3dca400767fb by Jan Svoboda
[clang][deps] NFC: Rename building CompilerInvocation

The dependency scanner works with multiple instances of `Compiler{Instance,Invocation}`. From names of the variables/members, their purpose is not obvious.

This patch gives descriptive name to the generated `CompilerInvocation` that can be used to derive the command-line to build a modular dependency.

Depends on D111725.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D111728
The file was modifiedclang/tools/clang-scan-deps/ClangScanDeps.cpp
The file was modifiedclang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
The file was modifiedclang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
Commit 9bfe7af1597661b5ff5102605b65ff288071a394 by david.green
[ARM] Add new abs test. NFC
The file was addedllvm/test/CodeGen/Thumb2/abs.ll
Commit 302a165e18fda8318e9e1ce6f452a48925cb3857 by simon
[MIPS] Fix switching between 32/64-bit variants of r6 target triples

If clang driver gets 64-bit r6 target triple like `mipsisa64r6` and
additional option forces switching to generation of 32-bit code, it
loses r6 abi and generates 32-bit r2-r5 abi code.

```
$ clang -target mipsisa64r6-linux-gnu -mabi=32
```

This patch fixes the problem.

- Add optional `SubArchType` argument to the `Triple::setArch()` method.
- Implement generation of mips r6 target triples in the
  `Triple::getArchName()` method.

Differential Revision: https://reviews.llvm.org/D110514.diff
The file was modifiedllvm/lib/Support/Triple.cpp
The file was modifiedllvm/include/llvm/ADT/Triple.h
The file was modifiedllvm/unittests/ADT/TripleTest.cpp
Commit 0d153df69e8fe28bdf7e65195d3708f331106088 by kerry.mclaughlin
[SVE] Fix selection failure when splitting extended masked loads

When splitting a masked load, `GetDependentSplitDestVTs` is used to get the
MemVTs of the high and low parts. If the masked load is extended, this
may return VTs with different element types which are used to create the
high & low masked load instructions.
This patch changes `GetDependentSplitDestVTs` to ensure we return VTs with
the same element type.

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D111996
The file was modifiedllvm/test/CodeGen/AArch64/sve-masked-ldst-zext.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
The file was modifiedllvm/test/CodeGen/AArch64/sve-masked-ldst-sext.ll
Commit 6c88086ba8046884bb30a72ae1a8bea95e46f022 by pavel
[lldb] Fix a thinko in 2ace1e57

An empty plugin name means we should try everything.

Picked up by the windows bot.
The file was modifiedlldb/source/Core/PluginManager.cpp
Commit b8b14b682c339c9ab85360d24ba9b888d52fdfbb by Jan Svoboda
[clang][deps] Make resource directory deduction configurable

The `clang-scan-deps` CLI tool invokes the compiler with `-print-resource-dir` in case the `-resource-dir` argument is missing from the compilation command line. This is to enable running the tool on compilation databases that use compiler from a different toolchain than `clang-scan-deps` itself. While this doesn't make sense when scanning modular builds (due to the `-cc1` arguments the tool generates), the tool can can be used to efficiently scan for file dependencies of non-modular builds too.

This patch stops deducing the resource directory by invoking the compiler by default. This mode can still be enabled by invoking `clang-scan-deps` with `--resource-dir-recipe invoke-compiler`. The new default is `--resource-dir-recipe modify-compiler-path` which relies on the resource directory deduction taking place in `Driver::Driver` which is based on the compiler path. This makes the default more aligned with the intended usage of the tool while still allowing it to serve other use-cases.

Note that this functionality was also influenced by D108979, where the dependency scanner stopped going through `ClangTool::run`. The function tried to deduce the resource directory based on the current executable path, which might not be what the users expect when invoked from within a shared library.

Depends on D108979.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D108366
The file was addedclang/test/ClangScanDeps/Inputs/resource_directory/cdb.json.template
The file was addedclang/test/ClangScanDeps/resource_directory.c
The file was addedclang/test/ClangScanDeps/Inputs/resource_directory/tu.c
The file was addedclang/test/ClangScanDeps/Inputs/resource_directory/mod.h
The file was addedclang/test/ClangScanDeps/Inputs/resource_directory/compiler
The file was modifiedclang/tools/clang-scan-deps/ClangScanDeps.cpp
The file was addedclang/test/ClangScanDeps/Inputs/resource_directory/module.modulemap
Commit 7ff4f48adb26429086d6fd85a14336e57cd340dc by jonathanchesterfield
Relax assert in ExprConstant to a return None.

Fixes a compiler assert on passing a compile time integer to atomic builtins.

Assert introduced in D61522
Function changed from ->bool to ->Optional in D76646
Simplifies call sites to getIntegerConstantExpr to elide the now-redundant
isValueDependent checks.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D112159
The file was modifiedclang/test/SemaTemplate/atomics.cpp
The file was modifiedclang/lib/Sema/SemaTemplateDeduction.cpp
The file was modifiedclang/lib/Sema/SemaExprCXX.cpp
The file was modifiedclang/lib/Sema/SemaAttr.cpp
The file was modifiedclang/lib/AST/ExprConstant.cpp
The file was modifiedclang/lib/Sema/SemaDeclAttr.cpp
The file was modifiedclang/lib/Sema/SemaType.cpp