[cfe-commits] [libcxxabi] r148860 - in /libcxxabi/trunk/src: cxa_new_delete.cpp private_typeinfo.cpp private_typeinfo.h

Howard Hinnant hhinnant at apple.com
Tue Jan 24 13:35:18 PST 2012


Author: hhinnant
Date: Tue Jan 24 15:35:18 2012
New Revision: 148860

URL: http://llvm.org/viewvc/llvm-project?rev=148860&view=rev
Log:
Add some needed symbols to cxa_new_delete.cpp and put the display() stuff under #DEBUG (again).

Modified:
    libcxxabi/trunk/src/cxa_new_delete.cpp
    libcxxabi/trunk/src/private_typeinfo.cpp
    libcxxabi/trunk/src/private_typeinfo.h

Modified: libcxxabi/trunk/src/cxa_new_delete.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_new_delete.cpp?rev=148860&r1=148859&r2=148860&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_new_delete.cpp (original)
+++ libcxxabi/trunk/src/cxa_new_delete.cpp Tue Jan 24 15:35:18 2012
@@ -192,3 +192,40 @@
 {
     ::operator delete[](ptr);
 }
+
+namespace std
+{
+
+//  bad_alloc
+
+bad_alloc::bad_alloc() _NOEXCEPT
+{
+}
+
+bad_alloc::~bad_alloc() _NOEXCEPT
+{
+}
+
+const char*
+bad_alloc::what() const _NOEXCEPT
+{
+    return "std::bad_alloc";
+}
+
+// bad_array_new_length
+
+bad_array_new_length::bad_array_new_length() _NOEXCEPT
+{
+}
+
+bad_array_new_length::~bad_array_new_length() _NOEXCEPT
+{
+}
+
+const char*
+bad_array_new_length::what() const _NOEXCEPT
+{
+    return "bad_array_new_length";
+}
+
+}  // std

Modified: libcxxabi/trunk/src/private_typeinfo.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/private_typeinfo.cpp?rev=148860&r1=148859&r2=148860&view=diff
==============================================================================
--- libcxxabi/trunk/src/private_typeinfo.cpp (original)
+++ libcxxabi/trunk/src/private_typeinfo.cpp Tue Jan 24 15:35:18 2012
@@ -7,11 +7,11 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define __name __type_name
-
 #include "private_typeinfo.h"
 
+#ifdef DEBUG
 #include <iostream>
+#endif
 
 namespace __cxxabiv1
 {
@@ -34,78 +34,98 @@
 {
 }
 
-void
-__fundamental_type_info::display() const
+// __array_type_info
+
+__array_type_info::~__array_type_info()
 {
-    std::cout << "__fundamental_type_info " << __type_name << '\n';
 }
 
-// __array_type_info
+// __function_type_info
 
-__array_type_info::~__array_type_info()
+__function_type_info::~__function_type_info()
 {
 }
 
-void
-__array_type_info::display() const
+// __enum_type_info
+
+__enum_type_info::~__enum_type_info()
 {
-    std::cout << "__array_type_info " << __type_name << '\n';
 }
 
-// __function_type_info
+// __class_type_info
 
-__function_type_info::~__function_type_info()
+__class_type_info::~__class_type_info()
 {
 }
 
-void
-__function_type_info::display() const
+// __si_class_type_info
+
+__si_class_type_info::~__si_class_type_info()
 {
-    std::cout << "__function_type_info " << __type_name << '\n';
 }
 
-// __enum_type_info
+// __vmi_class_type_info
 
-__enum_type_info::~__enum_type_info()
+__vmi_class_type_info::~__vmi_class_type_info()
 {
 }
 
-void
-__enum_type_info::display() const
+// __pbase_type_info
+
+__pbase_type_info::~__pbase_type_info()
 {
-    std::cout << "__enum_type_info " << __type_name << '\n';
 }
 
-// __class_type_info
+// __pointer_type_info
 
-__class_type_info::~__class_type_info()
+__pointer_type_info::~__pointer_type_info()
+{
+}
+
+// __pointer_to_member_type_info
+
+__pointer_to_member_type_info::~__pointer_to_member_type_info()
 {
 }
 
+#ifdef DEBUG
+
 void
-__class_type_info::display() const
+__fundamental_type_info::display() const
 {
-    std::cout << "__class_type_info " << __type_name << '\n';
+    std::cout << "__fundamental_type_info " << __type_name << '\n';
 }
 
-// __si_class_type_info
+void
+__array_type_info::display() const
+{
+    std::cout << "__array_type_info " << __type_name << '\n';
+}
 
-__si_class_type_info::~__si_class_type_info()
+void
+__function_type_info::display() const
 {
+    std::cout << "__function_type_info " << __type_name << '\n';
 }
 
 void
-__si_class_type_info::display() const
+__enum_type_info::display() const
 {
-    std::cout << "__si_class_type_info " << __type_name << '\n';
-    std::cout << "derived from ";
-    __base_type->display();
+    std::cout << "__enum_type_info " << __type_name << '\n';
 }
 
-// __vmi_class_type_info
+void
+__class_type_info::display() const
+{
+    std::cout << "__class_type_info " << __type_name << '\n';
+}
 
-__vmi_class_type_info::~__vmi_class_type_info()
+void
+__si_class_type_info::display() const
 {
+    std::cout << "__si_class_type_info " << __type_name << '\n';
+    std::cout << "derived from ";
+    __base_type->display();
 }
 
 void
@@ -129,18 +149,6 @@
     __base_type->display();
 }
 
