Commit 6a22c4c8 authored by Pawel Wodnicki's avatar Pawel Wodnicki
Browse files

3.2 release branch r167707

llvm-svn: 167867
parents fae92bda 2700433f
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
This file is a partial list of people who have contributed to the LLVM/libc++abi
project.  If you have contributed a patch or made some other contribution to
LLVM/libc++abi, please submit a patch to this file to add yourself, and it will be
done!

The list is sorted by surname and formatted to allow easy grepping and
beautification by scripts.  The fields are: name (N), email (E), web-address
(W), PGP key ID and fingerprint (P), description (D), and snail-mail address
(S).

N: Howard Hinnant
E: hhinnant@apple.com
D: Architect and primary coauthor of libc++abi

N: Marshall Clow
E: mclow.lists@gmail.com
E: marshall@idio.com
D: Architect and primary coauthor of libc++abi

N: Nick Kledzik
E: kledzik@apple.com

N: Andrew Morrow
E: andrew.c.morrow@gmail.com
D: Minor patches and fixes

N: Erik Olofsson
E: erik.olofsson@hansoft.se
E: erik@olofsson.info
D: Minor patches and fixes
+76 −0
Original line number Diff line number Diff line
==============================================================================
libc++abi License
==============================================================================

The libc++abi library is dual licensed under both the University of Illinois
"BSD-Like" license and the MIT license.  As a user of this code you may choose
to use it under either license.  As a contributor, you agree to allow your code
to be used under both.

Full text of the relevant licenses is included below.

==============================================================================

University of Illinois/NCSA
Open Source License

Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT

All rights reserved.

Developed by:

    LLVM Team

    University of Illinois at Urbana-Champaign

    http://llvm.org

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal with
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

    * Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimers.

    * Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimers in the
      documentation and/or other materials provided with the distribution.

    * Neither the names of the LLVM Team, University of Illinois at
      Urbana-Champaign, nor the names of its contributors may be used to
      endorse or promote products derived from this Software without specific
      prior written permission.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
SOFTWARE.

==============================================================================

Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+167 −0
Original line number Diff line number Diff line
//===-------------------------- cxa_demangle.h ----------------------------===//
//
//                     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.
//
//===----------------------------------------------------------------------===//

#ifndef _CXA_DEMANGLE_H
#define _CXA_DEMANGLE_H

#include <cxxabi.h>

#pragma GCC visibility push(hidden)

namespace __cxxabiv1
{

namespace __libcxxabi
{

class __demangle_tree;
class __node;

char*
__demangle(__demangle_tree, char*, size_t*, int*);

struct __demangle_tree_rv
{
    __demangle_tree* ptr_;

    explicit __demangle_tree_rv(__demangle_tree* ptr)
        : ptr_(ptr) {}
};

class __demangle_tree
{
    const char* __mangled_name_begin_;
    const char* __mangled_name_end_;
    int         __status_;
    __node*     __root_;
    __node*     __node_begin_;
    __node*     __node_end_;
    __node*     __node_cap_;
    __node**    __sub_begin_;
    __node**    __sub_end_;
    __node**    __sub_cap_;
    __node**    __t_begin_;
    __node**    __t_end_;
    __node**    __t_cap_;
    bool        __tag_templates_;
    bool        __fix_forward_references_;
    bool        __owns_buf_;

    __demangle_tree& operator=(const __demangle_tree&);
public:
    __demangle_tree(const char*, char*, size_t);
    ~__demangle_tree();

    __demangle_tree(__demangle_tree&);
    __demangle_tree(__demangle_tree_rv);
    operator __demangle_tree_rv() {return __demangle_tree_rv(this);}

    int __status() const;
    size_t size() const;
    char* __get_demangled_name(char*) const;

