Skip to content

Commit 5eabf2e

Browse files
author
z1_cciauto
authored
merge main into amd-staging (llvm#3387)
2 parents 12e3d25 + 835f838 commit 5eabf2e

File tree

89 files changed

+3904
-1738
lines changed

Some content is hidden

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

89 files changed

+3904
-1738
lines changed

clang/docs/InternalsManual.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ wording a diagnostic.
139139
you mean %1?``.
140140

141141
* Appropriately capitalize proper nouns like ``Clang``, ``OpenCL``, ``GCC``,
142-
``Objective-C``, etc and language standard versions like ``C11`` or ``C++11``.
142+
``Objective-C``, etc. and language standard versions like ``C11`` or ``C++11``.
143143
* The wording should be succinct. If necessary, use a semicolon to combine
144144
sentence fragments instead of using complete sentences. e.g., prefer wording
145145
like ``'%0' is deprecated; it will be removed in a future release of Clang``
@@ -886,7 +886,7 @@ a string that the tablegen backend uses as a prefix to the
886886
LANG_OPTION_WITH_MARSHALLING([...], LangOpts->IgnoreExceptions, [...])
887887
#endif // LANG_OPTION_WITH_MARSHALLING
888888

889-
Such definition can be used used in the function for parsing and generating
889+
Such definition can be used in the function for parsing and generating
890890
command line:
891891

892892
.. code-block:: c++
@@ -1745,7 +1745,7 @@ will be found by the lookup, since it effectively replaces the first
17451745
declaration of "``f``".
17461746

17471747
(Note that because ``f`` can be redeclared at block scope, or in a friend
1748-
declaration, etc. it is possible that the declaration of ``f`` found by name
1748+
declaration, etc., it is possible that the declaration of ``f`` found by name
17491749
lookup will not be the most recent one.)
17501750

17511751
In the semantics-centric view, overloading of functions is represented
@@ -1945,7 +1945,7 @@ range of iterators over declarations of "``f``".
19451945
function ``DeclContext::getPrimaryContext`` retrieves the "primary" context for
19461946
a given ``DeclContext`` instance, which is the ``DeclContext`` responsible for
19471947
maintaining the lookup table used for the semantics-centric view. Given a
1948-
DeclContext, one can obtain the set of declaration contexts that are
1948+
``DeclContext``, one can obtain the set of declaration contexts that are
19491949
semantically connected to this declaration context, in source order, including
19501950
this context (which will be the only result, for non-namespace contexts) via
19511951
``DeclContext::collectAllContexts``. Note that these functions are used
@@ -1985,7 +1985,7 @@ broken code in the AST:
19851985
errors, the Decl node is marked as invalid.
19861986
- dropping invalid node: this often happens for errors that we don’t have
19871987
graceful recovery. Prior to Recovery AST, a mismatched-argument function call
1988-
expression was dropped though a CallExpr was created for semantic analysis.
1988+
expression was dropped though a ``CallExpr`` was created for semantic analysis.
19891989

19901990
With these strategies, clang surfaces better diagnostics, and provides AST
19911991
consumers a rich AST reflecting the written source code as much as possible even

clang/lib/Analysis/RetainSummaryManager.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ static bool isSubclass(const Decl *D,
147147

148148
static bool isExactClass(const Decl *D, StringRef ClassName) {
149149
using namespace ast_matchers;
150-
DeclarationMatcher sameClassM =
151-
cxxRecordDecl(hasName(std::string(ClassName)));
150+
DeclarationMatcher sameClassM = cxxRecordDecl(hasName(ClassName));
152151
return !(match(sameClassM, *D, D->getASTContext()).empty());
153152
}
154153

libcxx/include/__hash_table

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,41 +1709,45 @@ void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__rehash(size_type __n) _LIBCPP_D
17091709

17101710
template <class _Tp, class _Hash, class _Equal, class _Alloc>
17111711
template <bool _UniqueKeys>
1712-
void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__do_rehash(size_type __nbc) {
1713-
__pointer_allocator& __npa = __bucket_list_.get_deleter().__alloc();
1714-
__bucket_list_.reset(__nbc > 0 ? __pointer_alloc_traits::allocate(__npa, __nbc) : nullptr);
1715-
__bucket_list_.get_deleter().size() = __nbc;
1716-
if (__nbc > 0) {
1717-
for (size_type __i = 0; __i < __nbc; ++__i)
1718-
__bucket_list_[__i] = nullptr;
1719-
__next_pointer __pp = __first_node_.__ptr();
1720-
__next_pointer __cp = __pp->__next_;
1721-
if (__cp != nullptr) {
1722-
size_type __chash = std::__constrain_hash(__cp->__hash(), __nbc);
1723-
__bucket_list_[__chash] = __pp;
1724-
size_type __phash = __chash;
1725-
for (__pp = __cp, void(), __cp = __cp->__next_; __cp != nullptr; __cp = __pp->__next_) {
1726-
__chash = std::__constrain_hash(__cp->__hash(), __nbc);
1727-
if (__chash == __phash)
1728-
__pp = __cp;
1729-
else {
1730-
if (__bucket_list_[__chash] == nullptr) {
1731-
__bucket_list_[__chash] = __pp;
1732-
__pp = __cp;
1733-
__phash = __chash;
1734-
} else {
1735-
__next_pointer __np = __cp;
1736-
if _LIBCPP_CONSTEXPR_SINCE_CXX17 (!_UniqueKeys) {
1737-
for (; __np->__next_ != nullptr &&
1738-
key_eq()(__cp->__upcast()->__get_value(), __np->__next_->__upcast()->__get_value());
1739-
__np = __np->__next_)
1740-
;
1741-
}
1742-
__pp->__next_ = __np->__next_;
1743-
__np->__next_ = __bucket_list_[__chash]->__next_;
1744-
__bucket_list_[__chash]->__next_ = __cp;
1745-
}
1712+
void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__do_rehash(size_type __bucket_count) {
1713+
__pointer_allocator& __ptr_alloc = __bucket_list_.get_deleter().__alloc();
1714+
__bucket_list_.reset(__bucket_count > 0 ? __pointer_alloc_traits::allocate(__ptr_alloc, __bucket_count) : nullptr);
1715+
__bucket_list_.get_deleter().size() = __bucket_count;
1716+
1717+
if (__bucket_count == 0)
1718+
return;
1719+
1720+
for (size_type __i = 0; __i < __bucket_count; ++__i)
1721+
__bucket_list_[__i] = nullptr;
1722+
__next_pointer __pp = __first_node_.__ptr();
1723+
__next_pointer __cp = __pp->__next_;
1724+
1725+
if (!__cp)
1726+
return;
1727+
1728+
size_type __chash = std::__constrain_hash(__cp->__hash(), __bucket_count);
1729+
__bucket_list_[__chash] = __pp;
1730+
size_type __phash = __chash;
1731+
for (__pp = __cp, void(), __cp = __cp->__next_; __cp != nullptr; __cp = __pp->__next_) {
1732+
__chash = std::__constrain_hash(__cp->__hash(), __bucket_count);
1733+
if (__chash == __phash)
1734+
__pp = __cp;
1735+
else {
1736+
if (__bucket_list_[__chash] == nullptr) {
1737+
__bucket_list_[__chash] = __pp;
1738+
__pp = __cp;
1739+
__phash = __chash;
1740+
} else {
1741+
__next_pointer __np = __cp;
1742+
if _LIBCPP_CONSTEXPR (!_UniqueKeys) {
1743+
for (; __np->__next_ != nullptr &&
1744+
key_eq()(__cp->__upcast()->__get_value(), __np->__next_->__upcast()->__get_value());
1745+
__np = __np->__next_)
1746+
;
17461747
}
1748+
__pp->__next_ = __np->__next_;
1749+
__np->__next_ = __bucket_list_[__chash]->__next_;
1750+
__bucket_list_[__chash]->__next_ = __cp;
17471751
}
17481752
}
17491753
}

libcxx/include/tuple

Lines changed: 20 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -448,33 +448,28 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __swallow(_Tp&&...) _NO
448448
template <class _Indx, class... _Tp>
449449
struct __tuple_impl;
450450

451+
struct __forward_args {};
452+
struct __value_init {};
453+
451454
template <size_t... _Indx, class... _Tp>
452455
struct _LIBCPP_DECLSPEC_EMPTY_BASES
453456
__tuple_impl<__index_sequence<_Indx...>, _Tp...> : public __tuple_leaf<_Indx, _Tp>... {
454457
_LIBCPP_HIDE_FROM_ABI constexpr __tuple_impl() noexcept(
455458
__all<is_nothrow_default_constructible<_Tp>::value...>::value) {}
456459

457-
template <size_t... _Uf, class... _Tf, size_t... _Ul, class... _Tl, class... _Up>
458-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_impl(
459-
__index_sequence<_Uf...>,
460-
__tuple_types<_Tf...>,
461-
__index_sequence<_Ul...>,
462-
__tuple_types<_Tl...>,
463-
_Up&&... __u) noexcept(__all<is_nothrow_constructible<_Tf, _Up>::value...>::value &&
464-
__all<is_nothrow_default_constructible<_Tl>::value...>::value)
465-
: __tuple_leaf<_Uf, _Tf>(std::forward<_Up>(__u))..., __tuple_leaf<_Ul, _Tl>()... {}
466-
467-
template <class _Alloc, size_t... _Uf, class... _Tf, size_t... _Ul, class... _Tl, class... _Up>
460+
template <class... _Args>
461+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_impl(__forward_args, _Args&&... __args)
462+
: __tuple_leaf<_Indx, _Tp>(std::forward<_Args>(__args))... {}
463+
464+
template <class _Alloc>
465+
_LIBCPP_HIDE_FROM_ABI
466+
_LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_impl(allocator_arg_t, const _Alloc& __alloc, __value_init)
467+
: __tuple_leaf<_Indx, _Tp>(__uses_alloc_ctor<_Tp, _Alloc>(), __alloc)... {}
468+
469+
template <class _Alloc, class... _Args>
468470
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_impl(
469-
allocator_arg_t,
470-
const _Alloc& __a,
471-
__index_sequence<_Uf...>,
472-
__tuple_types<_Tf...>,
473-
__index_sequence<_Ul...>,
474-
__tuple_types<_Tl...>,
475-
_Up&&... __u)
476-
: __tuple_leaf<_Uf, _Tf>(__uses_alloc_ctor<_Tf, _Alloc, _Up>(), __a, std::forward<_Up>(__u))...,
477-
__tuple_leaf<_Ul, _Tl>(__uses_alloc_ctor<_Tl, _Alloc>(), __a)... {}
471+
allocator_arg_t, const _Alloc& __alloc, __forward_args, _Args&&... __args)
472+
: __tuple_leaf<_Indx, _Tp>(__uses_alloc_ctor<_Tp, _Alloc, _Args>(), __alloc, std::forward<_Args>(__args))... {}
478473

479474
template <class _Tuple, __enable_if_t<__tuple_constructible<_Tuple, tuple<_Tp...> >::value, int> = 0>
480475
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_impl(_Tuple&& __t) noexcept(
@@ -559,38 +554,23 @@ public:
559554
__enable_if_t< _And< _IsDefault<_Tp>... >::value, int> = 0>
560555
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, _IsImpDefault<_Tp>...> >::value)
561556
tuple(allocator_arg_t, _Alloc const& __a)
562-
: __base_(allocator_arg_t(),
563-
__a,
564-
__index_sequence<>(),
565-
__tuple_types<>(),
566-
__make_index_sequence<sizeof...(_Tp)>(),
567-
__tuple_types<_Tp...>()) {}
557+
: __base_(allocator_arg_t(), __a, __value_init{}) {}
568558

569559
// tuple(const T&...) constructors (including allocator_arg_t variants)
570560
template <template <class...> class _And = _And,
571561
__enable_if_t< _And< _BoolConstant<sizeof...(_Tp) >= 1>, is_copy_constructible<_Tp>... >::value, int> = 0>
572562
_LIBCPP_HIDE_FROM_ABI
573563
_LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<const _Tp&, _Tp>...> >::value)
574564
tuple(const _Tp&... __t) noexcept(_And<is_nothrow_copy_constructible<_Tp>...>::value)
575-
: __base_(__make_index_sequence<sizeof...(_Tp)>(),
576-
__tuple_types<_Tp...>(),
577-
__index_sequence<>(),
578-
__tuple_types<>(),
579-
__t...) {}
565+
: __base_(__forward_args{}, __t...) {}
580566

581567
template <class _Alloc,
582568
template <class...> class _And = _And,
583569
__enable_if_t< _And< _BoolConstant<sizeof...(_Tp) >= 1>, is_copy_constructible<_Tp>... >::value, int> = 0>
584570
_LIBCPP_HIDE_FROM_ABI
585571
_LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<const _Tp&, _Tp>...> >::value)
586572
tuple(allocator_arg_t, const _Alloc& __a, const _Tp&... __t)
587-
: __base_(allocator_arg_t(),
588-
__a,
589-
__make_index_sequence<sizeof...(_Tp)>(),
590-
__tuple_types<_Tp...>(),
591-
__index_sequence<>(),
592-
__tuple_types<>(),
593-
__t...) {}
573+
: __base_(allocator_arg_t(), __a, __forward_args{}, __t...) {}
594574

595575
// tuple(U&& ...) constructors (including allocator_arg_t variants)
596576
template <class... _Up>
@@ -609,25 +589,15 @@ public:
609589
int> = 0>
610590
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)
611591
tuple(_Up&&... __u) noexcept(_And<is_nothrow_constructible<_Tp, _Up>...>::value)
612-
: __base_(__make_index_sequence<sizeof...(_Up)>(),
613-
__tuple_types<_Tp...>(),
614-
__index_sequence<>(),
615-
__tuple_types<>(),
616-
std::forward<_Up>(__u)...) {}
592+
: __base_(__forward_args{}, std::forward<_Up>(__u)...) {}
617593

618594
template <class _Alloc,
619595
class... _Up,
620596
__enable_if_t< _And< _BoolConstant<sizeof...(_Up) == sizeof...(_Tp)>, _EnableUTypesCtor<_Up...> >::value,
621597
int> = 0>
622598
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value)
623599
tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u)
624-
: __base_(allocator_arg_t(),
625-
__a,
626-
__make_index_sequence<sizeof...(_Up)>(),
627-
__tuple_types<_Tp...>(),
628-
__index_sequence<>(),
629-
__tuple_types<>(),
630-
std::forward<_Up>(__u)...) {}
600+
: __base_(allocator_arg_t(), __a, __forward_args{}, std::forward<_Up>(__u)...) {}
631601

632602
// Copy and move constructors (including the allocator_arg_t variants)
633603
tuple(const tuple&) = default;

0 commit comments

Comments
 (0)