Skip to content

Commit

Permalink
Merge branch 'main' into amd-trunk-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
skatrak committed Aug 5, 2024
2 parents 6eb4e22 + 710590e commit 0058159
Show file tree
Hide file tree
Showing 834 changed files with 73,635 additions and 28,851 deletions.
4 changes: 3 additions & 1 deletion .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,7 @@ e2c2ffbe7a1b5d9e32a2ce64279475b50c4cba5b
# [lldb][nfc] Deindent ProcessGDBRemote::SetThreadStopInfo by two levels
b32931c5b32eb0d2cf37d688b34f8548c9674c19

# [libc++][NFC] Fix inconsistent quoting and spacing in our CSV files
# [libc++] Various consistency fixes to the CSV files that we use for tracking Standards Conformance
64946fdaf9864d8279da1c30e4d7214fe13d1427
b6262880b34629e9d7a72b5a42f315a3c9ed8139
39c7dc7207e76e72da21cf4fedda21b5311bf62d
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,6 @@ clang/test/AST/Interp/ @tbaederr
/llvm/**/DWARFLinker/ @JDevlieghere
/llvm/**/dsymutil/ @JDevlieghere
/llvm/**/llvm-dwarfutil/ @JDevlieghere

# libclang/Python bindings
/clang/bindings/python @DeinAlptraum
26 changes: 26 additions & 0 deletions .github/workflows/get-llvm-version/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Get LLVM Version
description: >-
Get the LLVM version from the llvm-project source tree. This action assumes
the llvm-project sources have already been checked out into GITHUB_WORKSPACE.
outputs:
major:
description: LLVM major version
value: ${{ steps.version.outputs.major }}
minor:
description: LLVM minor version
value: ${{ steps.version.outputs.minor }}
patch:
description: LLVM patch version
value: ${{ steps.version.outputs.patch }}

runs:
using: "composite"
steps:
- name: Get Version
shell: bash
id: version
run: |
for v in major minor patch; do
echo "$v=`llvm/utils/release/get-llvm-version.sh --$v`" >> $GITHUB_OUTPUT
done
16 changes: 8 additions & 8 deletions .github/workflows/libclang-abi-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }}
ABI_LIBS: ${{ steps.vars.outputs.ABI_LIBS }}
BASELINE_VERSION_MAJOR: ${{ steps.vars.outputs.BASELINE_VERSION_MAJOR }}
LLVM_VERSION_MAJOR: ${{ steps.version.outputs.LLVM_VERSION_MAJOR }}
LLVM_VERSION_MINOR: ${{ steps.version.outputs.LLVM_VERSION_MINOR }}
LLVM_VERSION_PATCH: ${{ steps.version.outputs.LLVM_VERSION_PATCH }}
LLVM_VERSION_MAJOR: ${{ steps.version.outputs.major }}
LLVM_VERSION_MINOR: ${{ steps.version.outputs.minor }}
LLVM_VERSION_PATCH: ${{ steps.version.outputs.patch }}
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand All @@ -44,14 +44,14 @@ jobs:

- name: Get LLVM version
id: version
uses: llvm/actions/get-llvm-version@main
uses: ./.github/workflows/get-llvm-version

- name: Setup Variables
id: vars
run: |
remote_repo='https://github.com/llvm/llvm-project'
if [ ${{ steps.version.outputs.LLVM_VERSION_PATCH }} -eq 0 ]; then
major_version=$(( ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - 1))
if [ ${{ steps.version.outputs.patch }} -eq 0 ]; then
major_version=$(( ${{ steps.version.outputs.major }} - 1))
baseline_ref="llvmorg-$major_version.1.0"
# If there is a minor release, we want to use that as the base line.
Expand All @@ -73,8 +73,8 @@ jobs:
} >> "$GITHUB_OUTPUT"
else
{
echo "BASELINE_VERSION_MAJOR=${{ steps.version.outputs.LLVM_VERSION_MAJOR }}"
echo "BASELINE_REF=llvmorg-${{ steps.version.outputs.LLVM_VERSION_MAJOR }}.1.0"
echo "BASELINE_VERSION_MAJOR=${{ steps.version.outputs.major }}"
echo "BASELINE_REF=llvmorg-${{ steps.version.outputs.major }}.1.0"
echo "ABI_HEADERS=."
echo "ABI_LIBS=libclang.so libclang-cpp.so"
} >> "$GITHUB_OUTPUT"
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/llvm-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ jobs:
ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }}
BASELINE_VERSION_MAJOR: ${{ steps.vars.outputs.BASELINE_VERSION_MAJOR }}
BASELINE_VERSION_MINOR: ${{ steps.vars.outputs.BASELINE_VERSION_MINOR }}
LLVM_VERSION_MAJOR: ${{ steps.version.outputs.LLVM_VERSION_MAJOR }}
LLVM_VERSION_MINOR: ${{ steps.version.outputs.LLVM_VERSION_MINOR }}
LLVM_VERSION_PATCH: ${{ steps.version.outputs.LLVM_VERSION_PATCH }}
LLVM_VERSION_MAJOR: ${{ steps.version.outputs.major }}
LLVM_VERSION_MINOR: ${{ steps.version.outputs.minor }}
LLVM_VERSION_PATCH: ${{ steps.version.outputs.patch }}
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand All @@ -54,7 +54,7 @@ jobs:

- name: Get LLVM version
id: version
uses: llvm/actions/get-llvm-version@main
uses: ./.github/workflows/get-llvm-version

- name: Setup Variables
id: vars
Expand All @@ -66,14 +66,14 @@ jobs:
# 18.1.0 We want to check 17.0.x
# 18.1.1 We want to check 18.1.0
echo "BASELINE_VERSION_MINOR=1" >> "$GITHUB_OUTPUT"
if [ ${{ steps.version.outputs.LLVM_VERSION_PATCH }} -eq 0 ]; then
if [ ${{ steps.version.outputs.patch }} -eq 0 ]; then
{
echo "BASELINE_VERSION_MAJOR=$(( ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - 1))"
echo "BASELINE_VERSION_MAJOR=$(( ${{ steps.version.outputs.major }} - 1))"
echo "ABI_HEADERS=llvm-c"
} >> "$GITHUB_OUTPUT"
else
{
echo "BASELINE_VERSION_MAJOR=${{ steps.version.outputs.LLVM_VERSION_MAJOR }}"
echo "BASELINE_VERSION_MAJOR=${{ steps.version.outputs.major }}"
echo "ABI_HEADERS=."
} >> "$GITHUB_OUTPUT"
fi
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ jobs:
release-binary-filename: ${{ steps.vars.outputs.release-binary-filename }}

steps:
# It's good practice to use setup-python, but this is also required on macos-14
# due to https://github.com/actions/runner-images/issues/10385
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
with:
python-version: '3.12'