    void __parse();

private:
    const char* __parse_encoding(const char*, const char*);
    const char* __parse_type(const char*, const char*,
                             bool = true, bool = false);
    const char* __parse_special_name(const char*, const char*);
    const char* __parse_name(const char*, const char*);
    const char* __parse_bare_function_type(const char*, const char*);
    const char* __parse_call_offset(const char*, const char*);
    const char* __parse_number(const char*, const char*);
    const char* __parse_cv_qualifiers(const char* first, const char* last,
                                      unsigned& cv, bool = false);
    const char* __parse_nested_name(const char*, const char*);
    const char* __parse_discriminator(const char*, const char*);
    const char* __parse_local_name(const char*, const char*);
    const char* __parse_unscoped_template_name(const char*, const char*);
    const char* __parse_unscoped_name(const char*, const char*);
    const char* __parse_operator_name(const char*, const char*, int* = 0);
    const char* __parse_unqualified_name(const char*, const char*);
    const char* __parse_source_name(const char*, const char*);
    const char* __parse_ctor_dtor_name(const char*, const char*);
    const char* __parse_unnamed_type_name(const char*, const char*);
    const char* __parse_template_args(const char*, const char*);
    const char* __parse_template_arg(const char*, const char*);
    const char* __parse_expression(const char*, const char*);
    const char* __parse_expr_primary(const char*, const char*);
    const char* __parse_substitution(const char*, const char*);
    const char* __parse_builtin_type(const char*, const char*);
    const char* __parse_function_type(const char*, const char*);
    const char* __parse_class_enum_type(const char*, const char*);
    const char* __parse_array_type(const char*, const char*);
    const char* __parse_pointer_to_member_type(const char*, const char*);
    const char* __parse_decltype(const char*, const char*);
    const char* __parse_template_param(const char*, const char*);
    const char* __parse_unresolved_name(const char*, const char*);
    const char* __parse_unresolved_type(const char*, const char*);
    const char* __parse_base_unresolved_name(const char*, const char*);
    const char* __parse_simple_id(const char*, const char*);
    const char* __parse_destructor_name(const char*, const char*);
    const char* __parse_function_param(const char*, const char*);
    const char* __parse_const_cast_expr(const char*, const char*);
    const char* __parse_alignof_expr(const char*, const char*);
    const char* __parse_call_expr(const char*, const char*);
    const char* __parse_conversion_expr(const char*, const char*);
    const char* __parse_delete_array_expr(const char*, const char*);
    const char* __parse_delete_expr(const char*, const char*);
    const char* __parse_dynamic_cast_expr(const char*, const char*);
    const char* __parse_dot_star_expr(const char*, const char*);
    const char* __parse_dot_expr(const char*, const char*);
    const char* __parse_decrement_expr(const char*, const char*);
    const char* __parse_new_expr(const char*, const char*);
    const char* __parse_increment_expr(const char*, const char*);
    const char* __parse_arrow_expr(const char*, const char*);
    const char* __parse_reinterpret_cast_expr(const char*, const char*);
    const char* __parse_static_cast_expr(const char*, const char*);
    const char* __parse_sizeof_type_expr(const char*, const char*);
    const char* __parse_sizeof_param_pack_expr(const char*, const char*);
    const char* __parse_typeid_expr(const char*, const char*);
    const char* __parse_throw_expr(const char*, const char*);
    const char* __parse_pack_expansion(const char*, const char*);
    const char* __parse_sizeof_function_param_pack_expr(const char*, const char*);
    const char* __parse_dot_suffix(const char*, const char*);
    const char* __parse_unresolved_qualifier_level(const char*, const char*);
    const char* __parse_vector_type(const char*, const char*);
    const char* __parse_hex_number(const char*, const char*, unsigned long long&);

    template <class _Tp> bool __make();
    template <class _Tp, class _A0> bool __make(_A0 __a0);
    template <class _Tp, class _A0, class _A1> bool __make(_A0 __a0, _A1 __a1);
    template <class _Tp, class _A0, class _A1, class _A2>
        bool __make(_A0 __a0, _A1 __a1, _A2 __a2);
    template <class _Tp, class _A0, class _A1, class _A2, class _A3>
        bool __make(_A0 __a0, _A1 __a1, _A2 __a2, _A3 __a3);
    template <class _Tp, class _A0, class _A1, class _A2, class _A3, class _A4>
        bool __make(_A0 __a0, _A1 __a1, _A2 __a2, _A3 __a3, _A4 __a4);
    template <class _Tp, class _A0, class _A1, class _A2, class _A3, class _A4,
                         class _A5>
        bool __make(_A0 __a0, _A1 __a1, _A2 __a2, _A3 __a3, _A4 __a4, _A5 __a5);

    friend
    char*
    __demangle(__demangle_tree, char*, size_t*, int*);

};

__demangle_tree
__demangle(const char*);

__demangle_tree
__demangle(const char*, char*, size_t);

}  // __libcxxabi
}  // __cxxabiv1

#pragma GCC visibility pop


#endif  // _CXA_DEMANGLE_H
+175 −0
Original line number Diff line number Diff line
//===--------------------------- cxxabi.h ---------------------------------===//
//
//                     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.
//
//===----------------------------------------------------------------------===//

#ifndef __CXXABI_H
#define __CXXABI_H 

/*
 * This header provides the interface to the C++ ABI as defined at:
 *       http://www.codesourcery.com/cxx-abi/
 */

