Skip to content

Commit c8a463b

Browse files
committed
Merge from 'main' to 'sycl-web' (221 commits)
CONFLICT (content): Merge conflict in llvm/lib/Object/CMakeLists.txt
2 parents d71b6ce + aa7ada1 commit c8a463b

File tree

1,109 files changed

+78143
-37196
lines changed

Some content is hidden

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

1,109 files changed

+78143
-37196
lines changed

.github/workflows/build-ci-container-windows.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ on:
1111
- .github/workflows/build-ci-container-windows.yml
1212
- '.github/workflows/containers/github-action-ci-windows/**'
1313
pull_request:
14-
branches:
15-
- main
1614
paths:
1715
- .github/workflows/build-ci-container-windows.yml
1816
- '.github/workflows/containers/github-action-ci-windows/**'

.github/workflows/build-ci-container.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ on:
1111
- .github/workflows/build-ci-container.yml
1212
- '.github/workflows/containers/github-action-ci/**'
1313
pull_request:
14-
branches:
15-
- main
1614
paths:
1715
- .github/workflows/build-ci-container.yml
1816
- '.github/workflows/containers/github-action-ci/**'

clang-tools-extra/clangd/unittests/FindTargetTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ TEST_F(TargetDeclTest, OverloadExpr) {
838838
)cpp";
839839
// Sized deallocation is enabled by default in C++14 onwards.
840840
EXPECT_DECLS("CXXDeleteExpr",
841-
"void operator delete(void *, unsigned long) noexcept");
841+
"void operator delete(void *, __size_t) noexcept");
842842
}
843843

844844
TEST_F(TargetDeclTest, DependentExprs) {

clang-tools-extra/clangd/unittests/HoverTests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2794,7 +2794,7 @@ TEST(Hover, All) {
27942794
})cpp",
27952795
[](HoverInfo &HI) {
27962796
HI.Name = "expression";
2797-
HI.Type = "unsigned long";
2797+
HI.Type = {"__size_t", "unsigned long"};
27982798
HI.Value = "1";
27992799
}},
28002800
{
@@ -2804,7 +2804,7 @@ TEST(Hover, All) {
28042804
})cpp",
28052805
[](HoverInfo &HI) {
28062806
HI.Name = "expression";
2807-
HI.Type = "unsigned long";
2807+
HI.Type = {"__size_t", "unsigned long"};
28082808
HI.Value = "1";
28092809
}},
28102810
{

clang/docs/ClangTools.rst

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,50 @@ they'll be tracked here. The focus of this documentation is on the scope
8989
and features of the tools for other tool developers; each tool should
9090
provide its own user-focused documentation.
9191

92-
``clang-tidy``
92+
``Clang-Doc``
93+
-------------
94+
95+
`Clang-Doc <https://clang.llvm.org/extra/clang-doc.html>`_ is a tool for
96+
generating C and C++ documentation from source code and comments.
97+
98+
``Clang-Include-Fixer``
99+
-----------------------
100+
101+
`Clang-Include-Fixer <https://clang.llvm.org/extra/clang-include-fixer.html>`_
102+
is a tool to automate the addition of missing ``#include`` directives in a C++
103+
file. It adds missing namespace qualifiers to unidentified symbols when
104+
necessary and also removes unused headers.
105+
106+
``Clang-Tidy``
93107
--------------
94108

95-
`clang-tidy <https://clang.llvm.org/extra/clang-tidy/>`_ is a clang-based C++
109+
`Clang-Tidy <https://clang.llvm.org/extra/clang-tidy/>`_ is a Clang-based C++
96110
linter tool. It provides an extensible framework for building compiler-based
97111
static analyses detecting and fixing bug-prone patterns, performance,
98-
portability and maintainability issues.
112+
portability and maintainability issues. It also has checks for modernizing code
113+
to newer language standards.
114+
115+
``Clangd``
116+
----------
117+
118+
`Clangd <https://clangd.llvm.org/>`_ is a language server that can work with
119+
many editors via a plugin. It understands your C++ code and adds smart
120+
features to your editor: code completion, compile errors, go-to-definition and
121+
more.
122+
123+
``Modularize``
124+
--------------
125+
126+
`Modularize <https://clang.llvm.org/extra/modularize.html>`_ is a standalone
127+
tool that checks whether a set of headers provides the consistent definitions
128+
required to use modules.
129+
130+
``pp-trace``
131+
------------
132+
133+
`pp-trace <https://clang.llvm.org/extra/pp-trace.html>`_ is a standalone tool
134+
that traces preprocessor activity. It’s also used as a test of Clang’s
135+
``PPCallbacks`` interface.
99136

100137

101138
Ideas for new Tools

clang/docs/LanguageExtensions.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ for support for non-standardized features, i.e. features not prefixed ``c_``,
138138
``cxx_`` or ``objc_``.
139139

140140
Another use of ``__has_feature`` is to check for compiler features not related
141-
to the language standard, such as e.g. :doc:`AddressSanitizer
141+
to the language standard, such as :doc:`AddressSanitizer
142142
<AddressSanitizer>`.
143143

144144
If the ``-pedantic-errors`` option is given, ``__has_extension`` is equivalent
@@ -377,8 +377,8 @@ Builtin Macros
377377

378378
``__FILE_NAME__``
379379
Clang-specific extension that functions similar to ``__FILE__`` but only
380-
renders the last path component (the filename) instead of an invocation
381-
dependent full path to that file.
380+
renders the last path component (the filename) instead of an
381+
invocation-dependent full path to that file.
382382

383383
``__COUNTER__``
384384
Defined to an integer value that starts at zero and is incremented each time
@@ -716,7 +716,7 @@ See also :ref:`langext-__builtin_shufflevector`, :ref:`langext-__builtin_convert
716716
a NEON vector or an SVE vector, it's only available in C++ and uses normal bool
717717
conversions (that is, != 0).
718718
If it's an extension (OpenCL) vector, it's only available in C and OpenCL C.
719-
And it selects base on signedness of the condition operands (OpenCL v1.1 s6.3.9).
719+
And it selects based on signedness of the condition operands (OpenCL v1.1 s6.3.9).
720720
.. [#] sizeof can only be used on vector length specific SVE types.
721721
.. [#] Clang does not allow the address of an element to be taken while GCC
722722
allows this. This is intentional for vectors with a boolean element type and
@@ -857,7 +857,7 @@ Each builtin returns a scalar equivalent to applying the specified
857857
operation(x, y) as recursive even-odd pairwise reduction to all vector
858858
elements. ``operation(x, y)`` is repeatedly applied to each non-overlapping
859859
even-odd element pair with indices ``i * 2`` and ``i * 2 + 1`` with
860-
``i in [0, Number of elements / 2)``. If the numbers of elements is not a
860+
``i in [0, Number of elements / 2)``. If the number of elements is not a
861861
power of 2, the vector is widened with neutral elements for the reduction
862862
at the end to the next power of 2.
863863

@@ -1491,7 +1491,7 @@ C++14 digit separators
14911491

14921492
Use ``__cpp_digit_separators`` to determine if support for digit separators
14931493
using single quotes (for instance, ``10'000``) is enabled. At this time, there
1494-
is no corresponding ``__has_feature`` name
1494+
is no corresponding ``__has_feature`` name.
14951495

14961496
C++14 generalized lambda capture
14971497
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1545,7 +1545,7 @@ C++ type aware allocators
15451545
^^^^^^^^^^^^^^^^^^^^^^^^^
15461546

15471547
Use ``__has_extension(cxx_type_aware_allocators)`` to determine the existence of
1548-
support for the future C++2d type aware allocator feature. For full details see
1548+
support for the future C++2d type aware allocator feature. For full details, see
15491549
:doc:`C++ Type Aware Allocators <CXXTypeAwareAllocators>` for additional details.
15501550

15511551
C11
@@ -1643,7 +1643,7 @@ Modules
16431643
Use ``__has_feature(modules)`` to determine if Modules have been enabled.
16441644
For example, compiling code with ``-fmodules`` enables the use of Modules.
16451645

1646-
More information could be found `here <https://clang.llvm.org/docs/Modules.html>`_.
1646+
More information can be found `here <https://clang.llvm.org/docs/Modules.html>`_.
16471647

16481648
Language Extensions Back-ported to Previous Standards
16491649
=====================================================
@@ -1878,7 +1878,7 @@ The following type trait primitives are supported by Clang. Those traits marked
18781878
C++26 relocatable types, and types which
18791879
were made trivially relocatable via the ``clang::trivial_abi`` attribute.
18801880
This trait is deprecated and should be replaced by
1881-
``__builtin_is_cpp_trivially_relocatable``. Note however that it is generally
1881+
``__builtin_is_cpp_trivially_relocatable``. Note, however, that it is generally
18821882
unsafe to relocate a C++-relocatable type with ``memcpy`` or ``memmove``;
18831883
use ``__builtin_trivially_relocate``.
18841884
* ``__builtin_is_cpp_trivially_relocatable`` (C++): Returns true if an object

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Potentially Breaking Changes
4646
``endbr64`` instruction at the labels named as possible branch
4747
destinations, so it is not safe to use a register-controlled branch
4848
instruction to branch to one. (In line with gcc.)
49+
- Added a sugar type `PredefinedSugarType` to improve diagnostic messages. (#GH143653)
4950

5051
C/C++ Language Potentially Breaking Changes
5152
-------------------------------------------

clang/include/clang/AST/ASTContext.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@ class ASTContext : public RefCountedBase<ASTContext> {
277277
mutable llvm::ContextualFoldingSet<ArrayParameterType, ASTContext &>
278278
ArrayParameterTypes;
279279

280+
/// Store the unique Type corresponding to each Kind.
281+
mutable std::array<Type *,
282+
llvm::to_underlying(PredefinedSugarType::Kind::Last) + 1>
283+
PredefinedSugarTypes{};
284+
280285
/// The set of nested name specifiers.
281286
///
282287
/// This set is managed by the NestedNameSpecifier class.
@@ -1192,6 +1197,8 @@ class ASTContext : public RefCountedBase<ASTContext> {
11921197
bool isInSameModule(const Module *M1, const Module *M2) const;
11931198

11941199
TranslationUnitDecl *getTranslationUnitDecl() const {
1200+
assert(TUDecl->getMostRecentDecl() == TUDecl &&
1201+
"The active TU is not current one!");
11951202
return TUDecl->getMostRecentDecl();
11961203
}
11971204
void addTranslationUnitDecl() {
@@ -1572,6 +1579,8 @@ class ASTContext : public RefCountedBase<ASTContext> {
15721579
/// and bit count.
15731580
QualType getDependentBitIntType(bool Unsigned, Expr *BitsExpr) const;
15741581

1582+
QualType getPredefinedSugarType(PredefinedSugarType::Kind KD) const;
1583+
15751584
/// Gets the struct used to keep track of the extended descriptor for
15761585
/// pointer to blocks.
15771586
QualType getBlockDescriptorExtendedType() const;
@@ -2004,11 +2013,13 @@ class ASTContext : public RefCountedBase<ASTContext> {
20042013
/// <stddef.h>.
20052014
///
20062015
/// The sizeof operator requires this (C99 6.5.3.4p4).
2007-
CanQualType getSizeType() const;
2016+
QualType getSizeType() const;
2017+
2018+
CanQualType getCanonicalSizeType() const;
20082019

20092020
/// Return the unique signed counterpart of
20102021
/// the integer type corresponding to size_t.
2011-
CanQualType getSignedSizeType() const;
2022+
QualType getSignedSizeType() const;
20122023

20132024
/// Return the unique type for "intmax_t" (C99 7.18.1.5), defined in
20142025
/// <stdint.h>.

clang/include/clang/AST/FormatString.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,8 @@ class FormatSpecifier {
489489

490490
/// For a TypedefType QT, if it is a named integer type such as size_t,
491491
/// assign the appropriate value to LM and return true.
492-
static bool namedTypeToLengthModifier(QualType QT, LengthModifier &LM);
492+
static bool namedTypeToLengthModifier(ASTContext &Ctx, QualType QT,
493+
LengthModifier &LM);
493494
};
494495

495496
} // end analyze_format_string namespace

clang/include/clang/AST/RecursiveASTVisitor.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,6 +1208,8 @@ DEF_TRAVERSE_TYPE(BitIntType, {})
12081208
DEF_TRAVERSE_TYPE(DependentBitIntType,
12091209
{ TRY_TO(TraverseStmt(T->getNumBitsExpr())); })
12101210

1211+
DEF_TRAVERSE_TYPE(PredefinedSugarType, {})
1212+
12111213
#undef DEF_TRAVERSE_TYPE
12121214

12131215
// ----------------- TypeLoc traversal -----------------
@@ -1524,6 +1526,8 @@ DEF_TRAVERSE_TYPELOC(DependentBitIntType, {
15241526
TRY_TO(TraverseStmt(TL.getTypePtr()->getNumBitsExpr()));
15251527
})
15261528

1529+
DEF_TRAVERSE_TYPELOC(PredefinedSugarType, {})
1530+
15271531
#undef DEF_TRAVERSE_TYPELOC
15281532

15291533
// ----------------- Decl traversal -----------------

0 commit comments

Comments
 (0)