- name: Checkout LLVM
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clangd/unittests/HoverTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ class Foo final {})cpp";
HI.LocalScope = "";
HI.Kind = index::SymbolKind::TypeAlias;
HI.Definition = "template <typename T> using AA = A<T>";
HI.Type = {"A<T>", "type-parameter-0-0"}; // FIXME: should be 'T'
HI.Type = {"A<T>", "T"};
HI.TemplateParameters = {
{{"typename"}, std::string("T"), std::nullopt}};
}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ T qux(T Generic) {
async::Future<T> TemplateType;
// CHECK-MESSAGES: :[[@LINE-1]]:22: warning: unused local variable 'TemplateType' of type 'async::Future<T>' [bugprone-unused-local-non-trivial-variable]
a::Future<T> AliasTemplateType;
// 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]
// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: unused local variable 'AliasTemplateType' of type 'a::Future<T>' (aka 'Future<T>') [bugprone-unused-local-non-trivial-variable]
[[maybe_unused]] async::Future<Units> MaybeUnused;
return Generic;
}
Expand Down
2 changes: 1 addition & 1 deletion clang/bindings/python/clang/cindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -2654,7 +2654,7 @@ def get_exception_specification_kind(self):
the ExceptionSpecificationKind enumeration.
"""
return ExceptionSpecificationKind.from_id(
conf.lib.clang.getExceptionSpecificationType(self)
conf.lib.clang_getExceptionSpecificationType(self)
)

@property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

def find_function_declarations(node, declarations=[]):
if node.kind == clang.cindex.CursorKind.FUNCTION_DECL:
declarations.append((node.spelling, node.exception_specification_kind))
declarations.append(node)
for child in node.get_children():
declarations = find_function_declarations(child, declarations)
return declarations
Expand All @@ -33,4 +33,12 @@ def test_exception_specification_kind(self):
("square2", ExceptionSpecificationKind.BASIC_NOEXCEPT),
("square3", ExceptionSpecificationKind.COMPUTED_NOEXCEPT),
]
self.assertListEqual(declarations, expected)
from_cursor = [
(node.spelling, node.exception_specification_kind) for node in declarations
]
from_type = [
(node.spelling, node.type.get_exception_specification_kind())
for node in declarations
]
self.assertListEqual(from_cursor, expected)
self.assertListEqual(from_type, expected)
2 changes: 1 addition & 1 deletion clang/cmake/caches/Fuchsia-stage2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ foreach(target armv6m-none-eabi;armv7m-none-eabi;armv8m.main-none-eabi)
# TODO: The preprocessor defines workaround various issues in libc and libc++ integration.
# These should be addressed and removed over time.
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")
if(${target} STREQUAL "armv8m.main-unknown-eabi")
if(${target} STREQUAL "armv8m.main-none-eabi")
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 "")
endif()
set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "${RUNTIMES_${target}_CMAKE_${lang}_local_flags}" CACHE STRING "")
Expand Down
2 changes: 1 addition & 1 deletion clang/docs/ClangFormatStyleOptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ the configuration (without a prefix: ``Auto``).
* ``OAS_AlignAfterOperator`` (in configuration: ``AlignAfterOperator``)
Horizontally align operands of binary and ternary expressions.

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

Expand Down
8 changes: 6 additions & 2 deletions clang/docs/CommandGuide/clang.rst
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,12 @@ Code Generation Options

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

:option:`-Os` Like :option:`-O2` with extra optimizations to reduce code
size.
Expand Down
4 changes: 0 additions & 4 deletions clang/docs/LanguageExtensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1615,10 +1615,6 @@ The following type trait primitives are supported by Clang. Those traits marked
* ``__is_nothrow_assignable`` (C++, MSVC 2013)
* ``__is_nothrow_constructible`` (C++, MSVC 2013)
* ``__is_nothrow_destructible`` (C++, MSVC 2013)
* ``__is_nullptr`` (C++, GNU, Microsoft, Embarcadero):
Returns true for ``std::nullptr_t`` and false for everything else. The
corresponding standard library feature is ``std::is_null_pointer``, but
``__is_null_pointer`` is already in use by some implementations.
* ``__is_object`` (C++, Embarcadero)
* ``__is_pod`` (C++, GNU, Microsoft, Embarcadero):
Note, the corresponding standard trait was deprecated in C++20.
Expand Down
5 changes: 5 additions & 0 deletions clang/docs/OpenMPSupport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ implementation.
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
| device | user-defined mappers | :good:`done` | D56326,D58638,D58523,D58074,D60972,D59474 |
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
| device | map array-section with implicit mapper | :good:`done` | https://github.com/llvm/llvm-project/pull/101101 |
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
| device | mapping lambda expression | :good:`done` | D51107 |
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
| device | clause: use_device_addr for target data | :good:`done` | |
Expand Down Expand Up @@ -358,5 +360,8 @@ considered for standardization. Please post on the
| device extension | `'ompx_hold' map type modifier | :good:`prototyped` | D106509, D106510 |
| | <https://openmp.llvm.org/docs/openacc/OpenMPExtensions.html#ompx-hold>`_ | | |
+------------------------------+-----------------------------------------------------------------------------------+--------------------------+--------------------------------------------------------+
| device extension | `'ompx_bare' clause on 'target teams' construct | :good:`prototyped` | #66844, #70612 |
| | <https://www.osti.gov/servlets/purl/2205717>`_ | | |
+------------------------------+-----------------------------------------------------------------------------------+--------------------------+--------------------------------------------------------+

.. _Discourse forums (Runtimes - OpenMP category): https://discourse.llvm.org/c/runtimes/openmp/35
23 changes: 23 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ C/C++ Language Potentially Breaking Changes
C++ Specific Potentially Breaking Changes
-----------------------------------------

- The type trait builtin ``__is_nullptr`` has been removed, since it has very
few users and can be written as ``__is_same(__remove_cv(T), decltype(nullptr))``,
which GCC supports as well.

ABI Changes in This Version
---------------------------

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

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

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

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

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

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

- Support ISA of ``AVX10.2``.
* Supported MINMAX intrinsics of ``*_(mask(z)))_minmax(ne)_p[s|d|h|bh]`` and
``*_(mask(z)))_minmax_s[s|d|h]``.

Arm and AArch64 Support
^^^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -301,10 +319,15 @@ Sanitizers

Python Binding Changes
----------------------
- Fixed an issue that led to crashes when calling ``Type.get_exception_specification_kind``.

OpenMP Support
--------------

Improvements
^^^^^^^^^^^^
- Improve the handling of mapping array-section for struct containing nested structs with user defined mappers

Additional Information
======================

Expand Down
5 changes: 2 additions & 3 deletions clang/include/clang/AST/ASTConcept.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ class ConstraintSatisfaction : public llvm::FoldingSetNode {
ConstraintSatisfaction() = default;

ConstraintSatisfaction(const NamedDecl *ConstraintOwner,
ArrayRef<TemplateArgument> TemplateArgs) :
ConstraintOwner(ConstraintOwner), TemplateArgs(TemplateArgs.begin(),
TemplateArgs.end()) { }
ArrayRef<TemplateArgument> TemplateArgs)
: ConstraintOwner(ConstraintOwner), TemplateArgs(TemplateArgs) {}

using SubstitutionDiagnostic = std::pair<SourceLocation, StringRef>;
using Detail = llvm::PointerUnion<Expr *, SubstitutionDiagnostic *>;
Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/AST/DeclBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,9 @@ class alignas(8) Decl {
/// Whether this declaration comes from explicit global module.
bool isFromExplicitGlobalModule() const;

/// Whether this declaration comes from global module.
bool isFromGlobalModule() const;

/// Whether this declaration comes from a named module.
bool isInNamedModule() const;

Expand Down
6 changes: 6 additions & 0 deletions clang/include/clang/Basic/Builtins.td
Original file line number Diff line number Diff line change
Expand Up @@ -4707,6 +4707,12 @@ def HLSLIsinf : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void(...)";
}

def HLSLLength : LangBuiltin<"HLSL_LANG"> {
let Spellings = ["__builtin_hlsl_length"];
let Attributes = [NoThrow, Const];
let Prototype = "void(...)";
}

def HLSLLerp : LangBuiltin<"HLSL_LANG"> {
let Spellings = ["__builtin_hlsl_lerp"];
let Attributes = [NoThrow, Const];
Expand Down
Loading

0 comments on commit 0058159

Please sign in to comment.