Skip to content

Commit afeec4b

Browse files
authored
Merge branch 'llvm:main' into readonly
2 parents de11611 + 6d0f573 commit afeec4b

File tree

776 files changed

+29854
-36729
lines changed

Some content is hidden

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

776 files changed

+29854
-36729
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
/clang/www/cxx_dr_status.html @Endilll
3232
/clang/www/make_cxx_dr_status @Endilll
3333

34-
/clang/include/clang/CIR @lanza @bcardosolopes
35-
/clang/lib/CIR @lanza @bcardosolopes
36-
/clang/tools/cir-* @lanza @bcardosolopes
34+
/clang/include/clang/CIR @lanza @bcardosolopes @xlauko @andykaylor
35+
/clang/lib/CIR @lanza @bcardosolopes @xlauko @andykaylor
36+
/clang/tools/cir-* @lanza @bcardosolopes @xlauko @andykaylor
3737

3838
/lldb/ @JDevlieghere
3939

.github/workflows/premerge.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
if: >-
7777
github.repository_owner == 'llvm' &&
7878
(github.event_name != 'pull_request' || github.event.action != 'closed')
79-
runs-on: llvm-premerge-windows-runners
79+
runs-on: llvm-premerge-windows-2022-runners
8080
defaults:
8181
run:
8282
shell: bash

clang-tools-extra/clangd/ModulesBuilder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,9 @@ bool IsModuleFileUpToDate(PathRef ModuleFilePath,
219219

220220
IntrusiveRefCntPtr<ModuleCache> ModCache = createCrossProcessModuleCache();
221221
PCHContainerOperations PCHOperations;
222+
CodeGenOptions CodeGenOpts;
222223
ASTReader Reader(PP, *ModCache, /*ASTContext=*/nullptr,
223-
PCHOperations.getRawReader(), {});
224+
PCHOperations.getRawReader(), CodeGenOpts, {});
224225

225226
// We don't need any listener here. By default it will use a validator
226227
// listener.

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ Improvements to clang-doc
8888
Improvements to clang-query
8989
---------------------------
9090

91+
- Matcher queries interpreted by clang-query are now support trailing comma (,)
92+
in matcher arguments. Note that C++ still doesn't allow this in function
93+
arguments. So when porting a query to C++, remove all instances of trailing
94+
comma (otherwise C++ compiler will just complain about "expected expression").
95+
9196
Improvements to include-cleaner
9297
-------------------------------
9398
- Deprecated the ``-insert`` and ``-remove`` command line options, and added
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
void foo(void) {}
2+
// CHECK-OK: trailing-comma.c:1:1: note: "root" binds here
3+
// CHECK-ERR-COMMA: Invalid token <,> found when looking for a value.
4+
5+
// RUN: clang-query -c "match \
6+
// RUN: functionDecl( \
7+
// RUN: hasName( \
8+
// RUN: \"foo\", \
9+
// RUN: ), \
10+
// RUN: ) \
11+
// RUN: " %s | FileCheck --check-prefix=CHECK-OK %s
12+
13+
// Same with \n tokens
14+
// RUN: echo "match functionDecl( hasName( \"foo\" , ) , )" | sed "s/ /\n/g" >%t
15+
// RUN: clang-query -f %t %s | FileCheck --check-prefix=CHECK-OK %s
16+
17+
// RUN: not clang-query -c "match functionDecl(hasName(\"foo\"),,)" %s \
18+
// RUN: | FileCheck --check-prefix=CHECK-ERR-COMMA %s
19+
20+
// RUN: not clang-query -c "match functionDecl(,)" %s \
21+
// RUN: | FileCheck --check-prefix=CHECK-ERR-COMMA %s

clang/docs/ReleaseNotes.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Potentially Breaking Changes
3636