#include <stddef.h>
#include <stdint.h>

#define _LIBCPPABI_VERSION 1001
#define LIBCXXABI_NORETURN  __attribute__((noreturn))

#ifdef __cplusplus

namespace std {
    class type_info; // forward declaration
}


// runtime routines use C calling conventions, but are in __cxxabiv1 namespace
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();

// 2.4.3 Throwing the Exception Object
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_end_catch();
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);



// 3.2.6 Pure Virtual Function API
extern LIBCXXABI_NORETURN void __cxa_pure_virtual(void);

// 3.2.7 Deleted Virtual Function API
extern LIBCXXABI_NORETURN void __cxa_deleted_virtual(void);

// 3.3.2 One-time Construction API
#if __arm__
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*);
#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*) );


// 3.3.5.3 Runtime API
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);

// 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();

// Apple addition to support std::uncaught_exception()
extern bool __cxa_uncaught_exception() throw();

  } // extern "C"
} // namespace __cxxabiv1

#endif // __cplusplus

namespace abi = __cxxabiv1;

#endif // __CXXABI_H 
+99 −0
Original line number Diff line number Diff line
#! /bin/sh
#
# Set the $TRIPLE environment variable to your system's triple before
# running this script.  If you set $CXX, that will be used to compile
# the library.  Otherwise we'll use clang++.

set -e

if [ `basename $(pwd)` != "lib" ]
then
	echo "current directory must be lib"
	exit 1
fi

if [ -z "$CXX" ]
then
	CXX=clang++
fi

if [ -z "$CC" ]
then
    CC=clang
fi

if [ -z $RC_ProjectSourceVersion ]
then
  RC_ProjectSourceVersion=1
fi

EXTRA_FLAGS="-std=c++0x -stdlib=libc++ -fstrict-aliasing -Wstrict-aliasing=2 \
             -Wsign-conversion -Wshadow -Wconversion -Wunused-variable \
             -Wmissing-field-initializers -Wchar-subscripts -Wmismatched-tags \
             -Wmissing-braces -Wshorten-64-to-32 -Wsign-compare \
             -Wstrict-aliasing=2 -Wstrict-overflow=4 -Wunused-parameter \
             -Wnewline-eof"

case $TRIPLE in
  *-apple-*)
    if [ -z $RC_XBS ]
    then
      RC_CFLAGS="-arch i386 -arch x86_64"
    fi
    SOEXT=dylib
    if [ -n "$SDKROOT" ]
    then
        EXTRA_FLAGS+="-isysroot ${SDKROOT}"
        CXX=`xcrun -sdk "${SDKROOT}"  -find clang++`
        CC=`xcrun -sdk "${SDKROOT}"  -find clang`
    fi
    LDSHARED_FLAGS="-o libc++abi.dylib \
        -dynamiclib -nodefaultlibs  \
        -current_version ${RC_ProjectSourceVersion} \
        -compatibility_version 1 \
        -install_name /usr/lib/libc++abi.dylib \
        -lSystem"
	if [ -f "${SDKROOT}/usr/local/lib/libCrashReporterClient.a" ]
	then
		LDSHARED_FLAGS+=" -lCrashReporterClient"
	fi
    ;;
  *-*-mingw*)
    # FIXME: removing libgcc and libsupc++ dependencies means porting libcxxrt and LLVM/compiler-rt
    SOEXT=dll
    LDSHARED_FLAGS="-o libc++abi.dll \
        -shared -nodefaultlibs -Wl,--export-all-symbols -Wl,--allow-multiple-definition -Wl,--out-implib,libc++abi.dll.a \
        -lsupc++ -lpthread -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcr100 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt"
	;;
  *)
    RC_CFLAGS="-fPIC"
    SOEXT=so
    LDSHARED_FLAGS="-o libc++abi.so.1.0 \
        -shared -nodefaultlibs -Wl,-soname,libc++abi.so.1 \
        -lpthread -lrt -lc -lstdc++"
    ;;
esac

if [ -z $RC_XBS ]
then
    rm -f libc++abi.1.$SOEXT*
fi

set -x

for FILE in ../src/*.cpp; do
	$CXX -c -g -O3 $RC_CFLAGS $EXTRA_FLAGS -I../include $FILE
done
case $TRIPLE in
  *-*-mingw*)
  for FILE in ../src/support/win32/*.cpp; do
    $CXX -c -g -Os $RC_CFLAGS $EXTRA_FLAGS -I../include $FILE
  done
  ;;
esac
$CC *.o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS

if [ -z $RC_XBS ]
then
    rm *.o
fi
Loading