[cfe-commits] [libcxxabi] r132524 - in /libcxxabi/trunk: include/cxxabi.h src/cxa_aux_runtime.cpp src/cxa_virtual.cpp
Douglas Gregor
dgregor at apple.com
Thu Jun 2 19:16:15 PDT 2011
On Jun 2, 2011, at 7:04 PM, Marshall Clow wrote:
> Author: marshall
> Date: Thu Jun 2 21:04:41 2011
> New Revision: 132524
>
> URL: http://llvm.org/viewvc/llvm-project?rev=132524&view=rev
> Log:
> Added __cxa_bad_cast and __cxa_bad_typeid and placeholder NORETURN macro
Marshall, did someone pre-approve this commit?
LIBCXXABI_NORETURN should be trivial to implement correctly, given that we have an attribute for it. Why commit a placeholder when it's easier to do the right thing?
Also, any commit needs accompanying tests.
Please revert this.
- Doug
> Added:
> libcxxabi/trunk/src/cxa_aux_runtime.cpp
> Modified:
> libcxxabi/trunk/include/cxxabi.h
> libcxxabi/trunk/src/cxa_virtual.cpp
>
> Modified: libcxxabi/trunk/include/cxxabi.h
> URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/include/cxxabi.h?rev=132524&r1=132523&r2=132524&view=diff
> ==============================================================================
> --- libcxxabi/trunk/include/cxxabi.h (original)
> +++ libcxxabi/trunk/include/cxxabi.h Thu Jun 2 21:04:41 2011
> @@ -18,6 +18,8 @@
> #include <stddef.h>
> #include <stdint.h>
>
> +#define LIBCXXABI_NORETURN
> +
> namespace std {
> class type_info; // forward declaration
> }
> @@ -47,16 +49,16 @@
>
>
> // 2.6 Auxiliary Runtime APIs
> -extern void __cxa_bad_cast();
> -extern void __cxa_bad_typeid();
> +extern LIBCXXABI_NORETURN void __cxa_bad_cast(void);
> +extern LIBCXXABI_NORETURN void __cxa_bad_typeid(void);
>
>
>
> // 3.2.6 Pure Virtual Function API
> -extern void __cxa_pure_virtual(void);
> +extern LIBCXXABI_NORETURN void __cxa_pure_virtual(void);
>
> // 3.2.7 Deleted Virtual Function API
> -extern void __cxa_deleted_virtual(void);
> +extern LIBCXXABI_NORETURN void __cxa_deleted_virtual(void);
>
> // 3.3.2 One-time Construction API
> extern int __cxa_guard_acquire(uint64_t*);
>
> Added: libcxxabi/trunk/src/cxa_aux_runtime.cpp
> URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_aux_runtime.cpp?rev=132524&view=auto
> ==============================================================================
> --- libcxxabi/trunk/src/cxa_aux_runtime.cpp (added)
> +++ libcxxabi/trunk/src/cxa_aux_runtime.cpp Thu Jun 2 21:04:41 2011
> @@ -0,0 +1,34 @@
> +//===------------------------ cxa_aux_runtime.cpp -------------------------===//
> +//
> +// The LLVM Compiler Infrastructure
> +//
> +// This file is dual licensed under the MIT and the University of Illinois Open
> +// Source Licenses. See LICENSE.TXT for details.
> +//
> +//
> +// This file implements the "Auxiliary Runtime APIs"
> +// http://www.codesourcery.com/public/cxx-abi/abi-eh.html#cxx-aux
> +//===----------------------------------------------------------------------===//
> +
> +#include "cxxabi.h"
> +#include <typeinfo>
> +
> +namespace __cxxabiv1
> +{
> +
> +extern "C"
> +{
> +
> +LIBCXXABI_NORETURN
> +void __cxa_bad_cast (void) {
> + throw std::bad_cast();
> +}
> +
> +LIBCXXABI_NORETURN
> +void __cxa_bad_typeid(void) {
> + throw std::bad_typeid();
> +}
> +
> +} // extern "C"
> +
> +} // abi
>
> Modified: libcxxabi/trunk/src/cxa_virtual.cpp
> URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_virtual.cpp?rev=132524&r1=132523&r2=132524&view=diff
> ==============================================================================
> --- libcxxabi/trunk/src/cxa_virtual.cpp (original)
> +++ libcxxabi/trunk/src/cxa_virtual.cpp Thu Jun 2 21:04:41 2011
> @@ -18,11 +18,13 @@
> extern "C"
> {
>
> +LIBCXXABI_NORETURN
> void __cxa_pure_virtual(void) {
> fputs("Pure virtual function called!\n", stderr);
> abort();
> }
>
> +LIBCXXABI_NORETURN
> void __cxa_deleted_virtual(void) {
> fputs("Deleted virtual function called!\n", stderr);
> abort();
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list