[cfe-commits] [libcxx] r160773 - in /libcxx/trunk: include/__config include/exception src/exception.cpp
Richard Smith
richard-llvm at metafoo.co.uk
Wed Jul 25 19:04:22 PDT 2012
Author: rsmith
Date: Wed Jul 25 21:04:22 2012
New Revision: 160773
URL: http://llvm.org/viewvc/llvm-project?rev=160773&view=rev
Log:
libc++: switch from using _ATTRIBUTE(noreturn) (which conflicts with a
platform-provided macro on some systems) to _LIBCPP_NORETURN.
Modified:
libcxx/trunk/include/__config
libcxx/trunk/include/exception
libcxx/trunk/src/exception.cpp
Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=160773&r1=160772&r2=160773&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Wed Jul 25 21:04:22 2012
@@ -182,9 +182,9 @@
#endif
#if __has_feature(cxx_attributes)
-# define _ATTRIBUTE(x) [[x]]
+# define _LIBCPP_NORETURN [[noreturn]]
#else
-# define _ATTRIBUTE(x) __attribute__ ((x))
+# define _LIBCPP_NORETURN __attribute__ ((noreturn))
#endif
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
@@ -277,7 +277,7 @@
#define _ALIGNAS(x) __attribute__((__aligned__(x)))
-#define _ATTRIBUTE(x) __attribute__((x))
+#define _LIBCPP_NORETURN __attribute__((noreturn))
#if !__EXCEPTIONS
#define _LIBCPP_NO_EXCEPTIONS
@@ -349,7 +349,7 @@
#define _LIBCPP_HAS_NO_UNICODE_CHARS
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
#define __alignof__ __alignof
-#define _ATTRIBUTE __declspec
+#define _LIBCPP_NORETURN __declspec(noreturn)
#define _ALIGNAS(x) __declspec(align(x))
#define _LIBCPP_HAS_NO_VARIADICS
Modified: libcxx/trunk/include/exception
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/exception?rev=160773&r1=160772&r2=160773&view=diff
==============================================================================
--- libcxx/trunk/include/exception (original)
+++ libcxx/trunk/include/exception Wed Jul 25 21:04:22 2012
@@ -107,19 +107,19 @@
typedef void (*unexpected_handler)();
_LIBCPP_VISIBLE unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
_LIBCPP_VISIBLE unexpected_handler get_unexpected() _NOEXCEPT;
-_ATTRIBUTE(noreturn) _LIBCPP_VISIBLE void unexpected();
+_LIBCPP_NORETURN _LIBCPP_VISIBLE void unexpected();
typedef void (*terminate_handler)();
_LIBCPP_VISIBLE terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
_LIBCPP_VISIBLE terminate_handler get_terminate() _NOEXCEPT;
-_ATTRIBUTE(noreturn) _LIBCPP_VISIBLE void terminate() _NOEXCEPT;
+_LIBCPP_NORETURN _LIBCPP_VISIBLE void terminate() _NOEXCEPT;
_LIBCPP_VISIBLE bool uncaught_exception() _NOEXCEPT;
class exception_ptr;
exception_ptr current_exception() _NOEXCEPT;
-_ATTRIBUTE(noreturn) void rethrow_exception(exception_ptr);
+_LIBCPP_NORETURN void rethrow_exception(exception_ptr);
class _LIBCPP_VISIBLE exception_ptr
{
@@ -143,7 +143,7 @@
{return !(__x == __y);}
friend exception_ptr current_exception() _NOEXCEPT;
- _ATTRIBUTE(noreturn) friend void rethrow_exception(exception_ptr);
+ _LIBCPP_NORETURN friend void rethrow_exception(exception_ptr);
};
template<class _Ep>
@@ -174,7 +174,7 @@
virtual ~nested_exception() _NOEXCEPT;
// access functions
- _ATTRIBUTE(noreturn) void rethrow_nested() const;
+ _LIBCPP_NORETURN void rethrow_nested() const;
_LIBCPP_INLINE_VISIBILITY exception_ptr nested_ptr() const _NOEXCEPT {return __ptr_;}
};
@@ -187,7 +187,7 @@
};
template <class _Tp>
-_ATTRIBUTE(noreturn)
+_LIBCPP_NORETURN
void
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
throw_with_nested(_Tp&& __t, typename enable_if<
@@ -206,7 +206,7 @@
}
template <class _Tp>
-_ATTRIBUTE(noreturn)
+_LIBCPP_NORETURN
void
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
throw_with_nested(_Tp&& __t, typename enable_if<
Modified: libcxx/trunk/src/exception.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/exception.cpp?rev=160773&r1=160772&r2=160773&view=diff
==============================================================================
--- libcxx/trunk/src/exception.cpp (original)
+++ libcxx/trunk/src/exception.cpp Wed Jul 25 21:04:22 2012
@@ -56,7 +56,7 @@
return __sync_fetch_and_add(&__unexpected_handler, (unexpected_handler)0);
}
-_ATTRIBUTE(noreturn)
+_LIBCPP_NORETURN
void
unexpected()
{
@@ -77,7 +77,7 @@
return __sync_fetch_and_add(&__terminate_handler, (terminate_handler)0);
}
-_ATTRIBUTE(noreturn)
+_LIBCPP_NORETURN
void
terminate() _NOEXCEPT
{
@@ -184,7 +184,7 @@
{
}
-_ATTRIBUTE(noreturn)
+_LIBCPP_NORETURN
void
nested_exception::rethrow_nested() const
{
@@ -209,7 +209,7 @@
#endif // __APPLE__
}
-_ATTRIBUTE(noreturn)
+_LIBCPP_NORETURN
void rethrow_exception(exception_ptr p)
{
#if HAVE_DEPENDENT_EH_ABI
More information about the cfe-commits
mailing list