diff options
author | Howard Hinnant <hhinnant@apple.com> | 2011-05-26 17:07:32 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2011-05-26 17:07:32 +0000 |
commit | 400b244339a577b4c48aca7f42a3f22f38fd3d17 (patch) | |
tree | d7b6ddada102da56ab3024e87870e8f964bb11fa /libcxx/include | |
parent | 6dc03b36d7a84106dc62e0a3b0e16148a8dc556a (diff) | |
download | bcm5719-llvm-400b244339a577b4c48aca7f42a3f22f38fd3d17.tar.gz bcm5719-llvm-400b244339a577b4c48aca7f42a3f22f38fd3d17.zip |
Added [[noreturn]] attribute everywhere it should be
llvm-svn: 132125
Diffstat (limited to 'libcxx/include')
-rw-r--r-- | libcxx/include/__config | 6 | ||||
-rw-r--r-- | libcxx/include/exception | 16 |
2 files changed, 13 insertions, 9 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config index ef03e62b05b..48f3a4403f0 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -116,8 +116,10 @@ typedef __char32_t char32_t; #define _LIBCPP_HAS_NO_DECLTYPE #endif -#if !(__has_feature(cxx_attributes)) -#define _LIBCPP_HAS_NO_ATTRIBUTES +#if __has_feature(cxx_attributes) +# define _ATTRIBUTE(x) [[x]] +#else +# define _ATTRIBUTE(x) __attribute__ ((x)) #endif #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS diff --git a/libcxx/include/exception b/libcxx/include/exception index 4871f41394a..87f6552acec 100644 --- a/libcxx/include/exception +++ b/libcxx/include/exception @@ -105,19 +105,19 @@ public: typedef void (*unexpected_handler)(); _LIBCPP_VISIBLE unexpected_handler set_unexpected(unexpected_handler) throw(); _LIBCPP_VISIBLE unexpected_handler get_unexpected() throw(); -_LIBCPP_VISIBLE void unexpected(); +_ATTRIBUTE(noreturn) _LIBCPP_VISIBLE void unexpected(); typedef void (*terminate_handler)(); _LIBCPP_VISIBLE terminate_handler set_terminate(terminate_handler) throw(); _LIBCPP_VISIBLE terminate_handler get_terminate() throw(); -_LIBCPP_VISIBLE void terminate() __attribute__((__noreturn__)); +_ATTRIBUTE(noreturn) _LIBCPP_VISIBLE void terminate() _NOEXCEPT; _LIBCPP_VISIBLE bool uncaught_exception() throw(); class exception_ptr; exception_ptr current_exception(); -void rethrow_exception(exception_ptr); // noreturn +_ATTRIBUTE(noreturn) void rethrow_exception(exception_ptr); class _LIBCPP_VISIBLE exception_ptr { @@ -141,7 +141,7 @@ public: {return !(__x == __y);} friend exception_ptr current_exception(); - friend void rethrow_exception(exception_ptr); // noreturn + _ATTRIBUTE(noreturn) friend void rethrow_exception(exception_ptr); }; template<class _E> @@ -172,7 +172,7 @@ public: virtual ~nested_exception(); // access functions - void rethrow_nested /*[[noreturn]]*/ () const; + _ATTRIBUTE(noreturn) void rethrow_nested() const; _LIBCPP_INLINE_VISIBILITY exception_ptr nested_ptr() const {return __ptr_;} }; @@ -185,9 +185,10 @@ struct __nested }; template <class _Tp> +_ATTRIBUTE(noreturn) void #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -throw_with_nested /*[[noreturn]]*/ (_Tp&& __t, typename enable_if< +throw_with_nested(_Tp&& __t, typename enable_if< is_class<typename remove_reference<_Tp>::type>::value && !is_base_of<nested_exception, typename remove_reference<_Tp>::type>::value >::type* = 0) @@ -203,9 +204,10 @@ throw_with_nested (_Tp& __t, typename enable_if< } template <class _Tp> +_ATTRIBUTE(noreturn) void #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -throw_with_nested /*[[noreturn]]*/ (_Tp&& __t, typename enable_if< +throw_with_nested(_Tp&& __t, typename enable_if< !is_class<typename remove_reference<_Tp>::type>::value || is_base_of<nested_exception, typename remove_reference<_Tp>::type>::value >::type* = 0) |