Skip to content

Commit e586758

Browse files
authored
Merge branch 'release/20.x' into gh119256-in-clang-20
2 parents 0de62c8 + 3d5f5ef commit e586758

File tree

374 files changed

+16417
-4922
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

374 files changed

+16417
-4922
lines changed

.github/workflows/libclang-abi-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ jobs:
103103
uses: llvm/actions/install-ninja@main
104104
- name: Install abi-compliance-checker
105105
run: |
106+
sudo apt-get update
106107
sudo apt-get install abi-dumper autoconf pkg-config
107108
- name: Install universal-ctags
108109
run: |
@@ -154,7 +155,9 @@ jobs:
154155
path: build-latest
155156

156157
- name: Install abi-compliance-checker
157-
run: sudo apt-get install abi-compliance-checker
158+
run: |
159+
sudo apt-get update
160+
sudo apt-get install abi-compliance-checker
158161
- name: Compare ABI
159162
run: |
160163
for lib in ${{ needs.abi-dump-setup.outputs.ABI_LIBS }}; do

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ jobs:
251251
- name: Install a current LLVM
252252
if: ${{ matrix.mingw != true }}
253253
run: |
254-
choco install -y llvm --version=18.1.6 --allow-downgrade
254+
choco install -y llvm --version=19.1.7 --allow-downgrade
255255
- name: Install llvm-mingw
256256
if: ${{ matrix.mingw == true }}
257257
run: |
258-
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20240606/llvm-mingw-20240606-ucrt-x86_64.zip
258+
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20250114/llvm-mingw-20250114-ucrt-x86_64.zip
259259
powershell Expand-Archive llvm-mingw*.zip -DestinationPath .
260260
del llvm-mingw*.zip
261261
mv llvm-mingw* c:\llvm-mingw

.github/workflows/llvm-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ jobs:
9191
uses: llvm/actions/install-ninja@main
9292
- name: Install abi-compliance-checker
9393
run: |
94+
sudo apt-get update
9495
sudo apt-get install abi-dumper autoconf pkg-config
9596
- name: Install universal-ctags
9697
run: |
@@ -163,7 +164,9 @@ jobs:
163164
path: symbol-list
164165

165166
- name: Install abi-compliance-checker
166-
run: sudo apt-get install abi-compliance-checker
167+
run: |
168+
sudo apt-get update
169+
sudo apt-get install abi-compliance-checker
167170
- name: Compare ABI
168171
run: |
169172
if [ -s symbol-list/llvm.symbols ]; then

.github/workflows/release-binaries-all.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ on:
2727
required: true
2828
default: false
2929
type: boolean
30+
secrets:
31+
RELEASE_TASKS_USER_TOKEN:
32+
description: "Secret used to check user permissions."
33+
required: false
3034

3135
pull_request:
3236
types:

.github/workflows/release-binaries.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,18 @@ jobs:
133133
# add extra CMake args to disable them.
134134
# See https://github.com/llvm/llvm-project/issues/99767
135135
if [ "$RUNNER_OS" = "macOS" ]; then
136-
target_cmake_flags="$target_cmake_flags -DBOOTSTRAP_COMPILER_RT_ENABLE_IOS=OFF"
136+
target_cmake_flags="$target_cmake_flags -DBOOTSTRAP_BOOTSTRAP_COMPILER_RT_ENABLE_IOS=OFF"
137137
if [ "$RUNNER_ARCH" = "ARM64" ]; then
138138
arches=arm64
139139
else
140140
arches=x86_64
141+
# Disable Flang builds on macOS x86_64. The FortranLower library takes
142+
# 2-3 hours to build on macOS, much slower than on Linux.
143+
# The long build time causes the release build to time out on x86_64,
144+
# so we need to disable flang there.
145+
target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_PROJECTS='clang;lld;lldb;clang-tools-extra;polly;mlir'"
141146
fi
142-
target_cmake_flags="$target_cmake_flags -DBOOTSTRAP_DARWIN_osx_ARCHS=$arches -DBOOTSTRAP_DARWIN_osx_BUILTIN_ARCHS=$arches"
147+
target_cmake_flags="$target_cmake_flags -DBOOTSTRAP_BOOTSTRAP_DARWIN_osx_ARCHS=$arches -DBOOTSTRAP_BOOTSTRAP_DARWIN_osx_BUILTIN_ARCHS=$arches"
143148
fi
144149
145150
build_flang="true"

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ Improvements to clangd
5656
Inlay hints
5757
^^^^^^^^^^^
5858

