Skip to content

Commit 0058159

Browse files
committed
Merge branch 'main' into amd-trunk-dev
2 parents 6eb4e22 + 710590e commit 0058159

File tree

834 files changed

+73635
-28851
lines changed

Some content is hidden

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

834 files changed

+73635
-28851
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,7 @@ e2c2ffbe7a1b5d9e32a2ce64279475b50c4cba5b
8888
# [lldb][nfc] Deindent ProcessGDBRemote::SetThreadStopInfo by two levels
8989
b32931c5b32eb0d2cf37d688b34f8548c9674c19
9090

91-
# [libc++][NFC] Fix inconsistent quoting and spacing in our CSV files
91+
# [libc++] Various consistency fixes to the CSV files that we use for tracking Standards Conformance
9292
64946fdaf9864d8279da1c30e4d7214fe13d1427
93+
b6262880b34629e9d7a72b5a42f315a3c9ed8139
94+
39c7dc7207e76e72da21cf4fedda21b5311bf62d

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,6 @@ clang/test/AST/Interp/ @tbaederr
150150
/llvm/**/DWARFLinker/ @JDevlieghere
151151
/llvm/**/dsymutil/ @JDevlieghere
152152
/llvm/**/llvm-dwarfutil/ @JDevlieghere
153+
154+
# libclang/Python bindings
155+
/clang/bindings/python @DeinAlptraum
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Get LLVM Version
2+
description: >-
3+
Get the LLVM version from the llvm-project source tree. This action assumes
4+
the llvm-project sources have already been checked out into GITHUB_WORKSPACE.
5+
6+
outputs:
7+
major:
8+
description: LLVM major version
9+
value: ${{ steps.version.outputs.major }}
10+
minor:
11+
description: LLVM minor version
12+
value: ${{ steps.version.outputs.minor }}
13+
patch:
14+
description: LLVM patch version
15+
value: ${{ steps.version.outputs.patch }}
16+
17+
runs:
18+
using: "composite"
19+
steps:
20+
- name: Get Version
21+
shell: bash
22+
id: version
23+
run: |
24+
for v in major minor patch; do
25+
echo "$v=`llvm/utils/release/get-llvm-version.sh --$v`" >> $GITHUB_OUTPUT
26+
done

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ jobs:
3333
ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }}
3434
ABI_LIBS: ${{ steps.vars.outputs.ABI_LIBS }}
3535
BASELINE_VERSION_MAJOR: ${{ steps.vars.outputs.BASELINE_VERSION_MAJOR }}
36-
LLVM_VERSION_MAJOR: ${{ steps.version.outputs.LLVM_VERSION_MAJOR }}
37-
LLVM_VERSION_MINOR: ${{ steps.version.outputs.LLVM_VERSION_MINOR }}
38-
LLVM_VERSION_PATCH: ${{ steps.version.outputs.LLVM_VERSION_PATCH }}
36+
LLVM_VERSION_MAJOR: ${{ steps.version.outputs.major }}
37+
LLVM_VERSION_MINOR: ${{ steps.version.outputs.minor }}
38+
LLVM_VERSION_PATCH: ${{ steps.version.outputs.patch }}
3939
steps:
4040
- name: Checkout source
4141
uses: actions/checkout@v4
@@ -44,14 +44,14 @@ jobs:
4444

4545
- name: Get LLVM version
4646
id: version
47-
uses: llvm/actions/get-llvm-version@main
47+
uses: ./.github/workflows/get-llvm-version
4848

4949
- name: Setup Variables
5050
id: vars
5151
run: |
5252
remote_repo='https://github.com/llvm/llvm-project'
53-
if [ ${{ steps.version.outputs.LLVM_VERSION_PATCH }} -eq 0 ]; then
54-
major_version=$(( ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - 1))
53+
if [ ${{ steps.version.outputs.patch }} -eq 0 ]; then
54+
major_version=$(( ${{ steps.version.outputs.major }} - 1))
5555
baseline_ref="llvmorg-$major_version.1.0"
5656
5757
# If there is a minor release, we want to use that as the base line.
@@ -73,8 +73,8 @@ jobs:
7373
} >> "$GITHUB_OUTPUT"
7474
else
7575
{
76-
echo "BASELINE_VERSION_MAJOR=${{ steps.version.outputs.LLVM_VERSION_MAJOR }}"
77-
echo "BASELINE_REF=llvmorg-${{ steps.version.outputs.LLVM_VERSION_MAJOR }}.1.0"
76+
echo "BASELINE_VERSION_MAJOR=${{ steps.version.outputs.major }}"
77+
echo "BASELINE_REF=llvmorg-${{ steps.version.outputs.major }}.1.0"
7878
echo "ABI_HEADERS=."
7979
echo "ABI_LIBS=libclang.so libclang-cpp.so"
8080
} >> "$GITHUB_OUTPUT"

.github/workflows/llvm-tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ jobs:
4343
ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }}
4444
BASELINE_VERSION_MAJOR: ${{ steps.vars.outputs.BASELINE_VERSION_MAJOR }}
4545
BASELINE_VERSION_MINOR: ${{ steps.vars.outputs.BASELINE_VERSION_MINOR }}
46-
LLVM_VERSION_MAJOR: ${{ steps.version.outputs.LLVM_VERSION_MAJOR }}
47-
LLVM_VERSION_MINOR: ${{ steps.version.outputs.LLVM_VERSION_MINOR }}
48-
LLVM_VERSION_PATCH: ${{ steps.version.outputs.LLVM_VERSION_PATCH }}
46+
LLVM_VERSION_MAJOR: ${{ steps.version.outputs.major }}
47+
LLVM_VERSION_MINOR: ${{ steps.version.outputs.minor }}
48+
LLVM_VERSION_PATCH: ${{ steps.version.outputs.patch }}
4949
steps:
5050
- name: Checkout source
5151
uses: actions/checkout@v4
@@ -54,7 +54,7 @@ jobs:
5454

5555
- name: Get LLVM version
5656
id: version
57-
uses: llvm/actions/get-llvm-version@main
57+
uses: ./.github/workflows/get-llvm-version
5858

5959
- name: Setup Variables
6060
id: vars
@@ -66,14 +66,14 @@ jobs:
6666
# 18.1.0 We want to check 17.0.x
6767
# 18.1.1 We want to check 18.1.0
6868
echo "BASELINE_VERSION_MINOR=1" >> "$GITHUB_OUTPUT"
69-
if [ ${{ steps.version.outputs.LLVM_VERSION_PATCH }} -eq 0 ]; then
69+
if [ ${{ steps.version.outputs.patch }} -eq 0 ]; then
7070
{
71-
echo "BASELINE_VERSION_MAJOR=$(( ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - 1))"
71+
echo "BASELINE_VERSION_MAJOR=$(( ${{ steps.version.outputs.major }} - 1))"
7272
echo "ABI_HEADERS=llvm-c"
7373
} >> "$GITHUB_OUTPUT"
7474
else
7575
{
76-
echo "BASELINE_VERSION_MAJOR=${{ steps.version.outputs.LLVM_VERSION_MAJOR }}"
76+
echo "BASELINE_VERSION_MAJOR=${{ steps.version.outputs.major }}"
7777
echo "ABI_HEADERS=."
7878
} >> "$GITHUB_OUTPUT"
7979
fi

.github/workflows/release-binaries.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ jobs:
5757
release-binary-filename: ${{ steps.vars.outputs.release-binary-filename }}
5858

5959
steps:
60+
# It's good practice to use setup-python, but this is also required on macos-14
61+
# due to https://github.com/actions/runner-images/issues/10385
62+
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
63+
with:
64+
python-version: '3.12'
65+
6066
- name: Checkout LLVM
6167
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6268

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ class Foo final {})cpp";
13251325
HI.LocalScope = "";
13261326
HI.Kind = index::SymbolKind::TypeAlias;
13271327
HI.Definition = "template <typename T> using AA = A<T>";
1328-
HI.Type = {"A<T>", "type-parameter-0-0"}; // FIXME: should be 'T'
1328+
HI.Type = {"A<T>", "T"};
13291329
HI.TemplateParameters = {
13301330
{{"typename"}, std::string("T"), std::nullopt}};
13311331
}},

clang-tools-extra/test/clang-tidy/checkers/bugprone/unused-local-non-trivial-variable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ T qux(T Generic) {
7676
async::Future<T> TemplateType;
7777
// CHECK-MESSAGES: :[[@LINE-1]]:22: warning: unused local variable 'TemplateType' of type 'async::Future<T>' [bugprone-unused-local-non-trivial-variable]
7878
a::Future<T> AliasTemplateType;
79-
// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: unused local variable 'AliasTemplateType' of type 'a::Future<T>' (aka 'Future<type-parameter-0-0>') [bugprone-unused-local-non-trivial-variable]
79+
// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: unused local variable 'AliasTemplateType' of type 'a::Future<T>' (aka 'Future<T>') [bugprone-unused-local-non-trivial-variable]
8080
[[maybe_unused]] async::Future<Units> MaybeUnused;
8181
return Generic;
8282
}

clang/bindings/python/clang/cindex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2654,7 +2654,7 @@ def get_exception_specification_kind(self):
26542654
the ExceptionSpecificationKind enumeration.
26552655
"""
26562656
return ExceptionSpecificationKind.from_id(
2657-
conf.lib.clang.getExceptionSpecificationType(self)
2657+
conf.lib.clang_getExceptionSpecificationType(self)
26582658
)
26592659

26602660
@property

clang/bindings/python/tests/cindex/test_exception_specification_kind.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
def find_function_declarations(node, declarations=[]):
1515
if node.kind == clang.cindex.CursorKind.FUNCTION_DECL:
16-
declarations.append((node.spelling, node.exception_specification_kind))
16+
declarations.append(node)
1717
for child in node.get_children():
1818
declarations = find_function_declarations(child, declarations)
1919
return declarations
@@ -33,4 +33,12 @@ def test_exception_specification_kind(self):
3333
("square2", ExceptionSpecificationKind.BASIC_NOEXCEPT),
3434
("square3", ExceptionSpecificationKind.COMPUTED_NOEXCEPT),
3535
]
36-
self.assertListEqual(declarations, expected)
36+
from_cursor = [
37+
(node.spelling, node.exception_specification_kind) for node in declarations
38+
]
39+
from_type = [
40+
(node.spelling, node.type.get_exception_specification_kind())
41+
for node in declarations
42+
]
43+
self.assertListEqual(from_cursor, expected)
44+
self.assertListEqual(from_type, expected)

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ foreach(target armv6m-none-eabi;armv7m-none-eabi;armv8m.main-none-eabi)
328328
# TODO: The preprocessor defines workaround various issues in libc and libc++ integration.
329329
# These should be addressed and removed over time.
330330
set(RUNTIMES_${target}_CMAKE_${lang}_local_flags "--target=${target} -mthumb -Wno-atomic-alignment \"-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)\" \"-Dfprintf(stream, format, ...)=printf(format)\" \"-Dtimeval=struct timeval{int tv_sec; int tv_usec;}\" \"-Dgettimeofday(tv, tz)\" -D_LIBCPP_PRINT=1")
331-
if(${target} STREQUAL "armv8m.main-unknown-eabi")
331+
if(${target} STREQUAL "armv8m.main-none-eabi")
332332
set(RUNTIMES_${target}_CMAKE_${lang}_local_flags "${RUNTIMES_${target}_CMAKE_${lang}_local_flags} -mfloat-abi=softfp -march=armv8m.main+fp+dsp -mcpu=cortex-m33" CACHE STRING "")
333333
endif()
334334
set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "${RUNTIMES_${target}_CMAKE_${lang}_local_flags}" CACHE STRING "")

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,7 @@ the configuration (without a prefix: ``Auto``).
14841484
* ``OAS_AlignAfterOperator`` (in configuration: ``AlignAfterOperator``)
14851485
Horizontally align operands of binary and ternary expressions.
14861486

1487-
This is similar to ``AO_Align``, except when
1487+
This is similar to ``OAS_Align``, except when
14881488
``BreakBeforeBinaryOperators`` is set, the operator is un-indented so
14891489
that the wrapped operand is aligned with the operand on the first line.
14901490

clang/docs/CommandGuide/clang.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,12 @@ Code Generation Options
429429

430430
:option:`-Ofast` Enables all the optimizations from :option:`-O3` along
431431
with other aggressive optimizations that may violate strict compliance with
432-
language standards. This is deprecated in favor of :option:`-O3`
433-
in combination with :option:`-ffast-math`.
432+
language standards. This is deprecated in Clang 19 and a warning is emitted
433+
that :option:`-O3` in combination with :option:`-ffast-math` should be used
434+
instead if the request for non-standard math behavior is intended. There
435+
is no timeline yet for removal; the aim is to discourage use of
436+
:option:`-Ofast` due to the surprising behavior of an optimization flag
437+
changing the observable behavior of correct code.
434438

435439
:option:`-Os` Like :option:`-O2` with extra optimizations to reduce code
436440
size.

clang/docs/LanguageExtensions.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,10 +1615,6 @@ The following type trait primitives are supported by Clang. Those traits marked
16151615
* ``__is_nothrow_assignable`` (C++, MSVC 2013)
16161616
* ``__is_nothrow_constructible`` (C++, MSVC 2013)
16171617
* ``__is_nothrow_destructible`` (C++, MSVC 2013)
1618-
* ``__is_nullptr`` (C++, GNU, Microsoft, Embarcadero):
1619-
Returns true for ``std::nullptr_t`` and false for everything else. The
1620-
corresponding standard library feature is ``std::is_null_pointer``, but
1621-
``__is_null_pointer`` is already in use by some implementations.
16221618
* ``__is_object`` (C++, Embarcadero)
16231619
* ``__is_pod`` (C++, GNU, Microsoft, Embarcadero):
16241620
Note, the corresponding standard trait was deprecated in C++20.

clang/docs/OpenMPSupport.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ implementation.
181181
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
182182
| device | user-defined mappers | :good:`done` | D56326,D58638,D58523,D58074,D60972,D59474 |
183183
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
184+
| device | map array-section with implicit mapper | :good:`done` | https://github.com/llvm/llvm-project/pull/101101 |
185+
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
184186
| device | mapping lambda expression | :good:`done` | D51107 |
185187
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
186188
| device | clause: use_device_addr for target data | :good:`done` | |
@@ -358,5 +360,8 @@ considered for standardization. Please post on the
358360
| device extension | `'ompx_hold' map type modifier | :good:`prototyped` | D106509, D106510 |
359361
| | <https://openmp.llvm.org/docs/openacc/OpenMPExtensions.html#ompx-hold>`_ | | |
360362
+------------------------------+-----------------------------------------------------------------------------------+--------------------------+--------------------------------------------------------+
363+
| device extension | `'ompx_bare' clause on 'target teams' construct | :good:`prototyped` | #66844, #70612 |
364+
| | <https://www.osti.gov/servlets/purl/2205717>`_ | | |
365+
+------------------------------+-----------------------------------------------------------------------------------+--------------------------+--------------------------------------------------------+
361366

362367
.. _Discourse forums (Runtimes - OpenMP category): https://discourse.llvm.org/c/runtimes/openmp/35

clang/docs/ReleaseNotes.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ C/C++ Language Potentially Breaking Changes
4343
C++ Specific Potentially Breaking Changes
4444
-----------------------------------------
4545

46+
- The type trait builtin ``__is_nullptr`` has been removed, since it has very
47+
few users and can be written as ``__is_same(__remove_cv(T), decltype(nullptr))``,
48+
which GCC supports as well.
49+
4650
ABI Changes in This Version
4751
---------------------------
4852

@@ -144,6 +148,9 @@ Improvements to Clang's diagnostics
144148
- Clang now diagnoses undefined behavior in constant expressions more consistently. This includes invalid shifts, and signed overflow in arithmetic.
145149

146150
- -Wdangling-assignment-gsl is enabled by default.
151+
- Clang now does a better job preserving the template arguments as written when specializing concepts.
152+
- Clang now always preserves the template arguments as written used
153+
to specialize template type aliases.
147154

148155
Improvements to Clang's time-trace
149156
----------------------------------
@@ -156,6 +163,7 @@ Bug Fixes in This Version
156163

157164
- Fixed the definition of ``ATOMIC_FLAG_INIT`` in ``<stdatomic.h>`` so it can
158165
be used in C++.
166+
- Fixed a failed assertion when checking required literal types in C context. (#GH101304).
159167

160168
Bug Fixes to Compiler Builtins
161169
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -172,6 +180,12 @@ Bug Fixes to C++ Support
172180
- Clang now correctly parses potentially declarative nested-name-specifiers in pointer-to-member declarators.
173181
- Fix a crash when checking the initialzier of an object that was initialized
174182
with a string literal. (#GH82167)
183+
- Fix a crash when matching template template parameters with templates which have
184+
parameters of different class type. (#GH101394)
185+
- Clang now correctly recognizes the correct context for parameter
186+
substitutions in concepts, so it doesn't incorrectly complain of missing
187+
module imports in those situations. (#GH60336)
188+
- Fix init-capture packs having a size of one before being instantiated. (#GH63677)
175189

176190
Bug Fixes to AST Handling
177191
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -216,6 +230,10 @@ X86 Support
216230
functions defined by the ``*mmintrin.h`` headers. A mapping can be
217231
found in the file ``clang/www/builtins.py``.
218232

233+
- Support ISA of ``AVX10.2``.
234+
* Supported MINMAX intrinsics of ``*_(mask(z)))_minmax(ne)_p[s|d|h|bh]`` and
235+
``*_(mask(z)))_minmax_s[s|d|h]``.
236+
219237
Arm and AArch64 Support
220238
^^^^^^^^^^^^^^^^^^^^^^^
221239

@@ -301,10 +319,15 @@ Sanitizers
301319

302320
Python Binding Changes
303321
----------------------
322+
- Fixed an issue that led to crashes when calling ``Type.get_exception_specification_kind``.
304323

305324
OpenMP Support
306325
--------------
307326

327+
Improvements
328+
^^^^^^^^^^^^
329+
- Improve the handling of mapping array-section for struct containing nested structs with user defined mappers
330+
308331
Additional Information
309332
======================
310333

clang/include/clang/AST/ASTConcept.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ class ConstraintSatisfaction : public llvm::FoldingSetNode {
4343
ConstraintSatisfaction() = default;
4444

4545
ConstraintSatisfaction(const NamedDecl *ConstraintOwner,
46-
ArrayRef<TemplateArgument> TemplateArgs) :
47-
ConstraintOwner(ConstraintOwner), TemplateArgs(TemplateArgs.begin(),
48-
TemplateArgs.end()) { }
46+
ArrayRef<TemplateArgument> TemplateArgs)
47+
: ConstraintOwner(ConstraintOwner), TemplateArgs(TemplateArgs) {}
4948

5049
using SubstitutionDiagnostic = std::pair<SourceLocation, StringRef>;
5150
using Detail = llvm::PointerUnion<Expr *, SubstitutionDiagnostic *>;

clang/include/clang/AST/DeclBase.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,9 @@ class alignas(8) Decl {
673673
/// Whether this declaration comes from explicit global module.
674674
bool isFromExplicitGlobalModule() const;
675675

676+
/// Whether this declaration comes from global module.
677+
bool isFromGlobalModule() const;
678+
676679
/// Whether this declaration comes from a named module.
677680
bool isInNamedModule() const;
678681

clang/include/clang/Basic/Builtins.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4707,6 +4707,12 @@ def HLSLIsinf : LangBuiltin<"HLSL_LANG"> {
47074707
let Prototype = "void(...)";
47084708
}
47094709

4710+
def HLSLLength : LangBuiltin<"HLSL_LANG"> {
4711+
let Spellings = ["__builtin_hlsl_length"];
4712+
let Attributes = [NoThrow, Const];
4713+
let Prototype = "void(...)";
4714+
}
4715+
47104716
def HLSLLerp : LangBuiltin<"HLSL_LANG"> {
47114717
let Spellings = ["__builtin_hlsl_lerp"];
47124718
let Attributes = [NoThrow, Const];

0 commit comments

Comments
 (0)