Author: compnerd Date: Thu Dec 3 20:14:41 2015 New Revision: 254690 URL: http://llvm.org/viewvc/llvm-project?rev=254690&view=rev Log: c++abi: whitespace adjustment
Cleanup some code with clang-format to make the following change easier to identify material difference. NFC. Modified: libcxxabi/trunk/include/__cxxabi_config.h libcxxabi/trunk/include/cxxabi.h libcxxabi/trunk/src/cxa_aux_runtime.cpp libcxxabi/trunk/src/cxa_demangle.cpp libcxxabi/trunk/src/cxa_exception.cpp libcxxabi/trunk/src/cxa_guard.cpp libcxxabi/trunk/src/cxa_thread_atexit.cpp libcxxabi/trunk/src/cxa_vector.cpp libcxxabi/trunk/src/cxa_virtual.cpp libcxxabi/trunk/src/private_typeinfo.h Modified: libcxxabi/trunk/include/__cxxabi_config.h URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/include/__cxxabi_config.h?rev=254690&r1=254689&r2=254690&view=diff ============================================================================== --- libcxxabi/trunk/include/__cxxabi_config.h (original) +++ libcxxabi/trunk/include/__cxxabi_config.h Thu Dec 3 20:14:41 2015 @@ -10,7 +10,7 @@ #ifndef ____CXXABI_CONFIG_H #define ____CXXABI_CONFIG_H -#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \ +#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \ !defined(__ARM_DWARF_EH__) #define LIBCXXABI_ARM_EHABI 1 #else Modified: libcxxabi/trunk/include/cxxabi.h URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/include/cxxabi.h?rev=254690&r1=254689&r2=254690&view=diff ============================================================================== --- libcxxabi/trunk/include/cxxabi.h (original) +++ libcxxabi/trunk/include/cxxabi.h Thu Dec 3 20:14:41 2015 @@ -35,35 +35,32 @@ namespace __cxxabiv1 { extern "C" { // 2.4.2 Allocating the Exception Object -extern void * __cxa_allocate_exception(size_t thrown_size) throw(); -extern void __cxa_free_exception(void * thrown_exception) throw(); +extern void *__cxa_allocate_exception(size_t thrown_size) throw(); +extern void __cxa_free_exception(void *thrown_exception) throw(); // 2.4.3 Throwing the Exception Object -extern LIBCXXABI_NORETURN void __cxa_throw(void * thrown_exception, - std::type_info * tinfo, void (*dest)(void *)); +extern LIBCXXABI_NORETURN void __cxa_throw(void *thrown_exception, + std::type_info *tinfo, + void (*dest)(void *)); // 2.5.3 Exception Handlers -extern void * __cxa_get_exception_ptr(void * exceptionObject) throw(); -extern void * __cxa_begin_catch(void * exceptionObject) throw(); +extern void *__cxa_get_exception_ptr(void *exceptionObject) throw(); +extern void *__cxa_begin_catch(void *exceptionObject) throw(); extern void __cxa_end_catch(); #if LIBCXXABI_ARM_EHABI -extern bool __cxa_begin_cleanup(void * exceptionObject) throw(); +extern bool __cxa_begin_cleanup(void *exceptionObject) throw(); extern void __cxa_end_cleanup(); #endif -extern std::type_info * __cxa_current_exception_type(); +extern std::type_info *__cxa_current_exception_type(); // 2.5.4 Rethrowing Exceptions extern LIBCXXABI_NORETURN void __cxa_rethrow(); - - // 2.6 Auxiliary Runtime APIs extern LIBCXXABI_NORETURN void __cxa_bad_cast(void); extern LIBCXXABI_NORETURN void __cxa_bad_typeid(void); extern LIBCXXABI_NORETURN void __cxa_throw_bad_array_new_length(void); - - // 3.2.6 Pure Virtual Function API extern LIBCXXABI_NORETURN void __cxa_pure_virtual(void); @@ -72,98 +69,74 @@ extern LIBCXXABI_NORETURN void __cxa_del // 3.3.2 One-time Construction API #ifdef __arm__ -extern int __cxa_guard_acquire(uint32_t*); -extern void __cxa_guard_release(uint32_t*); -extern void __cxa_guard_abort(uint32_t*); +extern int __cxa_guard_acquire(uint32_t *); +extern void __cxa_guard_release(uint32_t *); +extern void __cxa_guard_abort(uint32_t *); #else -extern int __cxa_guard_acquire(uint64_t*); -extern void __cxa_guard_release(uint64_t*); -extern void __cxa_guard_abort(uint64_t*); +extern int __cxa_guard_acquire(uint64_t *); +extern void __cxa_guard_release(uint64_t *); +extern void __cxa_guard_abort(uint64_t *); #endif // 3.3.3 Array Construction and Destruction API -extern void* __cxa_vec_new(size_t element_count, - size_t element_size, - size_t padding_size, - void (*constructor)(void*), - void (*destructor)(void*)); - -extern void* __cxa_vec_new2(size_t element_count, - size_t element_size, - size_t padding_size, - void (*constructor)(void*), - void (*destructor)(void*), - void* (*alloc)(size_t), - void (*dealloc)(void*)); - -extern void* __cxa_vec_new3(size_t element_count, - size_t element_size, - size_t padding_size, - void (*constructor)(void*), - void (*destructor)(void*), - void* (*alloc)(size_t), - void (*dealloc)(void*, size_t)); - -extern void __cxa_vec_ctor(void* array_address, - size_t element_count, - size_t element_size, - void (*constructor)(void*), - void (*destructor)(void*)); - -extern void __cxa_vec_dtor(void* array_address, - size_t element_count, - size_t element_size, - void (*destructor)(void*)); - -extern void __cxa_vec_cleanup(void* array_address, - size_t element_count, - size_t element_size, - void (*destructor)(void*)); - -extern void __cxa_vec_delete(void* array_address, - size_t element_size, - size_t padding_size, - void (*destructor)(void*)); - -extern void __cxa_vec_delete2(void* array_address, - size_t element_size, - size_t padding_size, - void (*destructor)(void*), - void (*dealloc)(void*)); - -extern void __cxa_vec_delete3(void* __array_address, - size_t element_size, - size_t padding_size, - void (*destructor)(void*), - void (*dealloc)(void*, size_t)); - -extern void __cxa_vec_cctor(void* dest_array, - void* src_array, - size_t element_count, - size_t element_size, - void (*constructor)(void*, void*), - void (*destructor)(void*)); +extern void *__cxa_vec_new(size_t element_count, size_t element_size, + size_t padding_size, void (*constructor)(void *), + void (*destructor)(void *)); + +extern void *__cxa_vec_new2(size_t element_count, size_t element_size, + size_t padding_size, void (*constructor)(void *), + void (*destructor)(void *), void *(*alloc)(size_t), + void (*dealloc)(void *)); + +extern void *__cxa_vec_new3(size_t element_count, size_t element_size, + size_t padding_size, void (*constructor)(void *), + void (*destructor)(void *), void *(*alloc)(size_t), + void (*dealloc)(void *, size_t)); + +extern void __cxa_vec_ctor(void *array_address, size_t element_count, + size_t element_size, void (*constructor)(void *), + void (*destructor)(void *)); + +extern void __cxa_vec_dtor(void *array_address, size_t element_count, + size_t element_size, void (*destructor)(void *)); + +extern void __cxa_vec_cleanup(void *array_address, size_t element_count, + size_t element_size, void (*destructor)(void *)); + +extern void __cxa_vec_delete(void *array_address, size_t element_size, + size_t padding_size, void (*destructor)(void *)); + +extern void __cxa_vec_delete2(void *array_address, size_t element_size, + size_t padding_size, void (*destructor)(void *), + void (*dealloc)(void *)); + +extern void __cxa_vec_delete3(void *__array_address, size_t element_size, + size_t padding_size, void (*destructor)(void *), + void (*dealloc)(void *, size_t)); + +extern void __cxa_vec_cctor(void *dest_array, void *src_array, + size_t element_count, size_t element_size, + void (*constructor)(void *, void *), + void (*destructor)(void *)); // 3.3.5.3 Runtime API -extern int __cxa_atexit(void (*f)(void*), void* p, void* d); -extern int __cxa_finalize(void*); +extern int __cxa_atexit(void (*f)(void *), void *p, void *d); +extern int __cxa_finalize(void *); // 3.4 Demangler API -extern char* __cxa_demangle(const char* mangled_name, - char* output_buffer, - size_t* length, - int* status); +extern char *__cxa_demangle(const char *mangled_name, char *output_buffer, + size_t *length, int *status); // Apple additions to support C++ 0x exception_ptr class // These are primitives to wrap a smart pointer around an exception object -extern void * __cxa_current_primary_exception() throw(); -extern void __cxa_rethrow_primary_exception(void* primary_exception); -extern void __cxa_increment_exception_refcount(void* primary_exception) throw(); -extern void __cxa_decrement_exception_refcount(void* primary_exception) throw(); +extern void *__cxa_current_primary_exception() throw(); +extern void __cxa_rethrow_primary_exception(void *primary_exception); +extern void __cxa_increment_exception_refcount(void *primary_exception) throw(); +extern void __cxa_decrement_exception_refcount(void *primary_exception) throw(); // Apple extension to support std::uncaught_exception() -extern bool __cxa_uncaught_exception () throw(); -extern unsigned int __cxa_uncaught_exceptions() throw(); +extern bool __cxa_uncaught_exception() throw(); +extern unsigned int __cxa_uncaught_exceptions() throw(); #ifdef __linux__ // Linux TLS support. Not yet an official part of the Itanium ABI. @@ -171,7 +144,7 @@ extern unsigned int __cxa_uncaught_exce extern int __cxa_thread_atexit(void (*)(void *), void *, void *) throw(); #endif - } // extern "C" +} // extern "C" } // namespace __cxxabiv1 namespace abi = __cxxabiv1; Modified: libcxxabi/trunk/src/cxa_aux_runtime.cpp URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_aux_runtime.cpp?rev=254690&r1=254689&r2=254690&view=diff ============================================================================== --- libcxxabi/trunk/src/cxa_aux_runtime.cpp (original) +++ libcxxabi/trunk/src/cxa_aux_runtime.cpp Thu Dec 3 20:14:41 2015 @@ -14,26 +14,17 @@ #include <new> #include <typeinfo> -namespace __cxxabiv1 -{ - -extern "C" -{ - +namespace __cxxabiv1 { +extern "C" { LIBCXXABI_NORETURN -void __cxa_bad_cast (void) { - throw std::bad_cast(); -} +void __cxa_bad_cast(void) { throw std::bad_cast(); } LIBCXXABI_NORETURN -void __cxa_bad_typeid(void) { - throw std::bad_typeid(); -} +void __cxa_bad_typeid(void) { throw std::bad_typeid(); } LIBCXXABI_NORETURN void __cxa_throw_bad_array_new_length(void) { - throw std::bad_array_new_length(); + throw std::bad_array_new_length(); } -} // extern "C" - -} // abi +} // extern "C" +} // abi Modified: libcxxabi/trunk/src/cxa_demangle.cpp URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp?rev=254690&r1=254689&r2=254690&view=diff ============================================================================== --- libcxxabi/trunk/src/cxa_demangle.cpp (original) +++ libcxxabi/trunk/src/cxa_demangle.cpp Thu Dec 3 20:14:41 2015 @@ -4922,11 +4922,8 @@ struct Db } // unnamed namespace -extern "C" -__attribute__ ((__visibility__("default"))) -char* -__cxa_demangle(const char* mangled_name, char* buf, size_t* n, int* status) -{ +extern "C" __attribute__((__visibility__("default"))) char * +__cxa_demangle(const char *mangled_name, char *buf, size_t *n, int *status) { if (mangled_name == nullptr || (buf != nullptr && n == nullptr)) { if (status) Modified: libcxxabi/trunk/src/cxa_exception.cpp URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_exception.cpp?rev=254690&r1=254689&r2=254690&view=diff ============================================================================== --- libcxxabi/trunk/src/cxa_exception.cpp (original) +++ libcxxabi/trunk/src/cxa_exception.cpp Thu Dec 3 20:14:41 2015 @@ -156,7 +156,7 @@ extern "C" { // object. Zero-fill the object. If memory can't be allocated, call // std::terminate. Return a pointer to the memory to be used for the // user's exception object. -void * __cxa_allocate_exception (size_t thrown_size) throw() { +void *__cxa_allocate_exception(size_t thrown_size) throw() { size_t actual_size = cxa_exception_size_from_exception_thrown_size(thrown_size); __cxa_exception* exception_header = static_cast<__cxa_exception*>(do_malloc(actual_size)); if (NULL == exception_header) @@ -167,7 +167,7 @@ void * __cxa_allocate_exception (size_t // Free a __cxa_exception object allocated with __cxa_allocate_exception. -void __cxa_free_exception (void * thrown_object) throw() { +void __cxa_free_exception(void *thrown_object) throw() { do_free(cxa_exception_from_thrown_object(thrown_object)); } @@ -219,9 +219,8 @@ will call terminate, assuming that there exception. */ LIBCXXABI_NORETURN -void -__cxa_throw(void* thrown_object, std::type_info* tinfo, void (*dest)(void*)) -{ +void __cxa_throw(void *thrown_object, std::type_info *tinfo, + void (*dest)(void *)) { __cxa_eh_globals *globals = __cxa_get_globals(); __cxa_exception* exception_header = cxa_exception_from_thrown_object(thrown_object); @@ -253,9 +252,7 @@ The adjusted pointer is computed by the Requires: exception is native */ -void* -__cxa_get_exception_ptr(void* unwind_exception) throw() -{ +void *__cxa_get_exception_ptr(void *unwind_exception) throw() { #if LIBCXXABI_ARM_EHABI return reinterpret_cast<void*>( static_cast<_Unwind_Control_Block*>(unwind_exception)->barrier_cache.bitpattern[0]); @@ -270,9 +267,7 @@ __cxa_get_exception_ptr(void* unwind_exc The routine to be called before the cleanup. This will save __cxa_exception in __cxa_eh_globals, so that __cxa_end_cleanup() can recover later. */ -bool -__cxa_begin_cleanup(void* unwind_arg) throw () -{ +bool __cxa_begin_cleanup(void *unwind_arg) throw() { _Unwind_Exception* unwind_exception = static_cast<_Unwind_Exception*>(unwind_arg); __cxa_eh_globals* globals = __cxa_get_globals(); __cxa_exception* exception_header = @@ -443,8 +438,7 @@ For a foreign exception: * If it has been rethrown, there is nothing to do. * Otherwise delete the exception and pop the catch stack to empty. */ -void __cxa_end_catch() -{ +void __cxa_end_catch() { static_assert(sizeof(__cxa_exception) == sizeof(__cxa_dependent_exception), "sizeof(__cxa_exception) must be equal to " "sizeof(__cxa_dependent_exception)"); @@ -521,7 +515,7 @@ void __cxa_end_catch() // Note: exception_header may be masquerading as a __cxa_dependent_exception // and that's ok. exceptionType is there too. // However watch out for foreign exceptions. Return null for them. -std::type_info * __cxa_current_exception_type() { +std::type_info *__cxa_current_exception_type() { // get the current exception __cxa_eh_globals *globals = __cxa_get_globals_fast(); if (NULL == globals) @@ -547,9 +541,7 @@ If the exception is native: and that's ok. */ LIBCXXABI_NORETURN -void -__cxa_rethrow() -{ +void __cxa_rethrow() { __cxa_eh_globals* globals = __cxa_get_globals(); __cxa_exception* exception_header = globals->caughtExceptions; if (NULL == exception_header) @@ -594,9 +586,7 @@ __cxa_rethrow() Requires: If thrown_object is not NULL, it is a native exception. */ -void -__cxa_increment_exception_refcount(void* thrown_object) throw() -{ +void __cxa_increment_exception_refcount(void *thrown_object) throw() { if (thrown_object != NULL ) { __cxa_exception* exception_header = cxa_exception_from_thrown_object(thrown_object); @@ -612,9 +602,7 @@ __cxa_increment_exception_refcount(void* Requires: If thrown_object is not NULL, it is a native exception. */ -void -__cxa_decrement_exception_refcount(void* thrown_object) throw() -{ +void __cxa_decrement_exception_refcount(void *thrown_object) throw() { if (thrown_object != NULL ) { __cxa_exception* exception_header = cxa_exception_from_thrown_object(thrown_object); @@ -637,9 +625,7 @@ __cxa_decrement_exception_refcount(void* been no exceptions thrown, ever, on this thread, we can return NULL without the need to allocate the exception-handling globals. */ -void* -__cxa_current_primary_exception() throw() -{ +void *__cxa_current_primary_exception() throw() { // get the current exception __cxa_eh_globals* globals = __cxa_get_globals_fast(); if (NULL == globals) Modified: libcxxabi/trunk/src/cxa_guard.cpp URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_guard.cpp?rev=254690&r1=254689&r2=254690&view=diff ============================================================================== --- libcxxabi/trunk/src/cxa_guard.cpp (original) +++ libcxxabi/trunk/src/cxa_guard.cpp Thu Dec 3 20:14:41 2015 @@ -167,26 +167,22 @@ extern "C" { #if LIBCXXABI_HAS_NO_THREADS -int __cxa_guard_acquire(guard_type* guard_object) -{ +int __cxa_guard_acquire(guard_type *guard_object) { return !is_initialized(guard_object); } -void __cxa_guard_release(guard_type* guard_object) -{ +void __cxa_guard_release(guard_type *guard_object) { *guard_object = 0; set_initialized(guard_object); } -void __cxa_guard_abort(guard_type* guard_object) -{ +void __cxa_guard_abort(guard_type *guard_object) { *guard_object = 0; } #else // !LIBCXXABI_HAS_NO_THREADS -int __cxa_guard_acquire(guard_type* guard_object) -{ +int __cxa_guard_acquire(guard_type *guard_object) { char* initialized = (char*)guard_object; if (pthread_mutex_lock(&guard_mut)) abort_message("__cxa_guard_acquire failed to acquire mutex"); @@ -227,8 +223,7 @@ int __cxa_guard_acquire(guard_type* guar return result; } -void __cxa_guard_release(guard_type* guard_object) -{ +void __cxa_guard_release(guard_type *guard_object) { if (pthread_mutex_lock(&guard_mut)) abort_message("__cxa_guard_release failed to acquire mutex"); *guard_object = 0; @@ -239,8 +234,7 @@ void __cxa_guard_release(guard_type* gua abort_message("__cxa_guard_release failed to broadcast condition variable"); } -void __cxa_guard_abort(guard_type* guard_object) -{ +void __cxa_guard_abort(guard_type *guard_object) { if (pthread_mutex_lock(&guard_mut)) abort_message("__cxa_guard_abort failed to acquire mutex"); *guard_object = 0; Modified: libcxxabi/trunk/src/cxa_thread_atexit.cpp URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_thread_atexit.cpp?rev=254690&r1=254689&r2=254690&view=diff ============================================================================== --- libcxxabi/trunk/src/cxa_thread_atexit.cpp (original) +++ libcxxabi/trunk/src/cxa_thread_atexit.cpp Thu Dec 3 20:14:41 2015 @@ -10,7 +10,6 @@ #include "cxxabi.h" namespace __cxxabiv1 { - extern "C" { #ifdef HAVE___CXA_THREAD_ATEXIT_IMPL @@ -24,5 +23,4 @@ int __cxa_thread_atexit(void (*dtor)(voi #endif // HAVE__CXA_THREAD_ATEXIT_IMPL } // extern "C" - } // namespace __cxxabiv1 Modified: libcxxabi/trunk/src/cxa_vector.cpp URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_vector.cpp?rev=254690&r1=254689&r2=254690&view=diff ============================================================================== --- libcxxabi/trunk/src/cxa_vector.cpp (original) +++ libcxxabi/trunk/src/cxa_vector.cpp Thu Dec 3 20:14:41 2015 @@ -114,10 +114,9 @@ extern "C" { // // __cxa_vec_new2(element_count, element_size, padding_size, constructor, // destructor, &::operator new[], &::operator delete[]) -void* __cxa_vec_new( - size_t element_count, size_t element_size, size_t padding_size, - void (*constructor)(void*), void (*destructor)(void*) ) { - +void *__cxa_vec_new(size_t element_count, size_t element_size, + size_t padding_size, void (*constructor)(void *), + void (*destructor)(void *)) { return __cxa_vec_new2 ( element_count, element_size, padding_size, constructor, destructor, &::operator new [], &::operator delete [] ); } @@ -140,11 +139,10 @@ void* __cxa_vec_new( // not be called. // // Neither alloc nor dealloc may be NULL. -void* __cxa_vec_new2( - size_t element_count, size_t element_size, size_t padding_size, - void (*constructor)(void*), void (*destructor)(void*), - void* (*alloc)(size_t), void (*dealloc)(void*) ) { - +void *__cxa_vec_new2(size_t element_count, size_t element_size, + size_t padding_size, void (*constructor)(void *), + void (*destructor)(void *), void *(*alloc)(size_t), + void (*dealloc)(void *)) { const size_t heap_size = element_count * element_size + padding_size; char * const heap_block = static_cast<char *> ( alloc ( heap_size )); char *vec_base = heap_block; @@ -169,11 +167,10 @@ void* __cxa_vec_new2( // Same as __cxa_vec_new2 except that the deallocation function takes both // the object address and its size. -void* __cxa_vec_new3( - size_t element_count, size_t element_size, size_t padding_size, - void (*constructor)(void*), void (*destructor)(void*), - void* (*alloc)(size_t), void (*dealloc)(void*, size_t) ) { - +void *__cxa_vec_new3(size_t element_count, size_t element_size, + size_t padding_size, void (*constructor)(void *), + void (*destructor)(void *), void *(*alloc)(size_t), + void (*dealloc)(void *, size_t)) { const size_t heap_size = element_count * element_size + padding_size; char * const heap_block = static_cast<char *> ( alloc ( heap_size )); char *vec_base = heap_block; @@ -206,10 +203,9 @@ void* __cxa_vec_new3( // pointers may be NULL. If either is NULL, no action is taken when it // would have been called. -void __cxa_vec_cctor( void* dest_array, void* src_array, - size_t element_count, size_t element_size, - void (*constructor) (void*, void*), void (*destructor)(void*) ) { - +void __cxa_vec_cctor(void *dest_array, void *src_array, size_t element_count, + size_t element_size, void (*constructor)(void *, void *), + void (*destructor)(void *)) { if ( NULL != constructor ) { size_t idx = 0; char *src_ptr = static_cast<char *>(src_array); @@ -231,10 +227,9 @@ void __cxa_vec_cctor( void* dest_array, // exception. If the destructor throws an exception, call terminate(). The // constructor and/or destructor pointers may be NULL. If either is NULL, // no action is taken when it would have been called. -void __cxa_vec_ctor( - void* array_address, size_t element_count, size_t element_size, - void (*constructor)(void*), void (*destructor)(void*) ) { - +void __cxa_vec_ctor(void *array_address, size_t element_count, + size_t element_size, void (*constructor)(void *), + void (*destructor)(void *)) { if ( NULL != constructor ) { size_t idx; char *ptr = static_cast <char *> ( array_address ); @@ -253,10 +248,8 @@ void __cxa_vec_ctor( // elements if possible. If the destructor throws a second exception, call // terminate(). The destructor pointer may be NULL, in which case this // routine does nothing. -void __cxa_vec_dtor( - void* array_address, size_t element_count, size_t element_size, - void (*destructor)(void*) ) { - +void __cxa_vec_dtor(void *array_address, size_t element_count, + size_t element_size, void (*destructor)(void *)) { if ( NULL != destructor ) { char *ptr = static_cast <char *> (array_address); size_t idx = element_count; @@ -279,9 +272,8 @@ void __cxa_vec_dtor( // size of its elements, call the given destructor on each element. If the // destructor throws an exception, call terminate(). The destructor pointer // may be NULL, in which case this routine does nothing. -void __cxa_vec_cleanup( void* array_address, size_t element_count, - size_t element_size, void (*destructor)(void*) ) { - +void __cxa_vec_cleanup(void *array_address, size_t element_count, + size_t element_size, void (*destructor)(void *)) { if ( NULL != destructor ) { char *ptr = static_cast <char *> (array_address); size_t idx = element_count; @@ -316,22 +308,19 @@ void __cxa_vec_cleanup( void* array_addr // function be called even if the destructor throws an exception derives // from the resolution to DR 353 to the C++ standard, which was adopted in // April, 2003. -void __cxa_vec_delete( void* array_address, - size_t element_size, size_t padding_size, void (*destructor)(void*) ) { - +void __cxa_vec_delete(void *array_address, size_t element_size, + size_t padding_size, void (*destructor)(void *)) { __cxa_vec_delete2 ( array_address, element_size, padding_size, destructor, &::operator delete [] ); } - // Same as __cxa_vec_delete, except that the given function is used for // deallocation instead of the default delete function. If dealloc throws // an exception, the result is undefined. The dealloc pointer may not be // NULL. -void __cxa_vec_delete2( void* array_address, - size_t element_size, size_t padding_size, - void (*destructor)(void*), void (*dealloc)(void*) ) { - +void __cxa_vec_delete2(void *array_address, size_t element_size, + size_t padding_size, void (*destructor)(void *), + void (*dealloc)(void *)) { if ( NULL != array_address ) { char *vec_base = static_cast <char *> (array_address); char *heap_block = vec_base - padding_size; @@ -349,10 +338,9 @@ void __cxa_vec_delete2( void* array_addr // function takes both the object address and its size. If dealloc throws // an exception, the result is undefined. The dealloc pointer may not be // NULL. -void __cxa_vec_delete3( void* array_address, - size_t element_size, size_t padding_size, - void (*destructor)(void*), void (*dealloc) (void*, size_t)) { - +void __cxa_vec_delete3(void *array_address, size_t element_size, + size_t padding_size, void (*destructor)(void *), + void (*dealloc)(void *, size_t)) { if ( NULL != array_address ) { char *vec_base = static_cast <char *> (array_address); char *heap_block = vec_base - padding_size; Modified: libcxxabi/trunk/src/cxa_virtual.cpp URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_virtual.cpp?rev=254690&r1=254689&r2=254690&view=diff ============================================================================== --- libcxxabi/trunk/src/cxa_virtual.cpp (original) +++ libcxxabi/trunk/src/cxa_virtual.cpp Thu Dec 3 20:14:41 2015 @@ -10,22 +10,16 @@ #include "cxxabi.h" #include "abort_message.h" -namespace __cxxabiv1 -{ - -extern "C" -{ - +namespace __cxxabiv1 { +extern "C" { LIBCXXABI_NORETURN void __cxa_pure_virtual(void) { - abort_message("Pure virtual function called!"); + abort_message("Pure virtual function called!"); } LIBCXXABI_NORETURN void __cxa_deleted_virtual(void) { - abort_message("Deleted virtual function called!"); + abort_message("Deleted virtual function called!"); } - -} // extern "C" - -} // abi +} // extern "C" +} // abi Modified: libcxxabi/trunk/src/private_typeinfo.h URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/private_typeinfo.h?rev=254690&r1=254689&r2=254690&view=diff ============================================================================== --- libcxxabi/trunk/src/private_typeinfo.h (original) +++ libcxxabi/trunk/src/private_typeinfo.h Thu Dec 3 20:14:41 2015 @@ -13,52 +13,50 @@ #include <typeinfo> #include <cstddef> -namespace __cxxabiv1 -{ - +namespace __cxxabiv1 { #pragma GCC visibility push(hidden) -class __attribute__ ((__visibility__("default"))) __shim_type_info - : public std::type_info -{ +class __attribute__((__visibility__("default"))) __shim_type_info + : public std::type_info { public: - __attribute__ ((__visibility__("hidden"))) virtual ~__shim_type_info(); + __attribute__((__visibility__("hidden"))) virtual ~__shim_type_info(); - __attribute__ ((__visibility__("hidden"))) virtual void noop1() const; - __attribute__ ((__visibility__("hidden"))) virtual void noop2() const; - __attribute__ ((__visibility__("hidden"))) virtual bool can_catch(const __shim_type_info* thrown_type, void*& adjustedPtr) const = 0; + __attribute__((__visibility__("hidden"))) virtual void noop1() const; + __attribute__((__visibility__("hidden"))) virtual void noop2() const; + __attribute__((__visibility__("hidden"))) virtual bool + can_catch(const __shim_type_info *thrown_type, void *&adjustedPtr) const = 0; }; -class __attribute__ ((__visibility__("default"))) __fundamental_type_info - : public __shim_type_info -{ +class __attribute__((__visibility__("default"))) __fundamental_type_info + : public __shim_type_info { public: - __attribute__ ((__visibility__("hidden"))) virtual ~__fundamental_type_info(); - __attribute__ ((__visibility__("hidden"))) virtual bool can_catch(const __shim_type_info*, void*&) const; + __attribute__((__visibility__("hidden"))) virtual ~__fundamental_type_info(); + __attribute__((__visibility__("hidden"))) virtual bool + can_catch(const __shim_type_info *, void *&) const; }; -class __attribute__ ((__visibility__("default"))) __array_type_info - : public __shim_type_info -{ +class __attribute__((__visibility__("default"))) __array_type_info + : public __shim_type_info { public: - __attribute__ ((__visibility__("hidden"))) virtual ~__array_type_info(); - __attribute__ ((__visibility__("hidden"))) virtual bool can_catch(const __shim_type_info*, void*&) const; + __attribute__((__visibility__("hidden"))) virtual ~__array_type_info(); + __attribute__((__visibility__("hidden"))) virtual bool + can_catch(const __shim_type_info *, void *&) const; }; -class __attribute__ ((__visibility__("default"))) __function_type_info - : public __shim_type_info -{ +class __attribute__((__visibility__("default"))) __function_type_info + : public __shim_type_info { public: - __attribute__ ((__visibility__("hidden"))) virtual ~__function_type_info(); - __attribute__ ((__visibility__("hidden"))) virtual bool can_catch(const __shim_type_info*, void*&) const; + __attribute__((__visibility__("hidden"))) virtual ~__function_type_info(); + __attribute__((__visibility__("hidden"))) virtual bool + can_catch(const __shim_type_info *, void *&) const; }; -class __attribute__ ((__visibility__("default"))) __enum_type_info - : public __shim_type_info -{ +class __attribute__((__visibility__("default"))) __enum_type_info + : public __shim_type_info { public: - __attribute__ ((__visibility__("hidden"))) virtual ~__enum_type_info(); - __attribute__ ((__visibility__("hidden"))) virtual bool can_catch(const __shim_type_info*, void*&) const; + __attribute__((__visibility__("hidden"))) virtual ~__enum_type_info(); + __attribute__((__visibility__("hidden"))) virtual bool + can_catch(const __shim_type_info *, void *&) const; }; enum @@ -70,7 +68,7 @@ enum no }; -class __attribute__ ((__visibility__("default"))) __class_type_info; +class __attribute__((__visibility__("default"))) __class_type_info; struct __dynamic_cast_info { @@ -120,43 +118,44 @@ struct __dynamic_cast_info }; // Has no base class -class __attribute__ ((__visibility__("default"))) __class_type_info - : public __shim_type_info -{ +class __attribute__((__visibility__("default"))) __class_type_info + : public __shim_type_info { public: - __attribute__ ((__visibility__("hidden"))) virtual ~__class_type_info(); + __attribute__((__visibility__("hidden"))) virtual ~__class_type_info(); - __attribute__ ((__visibility__("hidden"))) - void process_static_type_above_dst(__dynamic_cast_info*, const void*, const void*, int) const; - __attribute__ ((__visibility__("hidden"))) - void process_static_type_below_dst(__dynamic_cast_info*, const void*, int) const; - __attribute__ ((__visibility__("hidden"))) - void process_found_base_class(__dynamic_cast_info*, void*, int) const; - __attribute__ ((__visibility__("hidden"))) - virtual void search_above_dst(__dynamic_cast_info*, const void*, const void*, int, bool) const; - __attribute__ ((__visibility__("hidden"))) - virtual void search_below_dst(__dynamic_cast_info*, const void*, int, bool) const; - __attribute__ ((__visibility__("hidden"))) - virtual bool can_catch(const __shim_type_info*, void*&) const; - __attribute__ ((__visibility__("hidden"))) - virtual void has_unambiguous_public_base(__dynamic_cast_info*, void*, int) const; + __attribute__((__visibility__("hidden"))) void + process_static_type_above_dst(__dynamic_cast_info *, const void *, + const void *, int) const; + __attribute__((__visibility__("hidden"))) void + process_static_type_below_dst(__dynamic_cast_info *, const void *, int) const; + __attribute__((__visibility__("hidden"))) void + process_found_base_class(__dynamic_cast_info *, void *, int) const; + __attribute__((__visibility__("hidden"))) virtual void + search_above_dst(__dynamic_cast_info *, const void *, const void *, int, + bool) const; + __attribute__((__visibility__("hidden"))) virtual void + search_below_dst(__dynamic_cast_info *, const void *, int, bool) const; + __attribute__((__visibility__("hidden"))) virtual bool + can_catch(const __shim_type_info *, void *&) const; + __attribute__((__visibility__("hidden"))) virtual void + has_unambiguous_public_base(__dynamic_cast_info *, void *, int) const; }; // Has one non-virtual public base class at offset zero -class __attribute__ ((__visibility__("default"))) __si_class_type_info - : public __class_type_info -{ +class __attribute__((__visibility__("default"))) __si_class_type_info + : public __class_type_info { public: - const __class_type_info* __base_type; + const __class_type_info *__base_type; - __attribute__ ((__visibility__("hidden"))) virtual ~__si_class_type_info(); + __attribute__((__visibility__("hidden"))) virtual ~__si_class_type_info(); - __attribute__ ((__visibility__("hidden"))) - virtual void search_above_dst(__dynamic_cast_info*, const void*, const void*, int, bool) const; - __attribute__ ((__visibility__("hidden"))) - virtual void search_below_dst(__dynamic_cast_info*, const void*, int, bool) const; - __attribute__ ((__visibility__("hidden"))) - virtual void has_unambiguous_public_base(__dynamic_cast_info*, void*, int) const; + __attribute__((__visibility__("hidden"))) virtual void + search_above_dst(__dynamic_cast_info *, const void *, const void *, int, + bool) const; + __attribute__((__visibility__("hidden"))) virtual void + search_below_dst(__dynamic_cast_info *, const void *, int, bool) const; + __attribute__((__visibility__("hidden"))) virtual void + has_unambiguous_public_base(__dynamic_cast_info *, void *, int) const; }; struct __base_class_type_info @@ -178,70 +177,71 @@ public: }; // Has one or more base classes -class __attribute__ ((__visibility__("default"))) __vmi_class_type_info - : public __class_type_info -{ +class __attribute__((__visibility__("default"))) __vmi_class_type_info + : public __class_type_info { public: - unsigned int __flags; - unsigned int __base_count; - __base_class_type_info __base_info[1]; - - enum __flags_masks - { - __non_diamond_repeat_mask = 0x1, // has two or more distinct base class - // objects of the same type - __diamond_shaped_mask = 0x2 // has base class object with two or - // more derived objects - }; - - __attribute__ ((__visibility__("hidden"))) virtual ~__vmi_class_type_info(); - - __attribute__ ((__visibility__("hidden"))) - virtual void search_above_dst(__dynamic_cast_info*, const void*, const void*, int, bool) const; - __attribute__ ((__visibility__("hidden"))) - virtual void search_below_dst(__dynamic_cast_info*, const void*, int, bool) const; - __attribute__ ((__visibility__("hidden"))) - virtual void has_unambiguous_public_base(__dynamic_cast_info*, void*, int) const; -}; - -class __attribute__ ((__visibility__("default"))) __pbase_type_info - : public __shim_type_info -{ -public: - unsigned int __flags; - const __shim_type_info* __pointee; - - enum __masks - { - __const_mask = 0x1, - __volatile_mask = 0x2, - __restrict_mask = 0x4, - __incomplete_mask = 0x8, - __incomplete_class_mask = 0x10 - }; - - __attribute__ ((__visibility__("hidden"))) virtual ~__pbase_type_info(); - __attribute__ ((__visibility__("hidden"))) virtual bool can_catch(const __shim_type_info*, void*&) const; -}; - -class __attribute__ ((__visibility__("default"))) __pointer_type_info - : public __pbase_type_info -{ -public: - __attribute__ ((__visibility__("hidden"))) virtual ~__pointer_type_info(); - __attribute__ ((__visibility__("hidden"))) virtual bool can_catch(const __shim_type_info*, void*&) const; - __attribute__ ((__visibility__("hidden"))) bool can_catch_nested(const __shim_type_info*) const; -}; - -class __attribute__ ((__visibility__("default"))) __pointer_to_member_type_info - : public __pbase_type_info -{ -public: - const __class_type_info* __context; - - __attribute__ ((__visibility__("hidden"))) virtual ~__pointer_to_member_type_info(); - __attribute__ ((__visibility__("hidden"))) virtual bool can_catch(const __shim_type_info*, void*&) const; - __attribute__ ((__visibility__("hidden"))) bool can_catch_nested(const __shim_type_info*) const; + unsigned int __flags; + unsigned int __base_count; + __base_class_type_info __base_info[1]; + + enum __flags_masks { + __non_diamond_repeat_mask = 0x1, // has two or more distinct base class + // objects of the same type + __diamond_shaped_mask = 0x2 // has base class object with two or + // more derived objects + }; + + __attribute__((__visibility__("hidden"))) virtual ~__vmi_class_type_info(); + + __attribute__((__visibility__("hidden"))) virtual void + search_above_dst(__dynamic_cast_info *, const void *, const void *, int, + bool) const; + __attribute__((__visibility__("hidden"))) virtual void + search_below_dst(__dynamic_cast_info *, const void *, int, bool) const; + __attribute__((__visibility__("hidden"))) virtual void + has_unambiguous_public_base(__dynamic_cast_info *, void *, int) const; +}; + +class __attribute__((__visibility__("default"))) __pbase_type_info + : public __shim_type_info { +public: + unsigned int __flags; + const __shim_type_info *__pointee; + + enum __masks { + __const_mask = 0x1, + __volatile_mask = 0x2, + __restrict_mask = 0x4, + __incomplete_mask = 0x8, + __incomplete_class_mask = 0x10 + }; + + __attribute__((__visibility__("hidden"))) virtual ~__pbase_type_info(); + __attribute__((__visibility__("hidden"))) virtual bool + can_catch(const __shim_type_info *, void *&) const; +}; + +class __attribute__((__visibility__("default"))) __pointer_type_info + : public __pbase_type_info { +public: + __attribute__((__visibility__("hidden"))) virtual ~__pointer_type_info(); + __attribute__((__visibility__("hidden"))) virtual bool + can_catch(const __shim_type_info *, void *&) const; + __attribute__((__visibility__("hidden"))) bool + can_catch_nested(const __shim_type_info *) const; +}; + +class __attribute__((__visibility__("default"))) __pointer_to_member_type_info + : public __pbase_type_info { +public: + const __class_type_info *__context; + + __attribute__(( + __visibility__("hidden"))) virtual ~__pointer_to_member_type_info(); + __attribute__((__visibility__("hidden"))) virtual bool + can_catch(const __shim_type_info *, void *&) const; + __attribute__((__visibility__("hidden"))) bool + can_catch_nested(const __shim_type_info *) const; }; #pragma GCC visibility pop _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits