Skip to content

Commit 0230f5d

Browse files
Merge remote-tracking branch 'origin/main' into riscv-late-opt1
2 parents 2505795 + ee0009c commit 0230f5d

File tree

78 files changed

+1699
-599
lines changed

Some content is hidden

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

78 files changed

+1699
-599
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
id: vars
4545
run: |
4646
tag=$(git rev-parse --short=12 HEAD)
47-
container_name="ghcr.io/$GITHUB_REPOSITORY_OWNER/${{ matrix.arch }}/ci-ubuntu-22.04"
47+
container_name="ghcr.io/$GITHUB_REPOSITORY_OWNER/${{ matrix.arch }}/ci-ubuntu-24.04"
4848
echo "container-name=$container_name" >> $GITHUB_OUTPUT
4949
echo "container-name-agent=$container_name-agent" >> $GITHUB_OUTPUT
5050
echo "container-name-tag=$container_name:$tag" >> $GITHUB_OUTPUT

.github/workflows/containers/github-action-ci/Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM docker.io/library/ubuntu:22.04 as base
1+
FROM docker.io/library/ubuntu:24.04 as base
22
ENV LLVM_SYSROOT=/opt/llvm
33

44
FROM base as stage1-toolchain
5-
ENV LLVM_VERSION=19.1.5
5+
ENV LLVM_VERSION=20.1.1
66

77
RUN apt-get update && \
88
apt-get install -y \
@@ -24,12 +24,6 @@ RUN curl -O -L https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-$L
2424

2525
WORKDIR /llvm-project-llvmorg-$LLVM_VERSION
2626

27-
# Patch to enable better PGO profile data.
28-
# TODO: Remove this for llvm 20
29-
ADD https://github.com/llvm/llvm-project/commit/738250989ce516f02f809bdfde474a039c77e81f.patch .
30-
31-
RUN patch -p1 < 738250989ce516f02f809bdfde474a039c77e81f.patch
32-
3327
RUN cmake -B ./build -G Ninja ./llvm \
3428
-C ./clang/cmake/caches/BOLT-PGO.cmake \
3529
-DBOOTSTRAP_LLVM_ENABLE_LLD=ON \

clang/Maintainers.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ OpenBSD driver
159159
| Brad Smith
160160
| brad\@comstyle.com (email), brad (Phabricator), brad0 (GitHub)
161161
162+
Offloading driver
163+
~~~~~~~~~~~~~~~~~
164+
| Joseph Huber
165+
| joseph.huber\@amd.com (email), jhuber6 (GitHub)
166+
162167

163168
Driver parts not covered by someone else
164169
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

clang/docs/LanguageExtensions.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,6 +1594,22 @@ C11 ``_Thread_local``
15941594
Use ``__has_feature(c_thread_local)`` or ``__has_extension(c_thread_local)``
15951595
to determine if support for ``_Thread_local`` variables is enabled.
15961596

1597+
C2y
1598+
---
1599+
1600+
The features listed below are part of the C2y standard. As a result, all these
1601+
features are enabled with the ``-std=c2y`` or ``-std=gnu2y`` option when
1602+
compiling C code.
1603+
1604+
C2y ``_Countof``
1605+
^^^^^^^^^^^^^^^^
1606+
1607+
Use ``__has_feature(c_countof)`` (in C2y or later mode) or
1608+
``__has_extension(c_countof)`` (in C23 or earlier mode) to determine if support
1609+
for the ``_Countof`` operator is enabled. This feature is not available in C++
1610+
mode.
1611+
1612+
15971613
Modules
15981614
-------
15991615

@@ -1653,6 +1669,7 @@ Array & element qualification (N2607) C
16531669
Attributes (N2335) C23 C89
16541670
``#embed`` (N3017) C23 C89, C++
16551671
Octal literals prefixed with ``0o`` or ``0O`` C2y C89, C++
1672+
``_Countof`` (N3369, N3469) C2y C89
16561673
============================================= ================================ ============= =============
16571674

16581675
Builtin type aliases

clang/docs/ReleaseNotes.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@ C2y Feature Support
141141
paper also introduced octal and hexadecimal delimited escape sequences (e.g.,
142142
``"\x{12}\o{12}"``) which are also supported as an extension in older C
143143
language modes.
144+
- Implemented `WG14 N3369 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3369.pdf>`_
145+
which introduces the ``_Lengthof`` operator, and `WG14 N3469 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3469.htm>`_
146+
which renamed ``_Lengthof`` to ``_Countof``. This feature is implemented as
147+
a conforming extension in earlier C language modes, but not in C++ language
148+
modes (``std::extent`` and ``std::size`` already provide the same
149+
functionality but with more granularity). The feature can be tested via
150+
``__has_feature(c_countof)`` or ``__has_extension(c_countof)``.
144151