3737
- The Objective-C ARC migrator (ARCMigrate) has been removed.
3838
- Fix missing diagnostics for uses of declarations when performing typename access,
39-
such as when performing member access on a '[[deprecated]]' type alias.
39+
such as when performing member access on a ``[[deprecated]]`` type alias.
4040
(#GH58547)
4141
- For ARM targets when compiling assembly files, the features included in the selected CPU
4242
or Architecture's FPU are included. If you wish not to use a specific feature,
@@ -800,6 +800,8 @@ Bug Fixes in This Version
800800
declaration statements. Clang now emits a warning for these patterns. (#GH141659)
801801
- Fixed false positives for redeclaration errors of using enum in
802802
nested scopes. (#GH147495)
803+
- Fixed a failed assertion with an operator call expression which comes from a
804+
macro expansion when performing analysis for nullability attributes. (#GH138371)
803805

804806
Bug Fixes to Compiler Builtins
805807
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -953,6 +955,7 @@ Bug Fixes to C++ Support
953955
- Fix a bug where private access specifier of overloaded function not respected. (#GH107629)
954956
- Correctly handles calling an explicit object member function template overload set
955957
through its address (``(&Foo::bar<baz>)()``).
958+
- Fix a crash when using an explicit object parameter in a non-member function. (#GH113185)
956959
- Fix a crash when forming an invalid call to an operator with an explicit object member. (#GH147121)
957960
- Correctly handle allocations in the condition of a ``if constexpr``.(#GH120197) (#GH134820)
958961
- Fixed a crash when handling invalid member using-declaration in C++20+ mode. (#GH63254)
@@ -966,6 +969,7 @@ Bug Fixes to C++ Support
966969
- Fix a crash with NTTP when instantiating local class.
967970
- Fixed a crash involving list-initialization of an empty class with a
968971
non-empty initializer list. (#GH147949)
972+
- Fixed constant evaluation of equality comparisons of constexpr-unknown references. (#GH147663)
969973

970974
Bug Fixes to AST Handling
971975
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1142,6 +1146,8 @@ Fixed Point Support in Clang
11421146
AST Matchers
11431147
------------
11441148

1149+
- Ensure ``hasBitWidth`` doesn't crash on bit widths that are dependent on template
1150+
parameters.
11451151
- Ensure ``isDerivedFrom`` matches the correct base in case more than one alias exists.
11461152
- Extend ``templateArgumentCountIs`` to support function and variable template
11471153
specialization.

clang/docs/ThinLTO.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,38 @@ The ``BOOTSTRAP_LLVM_ENABLE_LTO=Thin`` will enable ThinLTO for stage 2 and
240240
stage 3 in case the compiler used for stage 1 does not support the ThinLTO
241241
option.
242242

243+
Integrated Distributed ThinLTO (DTLTO)
244+
--------------------------------------
245+
246+
Integrated Distributed ThinLTO (DTLTO) enables the distribution of backend
247+
ThinLTO compilations via external distribution systems, such as Incredibuild,
248+
during the traditional link step.
249+
250+
The implementation is documented here: https://llvm.org/docs/DTLTO.html.
251+
252+
DTLTO requires the LLD linker (``-fuse-ld=lld``).
253+
254+
``-fthinlto-distributor=<path>``
255+
- Specifies the ``<path>`` to the distributor process executable for DTLTO.
256+
- If specified, ThinLTO backend compilations will be distributed by LLD.
257+
258+
``-Xthinlto-distributor=<arg>``
259+
- Passes ``<arg>`` to the distributor process (see ``-fthinlto-distributor=``).
260+
- Can be specified multiple times to pass multiple options.
261+
- Multiple options can also be specified by separating them with commas.
262+
263+
Examples:
264+
- ``clang -flto=thin -fthinlto-distributor=incredibuild.exe -Xthinlto-distributor=--verbose,--j10 -fuse-ld=lld``
265+
- ``clang -flto=thin -fthinlto-distributor=$(which python) -Xthinlto-distributor=incredibuild.py -fuse-ld=lld``
266+
267+
If ``-fthinlto-distributor=`` is specified, Clang supplies the path to a
268+
compiler to be executed remotely to perform the ThinLTO backend
269+
compilations. Currently, this is Clang itself.
270+
271+
Note that currently, DTLTO is only supported in some LLD flavors. Support can
272+
be added to other LLD flavours in the future.
273+
See `DTLTO <https://lld.llvm.org/dtlto.html>`_ for more information.
274+
243275
More Information
244276
================
245277

clang/include/clang/AST/ASTContext.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2916,10 +2916,14 @@ class ASTContext : public RefCountedBase<ASTContext> {
29162916
NestedNameSpecifier *
29172917
getCanonicalNestedNameSpecifier(NestedNameSpecifier *NNS) const;
29182918

2919-
/// Retrieves the default calling convention for the current target.
2919+
/// Retrieves the default calling convention for the current context.
2920+
///
2921+
/// The context's default calling convention may differ from the current
2922+
/// target's default calling convention if the -fdefault-calling-conv option
2923+
/// is used; to get the target's default calling convention, e.g. for built-in
2924+
/// functions, call getTargetInfo().getDefaultCallingConv() instead.
29202925
CallingConv getDefaultCallingConvention(bool IsVariadic,
2921-
bool IsCXXMethod,
2922-
bool IsBuiltin = false) const;
2926+
bool IsCXXMethod) const;
29232927

29242928
/// Retrieves the "canonical" template name that refers to a
29252929
/// given template.

clang/include/clang/AST/Decl.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3252,6 +3252,11 @@ class FieldDecl : public DeclaratorDecl, public Mergeable<FieldDecl> {
32523252
return hasInClassInitializer() ? InitAndBitWidth->BitWidth : BitWidth;
32533253
}
32543254

3255+
/// Determines whether the bit width of this field is a constant integer.
3256+
/// This may not always be the case, such as inside template-dependent
3257+
/// expressions.
3258+
bool hasConstantIntegerBitWidth() const;
3259+
32553260
/// Computes the bit width of this field, if this is a bit field.
32563261
/// May not be called on non-bitfields.
32573262
/// Note that in order to successfully use this function, the bitwidth

clang/include/clang/ASTMatchers/ASTMatchers.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,8 @@ AST_MATCHER(FieldDecl, isBitField) {
710710
/// fieldDecl(hasBitWidth(2))
711711
/// matches 'int a;' and 'int c;' but not 'int b;'.
712712
AST_MATCHER_P(FieldDecl, hasBitWidth, unsigned, Width) {
713-
return Node.isBitField() && Node.getBitWidthValue() == Width;
713+
return Node.isBitField() && Node.hasConstantIntegerBitWidth() &&
714+
Node.getBitWidthValue() == Width;
714715
}
715716

716717
/// Matches non-static data members that have an in-class initializer.

0 commit comments

Comments
 (0)