diff options
Diffstat (limited to 'contrib/llvm-project')
10 files changed, 39 insertions, 25 deletions
| diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h index 7ab63905ed4f..7d090ba682b3 100644 --- a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h +++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h @@ -78,6 +78,11 @@ public:    void AddHIPIncludeArgs(const llvm::opt::ArgList &DriverArgs,                           llvm::opt::ArgStringList &CC1Args) const override; +  bool IsAArch64OutlineAtomicsDefault( +      const llvm::opt::ArgList &Args) const override { +    return true; +  } +    UnwindTableLevel    getDefaultUnwindTableLevel(const llvm::opt::ArgList &Args) const override;    bool isPIEDefault(const llvm::opt::ArgList &Args) const override; diff --git a/contrib/llvm-project/libcxx/include/__functional/binary_function.h b/contrib/llvm-project/libcxx/include/__functional/binary_function.h index ddee3b170311..18879f65112b 100644 --- a/contrib/llvm-project/libcxx/include/__functional/binary_function.h +++ b/contrib/llvm-project/libcxx/include/__functional/binary_function.h @@ -39,11 +39,10 @@ struct __binary_function_keep_layout_base {  };  #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION) -_LIBCPP_DIAGNOSTIC_PUSH -_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations") +_LIBCPP_SUPPRESS_DEPRECATED_PUSH  template <class _Arg1, class _Arg2, class _Result>  using __binary_function = binary_function<_Arg1, _Arg2, _Result>; -_LIBCPP_DIAGNOSTIC_POP +_LIBCPP_SUPPRESS_DEPRECATED_POP  #else  template <class _Arg1, class _Arg2, class _Result>  using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>; diff --git a/contrib/llvm-project/libcxx/include/__functional/unary_function.h b/contrib/llvm-project/libcxx/include/__functional/unary_function.h index 69b1bc94220a..d46df2e86fbd 100644 --- a/contrib/llvm-project/libcxx/include/__functional/unary_function.h +++ b/contrib/llvm-project/libcxx/include/__functional/unary_function.h @@ -36,11 +36,10 @@ struct __unary_function_keep_layout_base {  };  #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION) -_LIBCPP_DIAGNOSTIC_PUSH -_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations") +_LIBCPP_SUPPRESS_DEPRECATED_PUSH  template <class _Arg, class _Result>  using __unary_function = unary_function<_Arg, _Result>; -_LIBCPP_DIAGNOSTIC_POP +_LIBCPP_SUPPRESS_DEPRECATED_POP  #else  template <class _Arg, class _Result>  using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>; diff --git a/contrib/llvm-project/libcxx/include/__functional/weak_result_type.h b/contrib/llvm-project/libcxx/include/__functional/weak_result_type.h index ad7a8395186c..488fec9dac21 100644 --- a/contrib/llvm-project/libcxx/include/__functional/weak_result_type.h +++ b/contrib/llvm-project/libcxx/include/__functional/weak_result_type.h @@ -77,6 +77,7 @@ struct __maybe_derive_from_unary_function // bool is true  template <class _Tp>  struct __maybe_derive_from_unary_function<_Tp, false> {}; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH  template <class _Tp, bool = __derives_from_binary_function<_Tp>::value>  struct __maybe_derive_from_binary_function // bool is true      : public __derives_from_binary_function<_Tp>::type {}; @@ -99,6 +100,7 @@ struct __weak_result_type_imp<_Tp, false>  template <class _Tp>  struct __weak_result_type : public __weak_result_type_imp<_Tp> {}; +_LIBCPP_SUPPRESS_DEPRECATED_POP  // 0 argument case diff --git a/contrib/llvm-project/libcxx/include/__memory/allocator_traits.h b/contrib/llvm-project/libcxx/include/__memory/allocator_traits.h index c5fcc89327b8..f3e327edda12 100644 --- a/contrib/llvm-project/libcxx/include/__memory/allocator_traits.h +++ b/contrib/llvm-project/libcxx/include/__memory/allocator_traits.h @@ -40,6 +40,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD    template <class _Tp>                                                                                                 \    struct NAME<_Tp, __void_t<typename _Tp::PROPERTY > > : true_type {} +_LIBCPP_SUPPRESS_DEPRECATED_PUSH  // __pointer  template <class _Tp,            class _Alloc, @@ -67,6 +68,7 @@ struct __const_pointer<_Tp, _Ptr, _Alloc, false> {    using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::template rebind<const _Tp>;  #endif  }; +_LIBCPP_SUPPRESS_DEPRECATED_POP  // __void_pointer  _LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_void_pointer, void_pointer); diff --git a/contrib/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h b/contrib/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h index 7475ef5cf85d..79cab80dcf73 100644 --- a/contrib/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h +++ b/contrib/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h @@ -642,7 +642,8 @@ __uninitialized_allocator_relocate(_Alloc& __alloc, _Tp* __first, _Tp* __last, _      __guard.__complete();      std::__allocator_destroy(__alloc, __first, __last);    } else { -    __builtin_memcpy(const_cast<__remove_const_t<_Tp>*>(__result), __first, sizeof(_Tp) * (__last - __first)); +    // Casting to void* to suppress clang complaining that this is technically UB. +    __builtin_memcpy(static_cast<void*>(const_cast<__remove_const_t<_Tp>*>(__result)), __first, sizeof(_Tp) * (__last - __first));    }  } diff --git a/contrib/llvm-project/libcxx/include/__type_traits/is_trivially_relocatable.h b/contrib/llvm-project/libcxx/include/__type_traits/is_trivially_relocatable.h index c0871731cc00..9b0e240de55f 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/is_trivially_relocatable.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/is_trivially_relocatable.h @@ -11,7 +11,6 @@  #include <__config>  #include <__type_traits/enable_if.h> -#include <__type_traits/integral_constant.h>  #include <__type_traits/is_same.h>  #include <__type_traits/is_trivially_copyable.h> @@ -23,8 +22,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD  // A type is trivially relocatable if a move construct + destroy of the original object is equivalent to  // `memcpy(dst, src, sizeof(T))`. - -#if __has_builtin(__is_trivially_relocatable) +// +// Note that we don't use the __is_trivially_relocatable Clang builtin right now because it does not +// implement the semantics of any current or future trivial relocation proposal and it can lead to +// incorrect optimizations on some platforms (Windows) and supported compilers (AppleClang). +#if __has_builtin(__is_trivially_relocatable) && 0  template <class _Tp, class = void>  struct __libcpp_is_trivially_relocatable : integral_constant<bool, __is_trivially_relocatable(_Tp)> {};  #else diff --git a/contrib/llvm-project/libcxx/include/tuple b/contrib/llvm-project/libcxx/include/tuple index 081b90c7bbec..1d39974d5a6b 100644 --- a/contrib/llvm-project/libcxx/include/tuple +++ b/contrib/llvm-project/libcxx/include/tuple @@ -302,7 +302,9 @@ class __tuple_leaf {    template <class _Tp>    static _LIBCPP_HIDE_FROM_ABI constexpr bool __can_bind_reference() { -#  if __has_keyword(__reference_binds_to_temporary) +#  if __has_keyword(__reference_constructs_from_temporary) +    return !__reference_constructs_from_temporary(_Hp, _Tp); +#  elif __has_keyword(__reference_binds_to_temporary)      return !__reference_binds_to_temporary(_Hp, _Tp);  #  else      return true; diff --git a/contrib/llvm-project/llvm/lib/ObjCopy/ELF/ELFObjcopy.cpp b/contrib/llvm-project/llvm/lib/ObjCopy/ELF/ELFObjcopy.cpp index 075455c03415..7de9b4dd2ea1 100644 --- a/contrib/llvm-project/llvm/lib/ObjCopy/ELF/ELFObjcopy.cpp +++ b/contrib/llvm-project/llvm/lib/ObjCopy/ELF/ELFObjcopy.cpp @@ -368,7 +368,7 @@ static Error updateAndRemoveSymbols(const CommonConfig &Config,    // (like GroupSection or RelocationSection). This way, we know which    // symbols are still 'needed' and which are not.    if (Config.StripUnneeded || !Config.UnneededSymbolsToRemove.empty() || -      !Config.OnlySection.empty()) { +      !Config.OnlySection.empty() || Config.DiscardMode != DiscardType::None) {      for (SectionBase &Sec : Obj.sections())        Sec.markSymbols();    } @@ -390,22 +390,23 @@ static Error updateAndRemoveSymbols(const CommonConfig &Config,      if (Config.StripDebug && Sym.Type == STT_FILE)        return true; -    if ((Config.DiscardMode == DiscardType::All || -         (Config.DiscardMode == DiscardType::Locals && -          StringRef(Sym.Name).starts_with(".L"))) && -        Sym.Binding == STB_LOCAL && Sym.getShndx() != SHN_UNDEF && -        Sym.Type != STT_FILE && Sym.Type != STT_SECTION) -      return true; -      if ((Config.StripUnneeded ||           Config.UnneededSymbolsToRemove.matches(Sym.Name)) &&          (!Obj.isRelocatable() || isUnneededSymbol(Sym)))        return true; -    // We want to remove undefined symbols if all references have been stripped. -    if (!Config.OnlySection.empty() && !Sym.Referenced && -        Sym.getShndx() == SHN_UNDEF) -      return true; +    if (!Sym.Referenced) { +      if ((Config.DiscardMode == DiscardType::All || +           (Config.DiscardMode == DiscardType::Locals && +            StringRef(Sym.Name).starts_with(".L"))) && +          Sym.Binding == STB_LOCAL && Sym.getShndx() != SHN_UNDEF && +          Sym.Type != STT_FILE && Sym.Type != STT_SECTION) +        return true; +      // We want to remove undefined symbols if all references have been +      // stripped. +      if (!Config.OnlySection.empty() && Sym.getShndx() == SHN_UNDEF) +        return true; +    }      return false;    }; diff --git a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCMergeStringPool.cpp b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCMergeStringPool.cpp index 309938accdf4..daf6a0e65d54 100644 --- a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCMergeStringPool.cpp +++ b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCMergeStringPool.cpp @@ -170,8 +170,9 @@ void PPCMergeStringPool::collectCandidateConstants(Module &M) {      LLVM_DEBUG(dbgs() << "hasInitializer() " << Global.hasInitializer()                        << "\n"); -    // We can only pool constants. -    if (!Global.isConstant() || !Global.hasInitializer()) +    // We can only pool non-thread-local constants. +    if (!Global.isConstant() || !Global.hasInitializer() || +        Global.isThreadLocal())        continue;      // If a global constant has a section we do not try to pool it because | 