-// __pbase_type_info
-
-__pbase_type_info::~__pbase_type_info()
-{
-}
-
-// __pointer_type_info
-
-__pointer_type_info::~__pointer_type_info()
-{
-}
-
 void
 __pointer_type_info::display() const
 {
@@ -159,12 +167,6 @@
     __pointee->display();
 }
 
-// __pointer_to_member_type_info
-
-__pointer_to_member_type_info::~__pointer_to_member_type_info()
-{
-}
-
 void
 __pointer_to_member_type_info::display() const
 {
@@ -185,6 +187,8 @@
     __pointee->display();
 }
 
+#endif
+
 // can_catch
 
 // A handler is a match for an exception object of type E if

Modified: libcxxabi/trunk/src/private_typeinfo.h
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/private_typeinfo.h?rev=148860&r1=148859&r2=148860&view=diff
==============================================================================
--- libcxxabi/trunk/src/private_typeinfo.h (original)
+++ libcxxabi/trunk/src/private_typeinfo.h Tue Jan 24 15:35:18 2012
@@ -25,7 +25,9 @@
     virtual ~__shim_type_info();
 
     virtual bool can_catch(const __shim_type_info* thrown_type, void*& adjustedPtr) const;
+#ifdef DEBUG
     virtual void display() const = 0;
+#endif
 };
 
 class __fundamental_type_info
@@ -34,7 +36,9 @@
 public:
     virtual ~__fundamental_type_info();
     virtual bool can_catch(const __shim_type_info*, void*&) const;
+#ifdef DEBUG
     virtual void display() const;
+#endif
 };
 
 class __array_type_info
@@ -43,7 +47,9 @@
 public:
     virtual ~__array_type_info();
     virtual bool can_catch(const __shim_type_info*, void*&) const;
+#ifdef DEBUG
     virtual void display() const;
+#endif
 };
 
 class __function_type_info
@@ -52,7 +58,9 @@
 public:
     virtual ~__function_type_info();
     virtual bool can_catch(const __shim_type_info*, void*&) const;
+#ifdef DEBUG
     virtual void display() const;
+#endif
 };
 
 class __enum_type_info
@@ -61,7 +69,9 @@
 public:
     virtual ~__enum_type_info();
     virtual bool can_catch(const __shim_type_info*, void*&) const;
+#ifdef DEBUG
     virtual void display() const;
+#endif
 };
 
 enum
@@ -136,7 +146,9 @@
     virtual void search_below_dst(__dynamic_cast_info*, const void*, int) const;
     virtual bool can_catch(const __shim_type_info*, void*&) const;
     virtual void has_unambiguous_public_base(__dynamic_cast_info*, void*, int) const;
+#ifdef DEBUG
     virtual void display() const;
+#endif
 };
 
 // Has one non-virtual public base class at offset zero
@@ -151,7 +163,9 @@
     virtual void search_above_dst(__dynamic_cast_info*, const void*, const void*, int) const;
     virtual void search_below_dst(__dynamic_cast_info*, const void*, int) const;
     virtual void has_unambiguous_public_base(__dynamic_cast_info*, void*, int) const;
+#ifdef DEBUG
     virtual void display() const;
+#endif
 };
 
 struct __base_class_type_info
@@ -170,7 +184,9 @@
     void search_above_dst(__dynamic_cast_info*, const void*, const void*, int) const;
     void search_below_dst(__dynamic_cast_info*, const void*, int) const;
     void has_unambiguous_public_base(__dynamic_cast_info*, void*, int) const;
+#ifdef DEBUG
     void display() const;
+#endif
 };
 
 // Has one or more base classes
@@ -195,7 +211,9 @@
     virtual void search_above_dst(__dynamic_cast_info*, const void*, const void*, int) const;
     virtual void search_below_dst(__dynamic_cast_info*, const void*, int) const;
     virtual void has_unambiguous_public_base(__dynamic_cast_info*, void*, int) const;
+#ifdef DEBUG
     virtual void display() const;
+#endif
 };
 
 class __pbase_type_info
@@ -224,7 +242,9 @@
 public:
     virtual ~__pointer_type_info();
     virtual bool can_catch(const __shim_type_info*, void*&) const;
+#ifdef DEBUG
     virtual void display() const;
+#endif
 };
 
 class __pointer_to_member_type_info
@@ -234,7 +254,9 @@
     const __class_type_info* __context;
 
     virtual ~__pointer_to_member_type_info();
+#ifdef DEBUG
     virtual void display() const;
+#endif
 };
 
 #pragma GCC visibility pop





More information about the cfe-commits mailing list