diff --git a/libcudacxx/include/cuda/std/__functional/function.h b/libcudacxx/include/cuda/std/__functional/function.h index 719bdcbd23e..7150b98c6e9 100644 --- a/libcudacxx/include/cuda/std/__functional/function.h +++ b/libcudacxx/include/cuda/std/__functional/function.h @@ -920,21 +920,13 @@ class __func<_Rp1 (^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)> : public __base public: _LIBCUDACXX_HIDE_FROM_ABI explicit __func(__block_type const& __f) -# ifdef _LIBCUDACXX_HAS_OBJC_ARC - : __f_(__f) -# else : __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr)) -# endif {} // [TODO] add && to save on a retain _LIBCUDACXX_HIDE_FROM_ABI explicit __func(__block_type __f, const _Alloc& /* unused */) -# ifdef _LIBCUDACXX_HAS_OBJC_ARC - : __f_(__f) -# else : __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr)) -# endif {} virtual __base<_Rp(_ArgTypes...)>* __clone() const @@ -953,12 +945,10 @@ class __func<_Rp1 (^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)> : public __base virtual void destroy() noexcept { -# ifndef _LIBCUDACXX_HAS_OBJC_ARC if (__f_) { _Block_release(__f_); } -# endif __f_ = 0; } diff --git a/libcudacxx/include/cuda/std/__memory/addressof.h b/libcudacxx/include/cuda/std/__memory/addressof.h index 2bc4617e00c..b36b166e1e4 100644 --- a/libcudacxx/include/cuda/std/__memory/addressof.h +++ b/libcudacxx/include/cuda/std/__memory/addressof.h @@ -43,38 +43,6 @@ _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_NO_CFI _Tp* addressof(_Tp& __x) noexcept #endif // defined(_LIBCUDACXX_ADDRESSOF) -#if defined(_LIBCUDACXX_HAS_OBJC_ARC) && !defined(_LIBCUDACXX_PREDEFINED_OBJC_ARC_ADDRESSOF) -// Objective-C++ Automatic Reference Counting uses qualified pointers -// that require special addressof() signatures. When -// _LIBCUDACXX_PREDEFINED_OBJC_ARC_ADDRESSOF is defined, the compiler -// itself is providing these definitions. Otherwise, we provide them. -template -_LIBCUDACXX_HIDE_FROM_ABI __strong _Tp* addressof(__strong _Tp& __x) noexcept -{ - return &__x; -} - -# ifdef _LIBCUDACXX_HAS_OBJC_ARC_WEAK -template -_LIBCUDACXX_HIDE_FROM_ABI __weak _Tp* addressof(__weak _Tp& __x) noexcept -{ - return &__x; -} -# endif - -template -_LIBCUDACXX_HIDE_FROM_ABI __autoreleasing _Tp* addressof(__autoreleasing _Tp& __x) noexcept -{ - return &__x; -} - -template -_LIBCUDACXX_HIDE_FROM_ABI __unsafe_unretained _Tp* addressof(__unsafe_unretained _Tp& __x) noexcept -{ - return &__x; -} -#endif - template _Tp* addressof(const _Tp&&) noexcept = delete; diff --git a/libcudacxx/include/cuda/std/__type_traits/is_pointer.h b/libcudacxx/include/cuda/std/__type_traits/is_pointer.h index 6b7ad1810ad..b71fb357926 100644 --- a/libcudacxx/include/cuda/std/__type_traits/is_pointer.h +++ b/libcudacxx/include/cuda/std/__type_traits/is_pointer.h @@ -46,36 +46,7 @@ struct __libcpp_is_pointer<_Tp*> : public true_type {}; template -struct __libcpp_remove_objc_qualifiers -{ - typedef _Tp type; -}; -# if defined(_LIBCUDACXX_HAS_OBJC_ARC) -template -struct __libcpp_remove_objc_qualifiers<_Tp __strong> -{ - typedef _Tp type; -}; -template -struct __libcpp_remove_objc_qualifiers<_Tp __weak> -{ - typedef _Tp type; -}; -template -struct __libcpp_remove_objc_qualifiers<_Tp __autoreleasing> -{ - typedef _Tp type; -}; -template -struct __libcpp_remove_objc_qualifiers<_Tp __unsafe_unretained> -{ - typedef _Tp type; -}; -# endif - -template -struct _CCCL_TYPE_VISIBILITY_DEFAULT is_pointer - : public __libcpp_is_pointer>::type> +struct _CCCL_TYPE_VISIBILITY_DEFAULT is_pointer : public __libcpp_is_pointer<__remove_cv_t<_Tp>> {}; # if _CCCL_STD_VER > 2011 && !defined(_LIBCUDACXX_HAS_NO_VARIABLE_TEMPLATES) diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/__config b/libcudacxx/include/cuda/std/detail/libcxx/include/__config index 100fd4be8a5..69d7fec9cf0 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/__config +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/__config @@ -733,15 +733,6 @@ typedef __char32_t char32_t; # define _LIBCUDACXX_HAS_NO_GENERALIZED_INITIALIZERS # endif -// Objective-C++ features (opt-in) -# if __has_feature(objc_arc) -# define _LIBCUDACXX_HAS_OBJC_ARC -# endif - -# if __has_feature(objc_arc_weak) -# define _LIBCUDACXX_HAS_OBJC_ARC_WEAK -# endif - # if !(__has_feature(cxx_variable_templates)) # define _LIBCUDACXX_HAS_NO_VARIABLE_TEMPLATES # endif diff --git a/libcudacxx/test/libcudacxx/libcxx/type_traits/is_pointer.arc.pass.mm b/libcudacxx/test/libcudacxx/libcxx/type_traits/is_pointer.arc.pass.mm deleted file mode 100644 index 16b514d1582..00000000000 --- a/libcudacxx/test/libcudacxx/libcxx/type_traits/is_pointer.arc.pass.mm +++ /dev/null @@ -1,65 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03 - -// - -// std::is_pointer - -// Test that we correctly handle Objective-C++ ARC qualifiers on pointers. - -#include - -template -void test_is_pointer() -{ - static_assert(std::is_pointer::value, ""); - - static_assert(std::is_pointer::value, ""); - static_assert(std::is_pointer::value, ""); - static_assert(std::is_pointer::value, ""); - static_assert(std::is_pointer::value, ""); - - static_assert(std::is_pointer::value, ""); - static_assert(std::is_pointer::value, ""); - static_assert(std::is_pointer::value, ""); - static_assert(std::is_pointer::value, ""); - - static_assert(std::is_pointer::value, ""); - static_assert(std::is_pointer::value, ""); - static_assert(std::is_pointer::value, ""); - static_assert(std::is_pointer::value, ""); - - static_assert(std::is_pointer::value, ""); - static_assert(std::is_pointer::value, ""); - static_assert(std::is_pointer::value, ""); - static_assert(std::is_pointer::value, ""); -} - -@class Foo; - -int main(int, char**) -{ - test_is_pointer(); - test_is_pointer(); - test_is_pointer(); - test_is_pointer(); - - test_is_pointer(); - test_is_pointer(); - test_is_pointer(); - test_is_pointer(); - - test_is_pointer(); - test_is_pointer(); - test_is_pointer(); - test_is_pointer(); - - return 0; -} diff --git a/libcudacxx/test/utils/libcudacxx/test/config.py b/libcudacxx/test/utils/libcudacxx/test/config.py index 8d4d635866e..b4366d10791 100644 --- a/libcudacxx/test/utils/libcudacxx/test/config.py +++ b/libcudacxx/test/utils/libcudacxx/test/config.py @@ -636,12 +636,6 @@ def configure_features(self): self.config.available_features.add('libcudacxx_gdb') self.cxx.libcudacxx_gdb = libcudacxx_gdb - # Support Objective-C++ only on MacOS and if the compiler supports it. - if self.target_info.platform() == "darwin" and \ - self.target_info.is_host_macosx() and \ - self.cxx.hasCompileFlag(["-x", "objective-c++", "-fobjc-arc"]): - self.config.available_features.add("objective-c++") - def configure_compile_flags(self): self.configure_default_compile_flags() # Configure extra flags diff --git a/libcudacxx/test/utils/libcudacxx/test/format.py b/libcudacxx/test/utils/libcudacxx/test/format.py index 3a584479895..3419702fe10 100644 --- a/libcudacxx/test/utils/libcudacxx/test/format.py +++ b/libcudacxx/test/utils/libcudacxx/test/format.py @@ -95,9 +95,6 @@ def _execute(self, test, lit_config): is_pass_test = name.endswith('.pass.cpp') or name.endswith('.pass.mm') is_fail_test = name.endswith('.fail.cpp') or name.endswith('.fail.mm') is_runfail_test = name.endswith('.runfail.cpp') or name.endswith('.runfail.mm') - is_objcxx_test = name.endswith('.mm') - is_objcxx_arc_test = name.endswith('.arc.pass.mm') or \ - name.endswith('.arc.fail.mm') assert is_sh_test or name_ext == '.cpp' or name_ext == '.mm', \ 'non-cpp file must be sh test' @@ -105,10 +102,6 @@ def _execute(self, test, lit_config): return (lit.Test.UNSUPPORTED, "A lit.local.cfg marked this unsupported") - if is_objcxx_test and not \ - 'objective-c++' in test.config.available_features: - return (lit.Test.UNSUPPORTED, "Objective-C++ is not supported") - parsers = self._make_custom_parsers() script = lit.TestRunner.parseIntegratedTestScript( test, additional_parsers=parsers, require_script=is_sh_test) @@ -150,14 +143,6 @@ def _execute(self, test, lit_config): if b'#define _LIBCUDACXX_ASSERT' in contents: test_cxx.useModules(False) - if is_objcxx_test: - test_cxx.source_lang = 'objective-c++' - if is_objcxx_arc_test: - test_cxx.compile_flags += ['-fobjc-arc'] - else: - test_cxx.compile_flags += ['-fno-objc-arc'] - test_cxx.link_flags += ['-framework', 'Foundation'] - # Dispatch the test based on its suffix. if is_sh_test: if not isinstance(self.executor, LocalExecutor):