Skip to content

Commit dc6b029

Browse files
committed
merge main into amd-staging
2 parents 2f6a927 + 37ffe89 commit dc6b029

File tree

70 files changed

+1148
-278
lines changed

Some content is hidden

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

70 files changed

+1148
-278
lines changed

clang-tools-extra/clangd/tool/ClangdMain.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,6 @@ class FlagsConfigProvider : public config::Provider {
668668
std::optional<Config::ExternalIndexSpec> IndexSpec;
669669
std::optional<Config::BackgroundPolicy> BGPolicy;
670670
std::optional<Config::ArgumentListsPolicy> ArgumentLists;
671-
std::optional<Config::HeaderInsertionPolicy> HeaderInsertionPolicy;
672671

673672
// If --compile-commands-dir arg was invoked, check value and override
674673
// default path.
@@ -713,11 +712,6 @@ class FlagsConfigProvider : public config::Provider {
713712
BGPolicy = Config::BackgroundPolicy::Skip;
714713
}
715714

716-
// If CLI has set never, use that regardless of what the config files have
717-
if (HeaderInsertion == Config::HeaderInsertionPolicy::NeverInsert) {
718-
HeaderInsertionPolicy = Config::HeaderInsertionPolicy::NeverInsert;
719-
}
720-
721715
if (std::optional<bool> Enable = shouldEnableFunctionArgSnippets()) {
722716
ArgumentLists = *Enable ? Config::ArgumentListsPolicy::FullPlaceholders
723717
: Config::ArgumentListsPolicy::Delimiters;
@@ -732,8 +726,8 @@ class FlagsConfigProvider : public config::Provider {
732726
C.Index.Background = *BGPolicy;
733727
if (ArgumentLists)
734728
C.Completion.ArgumentLists = *ArgumentLists;
735-
if (HeaderInsertionPolicy)
736-
C.Completion.HeaderInsertion = *HeaderInsertionPolicy;
729+
if (HeaderInsertion.getNumOccurrences())
730+
C.Completion.HeaderInsertion = HeaderInsertion;
737731
if (AllScopesCompletion.getNumOccurrences())
738732
C.Completion.AllScopes = AllScopesCompletion;
739733

clang/docs/LanguageExtensions.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3798,6 +3798,17 @@ Trivially relocates ``count`` objects of relocatable, complete type ``T``
37983798
from ``src`` to ``dest`` and returns ``dest``.
37993799
This builtin is used to implement ``std::trivially_relocate``.
38003800
3801+
``__builtin_invoke``
3802+
--------------------
3803+
3804+
**Syntax**:
3805+
3806+
.. code-block:: c++
3807+
3808+
template <class Callee, class... Args>
3809+
decltype(auto) __builtin_invoke(Callee&& callee, Args&&... args);
3810+
3811+
``__builtin_invoke`` is equivalent to ``std::invoke``.
38013812
38023813
``__builtin_preserve_access_index``
38033814
-----------------------------------

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ Non-comprehensive list of changes in this release
327327
different than before.
328328
- Fixed a crash when a VLA with an invalid size expression was used within a
329329
``sizeof`` or ``typeof`` expression. (#GH138444)
330+
- ``__builtin_invoke`` has been added to improve the compile time of ``std::invoke``.
330331
- Deprecation warning is emitted for the deprecated ``__reference_binds_to_temporary`` intrinsic.
331332
``__reference_constructs_from_temporary`` should be used instead. (#GH44056)
332333
- Added `__builtin_get_vtable_pointer` to directly load the primary vtable pointer from a
@@ -672,7 +673,7 @@ Improvements to Clang's diagnostics
672673
false positives in exception-heavy code, though only simple patterns
673674
are currently recognized.
674675

675-
676+
676677
Improvements to Clang's time-trace
677678
----------------------------------
678679

@@ -750,7 +751,7 @@ Bug Fixes in This Version
750751
- Fixed incorrect token location when emitting diagnostics for tokens expanded from macros. (#GH143216)
751752
- Fixed an infinite recursion when checking constexpr destructors. (#GH141789)
752753
- Fixed a crash when a malformed using declaration appears in a ``constexpr`` function. (#GH144264)
753-
- Fixed a bug when use unicode character name in macro concatenation. (#GH145240)
754+
- Fixed a bug when use unicode character name in macro concatenation. (#GH145240)
754755

755756
Bug Fixes to Compiler Builtins
756757
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

clang/docs/Toolchain.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,3 +347,8 @@ workarounds for issues discovered in libstdc++, and these are removed
347347
as fixed libstdc++ becomes sufficiently old.
348348

349349
You can instruct Clang to use libstdc++ with the ``-stdlib=libstdc++`` flag.
350+
351+
GCC Installation
352+
=================
353+
Users can point to their GCC installation by using the ``-gcc-toolchain`` or by
354+
using ``-gcc-install-dir`` flag.

clang/include/clang/Basic/Builtins.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4314,6 +4314,12 @@ def MoveIfNsoexcept : CxxLibBuiltin<"utility"> {
43144314
let Namespace = "std";
43154315
}
43164316

4317+
def Invoke : Builtin {
4318+
let Spellings = ["__builtin_invoke"];
4319+
let Attributes = [CustomTypeChecking, Constexpr];
4320+
let Prototype = "void(...)";
4321+
}
4322+
43174323
def Annotation : Builtin {
43184324
let Spellings = ["__builtin_annotation"];
43194325
let Attributes = [NoThrow, CustomTypeChecking];

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,9 @@ def note_drv_available_multilibs : Note<
868868
"available multilibs are:%0">;
869869
def err_drv_multilib_custom_error : Error<
870870
"multilib configuration error: %0">;
871+
def warn_drv_multilib_not_available_for_target: Warning<
872+
"no multilib structure encoded for Arm, Aarch64 and PPC targets">,
873+
InGroup<DiagGroup<"multilib-not-found">>;
871874

872875
def err_drv_experimental_crel : Error<
873876
"-Wa,--allow-experimental-crel must be specified to use -Wa,--crel. "

clang/include/clang/Sema/Sema.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15192,11 +15192,18 @@ class Sema final : public SemaBase {
1519215192
SourceLocation Loc);
1519315193
QualType BuiltinRemoveReference(QualType BaseType, UTTKind UKind,
1519415194
SourceLocation Loc);
15195+
15196+
QualType BuiltinRemoveCVRef(QualType BaseType, SourceLocation Loc) {
15197+
return BuiltinRemoveReference(BaseType, UTTKind::RemoveCVRef, Loc);
15198+
}
15199+
1519515200
QualType BuiltinChangeCVRQualifiers(QualType BaseType, UTTKind UKind,
1519615201
SourceLocation Loc);
1519715202
QualType BuiltinChangeSignedness(QualType BaseType, UTTKind UKind,
1519815203
SourceLocation Loc);
1519915204

15205+
bool BuiltinIsBaseOf(SourceLocation RhsTLoc, QualType LhsT, QualType RhsT);
15206+
1520015207
/// Ensure that the type T is a literal type.
1520115208
///
1520215209
/// This routine checks whether the type @p T is a literal type. If @p T is an

clang/lib/Driver/ToolChains/Arch/AArch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ getAArch64MicroArchFeaturesFromMtune(const Driver &D, StringRef Mtune,
170170
// 'cyclone' and later have zero-cycle register moves and zeroing.
171171
if (MtuneLowerCase == "cyclone" ||
172172
StringRef(MtuneLowerCase).starts_with("apple")) {
173-
Features.push_back("+zcm");
173+
Features.push_back("+zcm-gpr64");
174174
Features.push_back("+zcz");
175175
}
176176

0 commit comments

Comments
 (0)