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

Howard Hinnant hhinnant at apple.com
Wed Feb 1 13:06:46 PST 2012


Author: hhinnant
Date: Wed Feb  1 15:06:46 2012
New Revision: 149537

URL: http://llvm.org/viewvc/llvm-project?rev=149537&view=rev
Log:
Remove a TODO regarding where some can_catch are implemented.  I opted to make can_catch pure virtual in the top __shim_type_info, and have each sub-class implement its own.  There are some repeated definitions, but they are trivial.

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

Modified: libcxxabi/trunk/src/private_typeinfo.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/private_typeinfo.cpp?rev=149537&r1=149536&r2=149537&view=diff
==============================================================================
--- libcxxabi/trunk/src/private_typeinfo.cpp (original)
+++ libcxxabi/trunk/src/private_typeinfo.cpp Wed Feb  1 15:06:46 2012
@@ -218,15 +218,7 @@
 // 
 // catch (...) : adjustedPtr == & of the exception
 
-bool
-__shim_type_info::can_catch(const __shim_type_info* thrown_type,
-                            void*&) const
-{
-    return this == thrown_type;
-}
-
 // Handles bullet 1
-// TODO:  Let __shim_type_info handle it?
 bool
 __fundamental_type_info::can_catch(const __shim_type_info* thrown_type,
                                    void*&) const
@@ -257,7 +249,6 @@
 }
 
 // Handles bullet 1
-// TODO:  Let __shim_type_info handle it?
 bool
 __enum_type_info::can_catch(const __shim_type_info* thrown_type,
                             void*&) const

Modified: libcxxabi/trunk/src/private_typeinfo.h
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/private_typeinfo.h?rev=149537&r1=149536&r2=149537&view=diff
==============================================================================
--- libcxxabi/trunk/src/private_typeinfo.h (original)
+++ libcxxabi/trunk/src/private_typeinfo.h Wed Feb  1 15:06:46 2012
@@ -24,7 +24,7 @@
 public:
     virtual ~__shim_type_info();
 
-    virtual bool can_catch(const __shim_type_info* thrown_type, void*& adjustedPtr) const;
+    virtual bool can_catch(const __shim_type_info* thrown_type, void*& adjustedPtr) const = 0;
 #ifdef DEBUG
     virtual void display() const = 0;
 #endif





More information about the cfe-commits mailing list