145152
C23 Feature Support
146153
^^^^^^^^^^^^^^^^^^^
@@ -363,7 +370,8 @@ Bug Fixes to C++ Support
363370
- Fixed a Clang regression in C++20 mode where unresolved dependent call expressions were created inside non-dependent contexts (#GH122892)
364371
- Clang now emits the ``-Wunused-variable`` warning when some structured bindings are unused
365372
and the ``[[maybe_unused]]`` attribute is not applied. (#GH125810)
366-
- Clang now issues an error when placement new is used to modify a const-qualified variable
373+
- Clang no longer crashes when establishing subsumption between some constraint expressions. (#GH122581)
374+
- Clang now issues an error when placement new is used to modify a const-qualified variable
367375
in a ``constexpr`` function. (#GH131432)
368376

369377
Bug Fixes to AST Handling

clang/include/clang/AST/Stmt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ class alignas(void *) Stmt {
531531
unsigned : NumExprBits;
532532

533533
LLVM_PREFERRED_TYPE(UnaryExprOrTypeTrait)
534-
unsigned Kind : 3;
534+
unsigned Kind : 4;
535535
LLVM_PREFERRED_TYPE(bool)
536536
unsigned IsType : 1; // true if operand is a type, false if an expression.
537537
};

clang/include/clang/AST/Type.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3812,6 +3812,19 @@ class IncompleteArrayType : public ArrayType {
38123812
/// ++x;
38133813
/// int Z[x];
38143814
/// }
3815+
///
3816+
/// FIXME: Even constant array types might be represented by a
3817+
/// VariableArrayType, as in:
3818+
///
3819+
/// void func(int n) {
3820+
/// int array[7][n];
3821+
/// }
3822+
///
3823+
/// Even though 'array' is a constant-size array of seven elements of type
3824+
/// variable-length array of size 'n', it will be represented as a
3825+
/// VariableArrayType whose 'SizeExpr' is an IntegerLiteral whose value is 7.
3826+
/// Instead, this should be a ConstantArrayType whose element is a
3827+
/// VariableArrayType, which models the type better.
38153828
class VariableArrayType : public ArrayType {
38163829
friend class ASTContext; // ASTContext creates these.
38173830

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,17 @@ def ext_c99_feature : Extension<
171171
"'%0' is a C99 extension">, InGroup<C99>;
172172
def ext_c11_feature : Extension<
173173
"'%0' is a C11 extension">, InGroup<C11>;
174+
def ext_c2y_feature : Extension<
175+
"'%0' is a C2y extension">, InGroup<C2y>;
174176
def warn_c11_compat_keyword : Warning<
175177
"'%0' is incompatible with C standards before C11">,
176178
InGroup<CPre11Compat>, DefaultIgnore;
177179
def warn_c23_compat_keyword : Warning<
178180
"'%0' is incompatible with C standards before C23">,
179181
InGroup<CPre23Compat>, DefaultIgnore;
182+
def warn_c2y_compat_keyword : Warning<
183+
"'%0' is incompatible with C standards before C2y">,
184+
InGroup<CPre2yCompat>, DefaultIgnore;
180185

181186
def err_c11_noreturn_misplaced : Error<
182187
"'_Noreturn' keyword must precede function declarator">;

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7022,6 +7022,8 @@ def err_sizeof_alignof_typeof_bitfield : Error<
70227022
"bit-field">;
70237023
def err_alignof_member_of_incomplete_type : Error<
70247024
"invalid application of 'alignof' to a field of a class still being defined">;
7025+
def err_countof_arg_not_array_type : Error<
7026+
"'_Countof' requires an argument of array type; %0 invalid">;
70257027
def err_vecstep_non_scalar_vector_type : Error<
70267028
"'vec_step' requires built-in scalar or vector type, %0 invalid">;
70277029
def err_offsetof_incomplete_type : Error<

clang/include/clang/Basic/Features.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ FEATURE(c_static_assert, LangOpts.C11)
166166
FEATURE(c_thread_local, LangOpts.C11 &&PP.getTargetInfo().isTLSSupported())
167167
// C23 features
168168
FEATURE(c_fixed_enum, LangOpts.C23)
169+
// C2y features
170+
FEATURE(c_countof, LangOpts.C2y)
169171
// C++11 features
170172
FEATURE(cxx_access_control_sfinae, LangOpts.CPlusPlus11)
171173
FEATURE(cxx_alias_templates, LangOpts.CPlusPlus11)
@@ -274,6 +276,8 @@ EXTENSION(c_thread_local, PP.getTargetInfo().isTLSSupported())
274276
// C23 features supported by other languages as extensions
275277
EXTENSION(c_attributes, true)
276278
EXTENSION(c_fixed_enum, true)
279+
// C2y features supported by other languages as extensions
280+
EXTENSION(c_countof, !LangOpts.C2y && !LangOpts.CPlusPlus)
277281
// C++11 features supported by other languages as extensions.
278282
EXTENSION(cxx_atomic, LangOpts.CPlusPlus)
279283
EXTENSION(cxx_default_function_template_args, LangOpts.CPlusPlus)

0 commit comments

Comments
 (0)