59-
- Added `DefaultArguments` Inlay Hints option.
59+
- Added support for inlay hints for default arguments, enabled using the
60+
`DefaultArguments` config option (#GH95712)
6061

6162
Diagnostics
6263
^^^^^^^^^^^
@@ -67,35 +68,81 @@ Semantic Highlighting
6768
Compile flags
6869
^^^^^^^^^^^^^
6970

71+
- Fixed a bug where clangd would unnecessarily reparse open files whose
72+
compile command did not change when receiving a new compile command
73+
via an LSP `workspace/configuration` request (#GH115438)
74+
7075
Hover
7176
^^^^^
7277

78+
- Hovering over a function name now shows the function's documentation
79+
comment even if the comment is written above the function's out-of-line
80+
definition in a different source file (#GH67802)
81+
7382
Code completion
7483
^^^^^^^^^^^^^^^
7584

85+
- Added an `ArgumentLists` config option under `Completion`. This is a more
86+
flexible version of the `--function-arg-placeholders` command line flag,
87+
allowing users more detailed control of what is inserted in argument list
88+
position when clangd completes the name of a function in a function call
89+
context. (#GH111322)
90+
- Clangd now supports configuring which headers should be inserted using
91+
`<>` vs. `""` syntax using the `QuotedHeaders` and `AngledHeaders` config
92+
options under `Style` (#GH67749)
7693
- Added completion for C++20 keywords.
94+
- Improved code completion behaviour in dependent/templated code
95+
- Completion items now include documentation comments in more cases (#GH120099)
7796

7897
Code actions
7998
^^^^^^^^^^^^
8099

81100
- Added `Swap operands` tweak for certain binary operators.
82-
83101
- Improved the extract-to-function code action to allow extracting statements
84102
with overloaded operators like ``<<`` of ``std::ostream``.
103+
- `Define outline` now handles member functions of class templates, and
104+
member function templates.
105+
- `Extract variable` can now operate on the top-level expression in an
106+
expression statement (#GH112525)
85107

86108
Signature help
87109
^^^^^^^^^^^^^^
88110

89111
Cross-references
90112
^^^^^^^^^^^^^^^^
91113

114+
- Clangd now supports the "outgoing calls" direction of call hierarchy
115+
(#GH77556)
116+
- Call hierarchy can now be invoked on fields and namespace-scope
117+
variables (#GH113900)
118+
- Improved heuristics for filtering out generated Protobuf symbol names
119+
during indexing (#GH110091)
120+
- Compiler intrinsics defined in `*intrin.h` system headers are now
121+
indexed even if they have reserved names (#GH119735)
122+
- Various improvements to go-to-definition in templated code
123+
92124
Objective-C
93125
^^^^^^^^^^^
94126

127+
Clang-tidy integration
128+
^^^^^^^^^^^^^^^^^^^^^^
129+
130+
- Improved robustness in handling clang-tidy check names (#GH109421)
131+
132+
C++20 Modules Support
133+
^^^^^^^^^^^^^^^^^^^^^
134+
135+
- Support code completion for symbols defined in modules (#GH110083)
136+
- Improve performance when opening files that import modules (#GH106683)
137+
- Compile commands for modules now respect modifications specified in `.clangd`
138+
files (#GH122606)
139+
95140
Miscellaneous
96141
^^^^^^^^^^^^^
97142

98-
- The DefineOutline tweak now handles member functions of class templates.
143+
- Fixed an OOM affecting some versions of libcxx headers compiled in C++20
144+
mode (#GH108866)
145+
- Various other stability improvements, e.g. crash fixes
99146

100147
Improvements to clang-doc
101148
-------------------------

clang/cmake/caches/Release.cmake

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,21 @@ endfunction()
2929
# cache file to CMake via -C. e.g.
3030
#
3131
# cmake -D LLVM_RELEASE_ENABLE_PGO=ON -C Release.cmake
32+
33+
set (DEFAULT_PROJECTS "clang;lld;lldb;clang-tools-extra;polly;mlir;flang")
34+
# bolt only supports ELF, so only enable it for Linux.
35+
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux")
36+
list(APPEND DEFAULT_PROJECTS "bolt")
37+
endif()
38+
3239
set (DEFAULT_RUNTIMES "compiler-rt;libcxx")
3340
if (NOT WIN32)
3441
list(APPEND DEFAULT_RUNTIMES "libcxxabi" "libunwind")
3542
endif()
3643
set(LLVM_RELEASE_ENABLE_LTO THIN CACHE STRING "")
3744
set(LLVM_RELEASE_ENABLE_PGO ON CACHE BOOL "")
3845
set(LLVM_RELEASE_ENABLE_RUNTIMES ${DEFAULT_RUNTIMES} CACHE STRING "")
39-
set(LLVM_RELEASE_ENABLE_PROJECTS "clang;lld;lldb;clang-tools-extra;bolt;polly;mlir;flang" CACHE STRING "")
46+
set(LLVM_RELEASE_ENABLE_PROJECTS ${DEFAULT_PROJECTS} CACHE STRING "")
4047
# Note we don't need to add install here, since it is one of the pre-defined
4148
# steps.
4249
set(LLVM_RELEASE_FINAL_STAGE_TARGETS "clang;package;check-all;check-llvm;check-clang" CACHE STRING "")
@@ -48,10 +55,8 @@ set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
4855

4956
set(STAGE1_PROJECTS "clang")
5057

51-
# Building Flang on Windows requires compiler-rt, so we need to build it in
52-
# stage1. compiler-rt is also required for building the Flang tests on
53-
# macOS.
54-
set(STAGE1_RUNTIMES "compiler-rt")
58+
# Build all runtimes so we can statically link them into the stage2 compiler.
59+
set(STAGE1_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind")
5560

5661
if (LLVM_RELEASE_ENABLE_PGO)
5762
list(APPEND STAGE1_PROJECTS "lld")
@@ -90,9 +95,20 @@ else()
9095
set(CLANG_BOOTSTRAP_TARGETS ${LLVM_RELEASE_FINAL_STAGE_TARGETS} CACHE STRING "")
9196
endif()
9297

98+
if (LLVM_RELEASE_ENABLE_LTO)
99+
# Enable LTO for the runtimes. We need to configure stage1 clang to default
100+
# to using lld as the linker because the stage1 toolchain will be used to
101+
# build and link the runtimes.
102+
# FIXME: We can't use LLVM_ENABLE_LTO=Thin here, because it causes the CMake
103+
# step for the libcxx build to fail. CMAKE_INTERPROCEDURAL_OPTIMIZATION does
104+
# enable ThinLTO, though.
105+
set(RUNTIMES_CMAKE_ARGS "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DLLVM_ENABLE_LLD=ON" CACHE STRING "")
106+
endif()
107+
93108
# Stage 1 Common Config
94109
set(LLVM_ENABLE_RUNTIMES ${STAGE1_RUNTIMES} CACHE STRING "")
95110
set(LLVM_ENABLE_PROJECTS ${STAGE1_PROJECTS} CACHE STRING "")
111+
set(LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY ON CACHE STRING "")
96112

97113
# stage2-instrumented and Final Stage Config:
98114
# Options that need to be set in both the instrumented stage (if we are doing
@@ -102,13 +118,29 @@ set_instrument_and_final_stage_var(LLVM_ENABLE_LTO "${LLVM_RELEASE_ENABLE_LTO}"
102118
if (LLVM_RELEASE_ENABLE_LTO)
103119
set_instrument_and_final_stage_var(LLVM_ENABLE_LLD "ON" BOOL)
104120
endif()
121+
set_instrument_and_final_stage_var(LLVM_ENABLE_LIBCXX "ON" BOOL)
122+
set_instrument_and_final_stage_var(LLVM_STATIC_LINK_CXX_STDLIB "ON" BOOL)
123+
set(RELEASE_LINKER_FLAGS "-rtlib=compiler-rt --unwindlib=libunwind")
124+
if(NOT ${CMAKE_HOST_SYSTEM_NAME} MATCHES "Darwin")
125+
set(RELEASE_LINKER_FLAGS "${RELEASE_LINKER_FLAGS} -static-libgcc")
126+
endif()
127+
128+
# Set flags for bolt
129+
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux")
130+
set(RELEASE_LINKER_FLAGS "${RELEASE_LINKER_FLAGS} -Wl,--emit-relocs,-znow")
131+
endif()
132+
133+
set_instrument_and_final_stage_var(CMAKE_EXE_LINKER_FLAGS ${RELEASE_LINKER_FLAGS} STRING)
134+
set_instrument_and_final_stage_var(CMAKE_SHARED_LINKER_FLAGS ${RELEASE_LINKER_FLAGS} STRING)
135+
set_instrument_and_final_stage_var(CMAKE_MODULE_LINKER_FLAGS ${RELEASE_LINKER_FLAGS} STRING)
105136

106137
# Final Stage Config (stage2)
107138
set_final_stage_var(LLVM_ENABLE_RUNTIMES "${LLVM_RELEASE_ENABLE_RUNTIMES}" STRING)
108139
set_final_stage_var(LLVM_ENABLE_PROJECTS "${LLVM_RELEASE_ENABLE_PROJECTS}" STRING)
140+
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux")
141+
set_final_stage_var(CLANG_BOLT "INSTRUMENT" STRING)
142+
endif()
109143
set_final_stage_var(CPACK_GENERATOR "TXZ" STRING)
110144
set_final_stage_var(CPACK_ARCHIVE_THREADS "0" STRING)
111145

112-
if(${CMAKE_HOST_SYSTEM_NAME} MATCHES "Darwin")
113-
set_final_stage_var(LLVM_USE_STATIC_ZSTD "ON" BOOL)
114-
endif()
146+
set_final_stage_var(LLVM_USE_STATIC_ZSTD "ON" BOOL)

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4735,15 +4735,24 @@ the configuration (without a prefix: ``Auto``).
47354735
.. _Language:
47364736

47374737
**Language** (``LanguageKind``) :versionbadge:`clang-format 3.5` :ref:`<Language>`
4738-
Language, this format style is targeted at.
4738+
The language that this format style targets.
4739+
4740+
.. note::
4741+
4742+
You can specify the language (``C``, ``Cpp``, or ``ObjC``) for ``.h``
4743+
files by adding a ``// clang-format Language:`` line before the first
4744+
non-comment (and non-empty) line, e.g. ``// clang-format Language: Cpp``.
47394745

47404746
Possible values:
47414747

47424748
* ``LK_None`` (in configuration: ``None``)
47434749
Do not use.
47444750

4751+
* ``LK_C`` (in configuration: ``C``)
4752+
Should be used for C.
4753+
47454754
* ``LK_Cpp`` (in configuration: ``Cpp``)
4746-
Should be used for C, C++.
4755+
Should be used for C++.
47474756

47484757
* ``LK_CSharp`` (in configuration: ``CSharp``)
47494758
Should be used for C#.

clang/docs/HIPSupport.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,26 @@ Example Usage
286286
basePtr->virtualFunction(); // Allowed since obj is constructed in device code
287287
}
288288

289+
Host and Device Attributes of Default Destructors
290+
===================================================
291+
292+
If a default destructor does not have explicit host or device attributes,
293+
clang infers these attributes based on the destructors of its data members
294+
and base classes. If any conflicts are detected among these destructors,
295+
clang diagnoses the issue. Otherwise, clang adds an implicit host or device
296+
attribute according to whether the data members's and base classes's
297+
destructors can execute on the host or device side.
298+
299+
For explicit template classes with virtual destructors, which must be emitted,
300+
the inference adopts a conservative approach. In this case, implicit host or
301+
device attributes from member and base class destructors are ignored. This
302+
precaution is necessary because, although a constexpr destructor carries
303+
implicit host or device attributes, a constexpr function may call a
304+
non-constexpr function, which is by default a host function.
305+
306+
Users can override the inferred host and device attributes of default
307+
destructors by adding explicit host and device attributes to them.
308+
289309
C++ Standard Parallelism Offload Support: Compiler And Runtime
290310
==============================================================
291311

clang/docs/ReleaseNotes.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,8 @@ Bug Fixes in This Version
897897
- No longer return ``false`` for ``noexcept`` expressions involving a
898898
``delete`` which resolves to a destroying delete but the type of the object
899899
being deleted has a potentially throwing destructor (#GH118660).
900+
- Clang now outputs correct values when #embed data contains bytes with negative
901+
signed char values (#GH102798).
900902

901903
Bug Fixes to Compiler Builtins
902904
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1053,6 +1055,16 @@ Bug Fixes to C++ Support
10531055
template parameter. Now, such expression can be used with ``static_assert`` and ``constexpr``. (#GH123498)
10541056
- Correctly determine the implicit constexprness of lambdas in dependent contexts. (#GH97958) (#GH114234)
10551057
- Fix that some dependent immediate expressions did not cause immediate escalation (#GH119046)
1058+
- Fixed a substitution bug in transforming CTAD aliases when the type alias contains a non-pack template argument
1059+
corresponding to a pack parameter (#GH124715)
1060+
- Clang is now better at keeping track of friend function template instance contexts. (#GH55509)
1061+
- Fixes matching of nested template template parameters. (#GH130362)
1062+
- Correctly diagnoses template template paramters which have a pack parameter
1063+
not in the last position.
1064+
- Fixed an integer overflow bug in computing template parameter depths when synthesizing CTAD guides. (#GH128691)
1065+
- Fixed an incorrect pointer access when checking access-control on concepts. (#GH131530)
1066+
- Fixed various alias CTAD bugs involving variadic template arguments. (#GH123591), (#GH127539), (#GH129077),
1067+
(#GH129620), and (#GH129998).
10561068

10571069
Bug Fixes to AST Handling
10581070
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1264,6 +1276,8 @@ CUDA Support
12641276

12651277
AIX Support
12661278
^^^^^^^^^^^
1279+
- Fixed the ``-print-runtime-dir`` option.
1280+
- Enable continuous profile syncing feature on AIX.
12671281

12681282
NetBSD Support
12691283
^^^^^^^^^^^^^^
@@ -1291,6 +1305,11 @@ AVR Support
12911305

12921306
- Reject C/C++ compilation for avr1 devices which have no SRAM.
12931307

1308+
BPF Support
1309+
^^^^^^^^^^^
1310+
1311+
- Make ``-mcpu=v3`` as the default.
1312+
12941313
DWARF Support in Clang
12951314
----------------------
12961315

@@ -1351,6 +1370,10 @@ clang-format
13511370
- Adds ``WrapNamespaceBodyWithEmptyLines`` option.
13521371
- Adds the ``IndentExportBlock`` option.
13531372
- Adds ``PenaltyBreakBeforeMemberAccess`` option.
1373+
- Add the C language instead of treating it like C++.
1374+
- Allow specifying the language (C, C++, or Objective-C) for a ``.h`` file by
1375+
adding a special comment (e.g. ``// clang-format Language: ObjC``) near the
1376+
top of the file.
13541377

13551378
libclang
13561379
--------

0 commit comments

Comments
 (0)