4c3bdd6f62Add test for pointer qualification conversion.
Howard Hinnant
2012-02-01 21:25:40 +0000
0550d57ec1Changed a TODO to a 'maybe some time in the future'.
Howard Hinnant
2012-02-01 21:12:07 +0000
9f54f7a888Removed DEBUG statements.
Howard Hinnant
2012-02-01 21:08:30 +0000
575160dca0Remove 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.
Howard Hinnant
2012-02-01 21:06:46 +0000
ebe450533fAdd some tests to test catching nullptr with pointers and member pointers. Tests are only activated if #if __has_feature(cxx_nullptr).
Howard Hinnant
2012-02-01 21:01:52 +0000
c649bdea9dQuash a TODO related to catching pointer-to-member. These tests fail on my copy of gcc-4.2. But I believe the tests to be correct (and they pass for libc++abi). I've enquired on the C++ standards mailing list for a clarification in case I'm wrong. So far I've gotten one response that agrees with me.
Howard Hinnant
2012-02-01 20:53:21 +0000
4b3cb1cb82Quash TODO regarding catch by function type. Add tests to back it up.
Howard Hinnant
2012-02-01 19:42:45 +0000
aafd08aa28Quash TODO regarding catch by array type. Add tests to back it up.
Howard Hinnant
2012-02-01 19:21:28 +0000
7c73587e51Removing a TODO: can_catch is fundamentally different than search_above_dst. can_catch is looking for an unamiguous public base class of a specific type, but at any address. search_above_dst is looking for an unambiguous public base class of a specific type, *and* at a specific address. Additionally can_catch is run for all types. search_above_dst is only run on class types. So these are only superficially similar. Not similar enough for resuse, at least without making the code unreadable.
Howard Hinnant
2012-02-01 18:52:35 +0000
8dd7a48855Teach exception_cleanup_func about dependent exceptions.
Howard Hinnant
2012-02-01 18:44:21 +0000
7ab185ea39Treat all exceptions except that the ones that this library throws as foreign. Even other C++ exceptions.
Howard Hinnant
2012-02-01 18:15:15 +0000
29ae5fcdaeNothing but polishing comments.
Howard Hinnant
2012-02-01 16:56:40 +0000
3a1009ca97Move an error detector to a better place.
Howard Hinnant
2012-02-01 16:16:11 +0000
e162bf2decHere's a test for catching pointers.
Howard Hinnant
2012-02-01 00:22:38 +0000
830713c63eMore test cases concentrating on catching class types.
Howard Hinnant
2012-01-31 23:52:20 +0000
dfb07f80c1Some unwinding test cases
Howard Hinnant
2012-01-31 21:58:58 +0000
3a2765fc4eBack the optimization down from -O3 to -Os. I'm getting an unexplained crasher on -O3. I've looked for a libc++abi bug and can't find one. I'm suspecting clang optimizer bug. But I don't have a good test case at the moment. Deferring investigation on this for now as I will soon be developing more and smaller tests.
Howard Hinnant
2012-01-31 20:22:59 +0000
9fb5709499Drop the stress a notch on dynamic_cast_stress.cpp. Otherwise it occasionally causes clang to crash. Put a noexcept(false) on a throwing destructor in test_vector1.cpp. The test now passes for both C++03 and C++11 modes. Add testit script. All tests are now PASSING :-)
Howard Hinnant
2012-01-31 20:10:33 +0000
6953d901c3Correct test bug.
Howard Hinnant
2012-01-31 20:01:06 +0000
06b1ea1bbdHave the default unexpected/terminate handler output *demangled* names for the type of exception instead of the mangled name.
Howard Hinnant
2012-01-31 19:48:06 +0000
2e774bf081Fix type-o in the comment of the last commit
Howard Hinnant
2012-01-31 19:05:08 +0000
135b4bd223Found and fixed a bug in __cxa_call_unexpected. If the unexpected_handler rethrows the same exception then needed information gets overwritten in the original exception header. Therefore save it locally before executing the unexpected_handler.
Howard Hinnant
2012-01-31 18:57:20 +0000
a5f9da203dFound and fixed bug in personality function: Don't dive into the action table if the action entry is zero.
Howard Hinnant
2012-01-31 17:15:14 +0000
1a58491066Minor bug fix in __cxa_call_unexpected. Changed std::terminate to detect a caught-but-unhandled exception, and choose the handler out of that if found.
Howard Hinnant
2012-01-31 01:51:15 +0000
4c8d5613f3Refactored personality function. Found one bug in scanning exception spec lists.
Howard Hinnant
2012-01-30 20:16:21 +0000
723ef221e0Removed debugging print statements
Howard Hinnant
2012-01-30 20:13:37 +0000
7da9b96afcAdd a descriptive name for a constant. Also I'm at least temporarily waging war on throw specs, both old and new style. Except where we have already publicly exposed the throw spec, I'm getting rid of them. They may come back later. But they seem somewhat prone to cyclic dependencies here. The throw spec implies compiler generated code that this library has to jump to during stack unwinding. I'd like to minimize the possiblity that the code used to properly make that jump is itself creating such jumps.
Howard Hinnant
2012-01-30 16:07:00 +0000
2b891bfd06Add -fstrict-aliasing -Wstrict-aliasing and change optimization from -Os to -O3
Howard Hinnant
2012-01-30 16:03:23 +0000
ca00a4e83ePut throw() clauses back on these functions in cxxabi.h. This header must be C++03 compatible and these throw specs are consistent with the current cxxabi.h that Apple ships.
Howard Hinnant
2012-01-30 16:02:11 +0000
978bfdea30Minor updates to a couple of comments.
Howard Hinnant
2012-01-28 00:34:46 +0000
a4d69a35baAdd a little paranoia for testing purposes.
Howard Hinnant
2012-01-28 00:32:31 +0000
27b00d862aMinor header fixups for test.
Howard Hinnant
2012-01-28 00:30:38 +0000
eb6fb17e25Silence a warning.
Howard Hinnant
2012-01-28 00:29:27 +0000
66f658093aSometimes it takes all day to write a decent comment. This is one of those times, and I'm still not quite sure I have them correct.
Howard Hinnant
2012-01-28 00:28:31 +0000
033016c562These commits are intended to be temporary in nature and are to facilitate the testing of libc++abi.dylib at this point in time.
Howard Hinnant
2012-01-25 19:27:42 +0000
f6d4cba783Add comment documenting extension behavior of __cxa_get_globals_fast().
Howard Hinnant
2012-01-25 19:19:13 +0000
de34b3e7eecxa_guard.cpp didn't quite make it on the last commit: Restricted headers to cxa_guard.cpp and abort_messsage.h, and added a comment regarding reentrancy brought up by John McCall. Thanks John.
Howard Hinnant
2012-01-25 19:02:40 +0000
1743feef39Restricted headers to cxa_guard.cpp and abort_messsage.h, and added a comment regarding reentrancy brought up by John McCall. Thanks John.
Howard Hinnant
2012-01-25 18:50:55 +0000
f81cdffb22By changing all of the throw() specs to noexcept I've been able to compile and link all of the source files into a dylib. Prior to this substitution the changed functions were calling __cxa_call_unexpected which isn't implemented yet. However in none of these cases do we actaully want __cxa_call_unexpected to be called. Primative buildit script added.
Howard Hinnant
2012-01-24 23:42:30 +0000
00cc7d2c79Add some needed symbols in exception.cpp and eliminate dependence upon uncaught_exception() from cxa_vector.cpp. libc++abi is very nearly a self-contained (though not complete) library now.
Howard Hinnant
2012-01-24 21:48:10 +0000
60a178840dMarshall Clow reminded me that fallback_malloc.cpp was broken out for testing purposes. We've agreed to simply rename fallback_malloc.cpp to fallback_malloc.ipp. Thanks Marshall.
Howard Hinnant
2012-01-24 21:41:27 +0000
35b2c2af6bAdd some needed symbols to cxa_new_delete.cpp and put the display() stuff under #DEBUG (again).
Howard Hinnant
2012-01-24 21:35:18 +0000
c2dfdeb451Got fooled by fallback_malloc.cpp source file: it is really a private header. I've manually included it into the only place it is used: cxa_exception.cpp.
Howard Hinnant
2012-01-24 21:02:21 +0000
73fd45bc7dAdd new file for public type_info-related signatures
Howard Hinnant
2012-01-24 21:01:01 +0000
c632c50527CrashReporterClient.h is back, but this time protected with __has_include. Thanks for the suggestion Doug. The use is consistent with how the same header is used in llvm/lib/Support/PrettyStackTrace.cpp (though there autoconfig is used instead of __has_include).
Howard Hinnant
2012-01-24 19:58:25 +0000
3f034b77daRemove dependence upon std::exception_ptr from the default_terminate_handler. Recovered the equivalent functionality at a lower level.
Howard Hinnant
2012-01-24 18:26:29 +0000
08f419c67aForgot to include this file in the last commit: Move kOurExceptionClass and kOurDependentExceptionClass from source to header so that they can be used in multiple sources. This is a private header, these constants are not publicly exposed.
Howard Hinnant
2012-01-24 18:17:40 +0000
2a70c10984Move kOurExceptionClass and kOurDependentExceptionClass from source to header so that they can be used in multiple sources. This is a private header, these constants are not publicly exposed.
Howard Hinnant
2012-01-24 18:15:20 +0000
ae154287ddRemoved reference to internal header
Howard Hinnant
2012-01-24 00:52:33 +0000
ca6514dfeaChanged my mind about __cxa_uncaught_exception and added it.
Howard Hinnant
2012-01-24 00:01:31 +0000
8f696ff15cI renamed abort_message to be a C++ file to simplify my simplistic build script which I'm still working on. I also added a struct for the crash reporter on __APPLE__.
Howard Hinnant
2012-01-23 23:58:26 +0000
928afcd281A lot of the code in cxa_exception.cpp depends on __cxa_get_globals_fast() returning null if __cxa_get_globals() hasn't been called yet. However it doesn't reliably do that, at least on OS X if __cxa_get_globals_fast() is called prior to pthread_key_create() running. Our choice is to either limit our use of __cxa_get_globals_fast() more than we have, or to have __cxa_get_globals_fast() initialize with pthread_key_create() if necessary. I chose the latter, and replaced pthread_once with a C++11 local static (which should do the same thing).
Howard Hinnant
2012-01-23 23:55:58 +0000
9c6f621671Added missing #include
Howard Hinnant
2012-01-23 23:51:56 +0000
a1919d2ee2I'm beginning to be able to throw/catch a wide variety of objects.
Howard Hinnant
2012-01-23 18:39:47 +0000
c30bfdc7ffGetting started on matching a thrown exception to a catch clause, and setting the adjusted pointer to the caught object appearing in the catch clause.
Howard Hinnant
2012-01-22 21:47:40 +0000
a36fb308d6I kept getting confused among the __cxa_exception*, the _Unwind_Exception* and the void* to the thrown object. So I've gone through these two files and attempted to institute a consistent variable naming scheme, and in a few instances, turned void* into a concrete* to have the type system help me out. No change in functionality for this commit is intended.
Howard Hinnant
2012-01-22 19:14:27 +0000
facfc46ef3Add __shim_type_info which fits below std::type_info and above all of the other type_info-derived classes. This is where all of the virtual functions that serve as details of the inner-workings of type_info will live (safely hidden from public view). All type_info objects will be safely down-castable to __shim_type_info, so as to access implementation detail virtual functions. Also temporarily add some print/display statements to each type_info-derived class. This is in support of the continuing development on the personality function.
Howard Hinnant
2012-01-22 01:23:02 +0000
321a095c08Change header to generic, instead of implementation specific
Howard Hinnant
2012-01-22 01:19:20 +0000
65255631deOne more small optimization: Where possible, for loops that do a search and then try to break out of the loop early, eliminate the attempt to break out of the loop after the last search. And with that, I'm declaring __dynamic_cast done. Though if anyone sees any problems, has suggestions for improvements, or wants to contribute some test cases, that is certainly welcome feedback.
Howard Hinnant
2012-01-16 18:21:05 +0000
cc614df38cComment smithing. Changed some casts from C-style to C++. And added timings to all of the tests.
Howard Hinnant
2012-01-16 17:06:51 +0000
1309366d36I think this is getting close on __dynamic_cast. There's been quite a bit of code rearrangement, renaming, and better commenting. This exercise has exposed and fixed a few more bugs. I've also added several more tests (there's definitely a need for more tests here).
Howard Hinnant
2012-01-16 00:13:46 +0000
481fe05b27Two bug fixes, several clarifications, and a few comment updates.
Howard Hinnant
2012-01-14 14:15:43 +0000
271f1ac649A bug fix involving the updating of path_dst_ptr_to_static_ptr. Some minor code rearrangement optimizations (putting most likely 'if' first in an if-else series. And some major optimizations which involve stopping the search prior to an exhaustive walk over the entire tree. Some of these stops are because an ambiguity is detected earlier. And some of the short circuiting is due to the information from the bits __diamond_shaped_mask and __non_diamond_repeat_mask. The stress test checked in last night is now about 28% faster for the B<Width/2, Depth> -O3 case. I'm still playing with some more optimization possibilities but I'm not sure they will play out.
Howard Hinnant
2012-01-13 23:06:03 +0000
a39c104501Enclosed is a stress test for dynamic_cast. It stresses both libc++abi, and clang itself. It creates a ridiculously large class hierarchy using variadic templates. You can specify both the width and depth of the class hierarchy. And you can specify whether the cast is to the actual run time type, or to an intermediate layer in the class. About 1/3 of the time I compile this, it crashes the compiler. There seems to be an uninitialized area of memory, and I'm probably blowing past an assumption on class hierarchy size within clang (and understandably so). I can get it work most of the time with a class hierarchy width of 20 and a depth of 7. I'm making timings with both -O3 and -Os, using both cast to root and cast to intermediate, on both libc++abi, and gcc's dynamic_cast. I've put the results in a comment/table at the bottom of the test.
Howard Hinnant
2012-01-13 01:22:31 +0000
68fd743cd3Oops, forgot to svn add the new test.
Howard Hinnant
2012-01-12 21:08:25 +0000
9a1aad5a7fPut debug print statments under a flag so that I can get a first glimpse at performance. So far I haven't noticed any performance difference between this new __dynamic_cast and gcc's implementation. But I've barely started looking. Also adding a couple of tests which come straight out of the standard.
Howard Hinnant
2012-01-12 21:06:12 +0000
185dc7d61fFixed a couple of bugs, updated many comments, and am including a comprehensive test for when there are only 3 types in place. I need to do something similar for 4 and maybe more types, but I'm not sure how comprehensive I can make the test at 4 and above types.
Howard Hinnant
2012-01-12 19:48:14 +0000
f877d21f16Initial implementaiton of __dynamic_cast. There is still lots of debugging code in here that needs to be stripped out. And many, many unit tests need to be written. And comments and probably code cleanliness needs to be improved. But I *think* the basic algorithm is sound. There also may still be some oportunities for algorithm optimization, I'm not positive.
Howard Hinnant
2012-01-11 23:49:18 +0000
16650b58dfThis is a transitory commit for __dynamic_cast. It contains debugging statements that are not intended to be in the finished product. However some of the dubbing statements themselves contain important documentation such as how to navigate a __class_type_info hierarchy, documenting object offset and inheritance access. The intention is that this debugging code will migrate into both actual code and comments. And capturing it here so that there is no chance this stuff will be lost.
Howard Hinnant
2012-01-11 00:11:17 +0000
152beb7a42Getting a start on the typeinfo infrastructure.
Howard Hinnant
2012-01-09 17:10:00 +0000
3fa75e1680First brush with testing __gxx_personality_v0 reveals there is still a long way to go. But my understanding of what it is supposed to do continues to improve. I am currently contemplating whether I need to implement typeinfo before completing __gxx_personality_v0 in order to get matching catch handlers correct.
Howard Hinnant
2012-01-08 23:50:46 +0000
8ca7603d21Add a few TODO's and FIXME's. Making notes as I go along, but not slowing down to fix these yet. Just don't want anything to fall through the cracks.
Howard Hinnant
2012-01-08 23:40:41 +0000
acfbf36d94Correct comment regarding members of __cxa_dependent_exception. Actually it is useful to disguise a __cxa_dependent_exception as a __cxa_exception by filling in most (not all) of these members at __cxa_dependent_exception construction time. That way most routines don't have to care which kind of exception they have.
Howard Hinnant
2012-01-08 23:39:14 +0000
701d94c5dd__gxx_personality_v0 update. This is completely untested code. But my brain is scrambled and I wanted to get it checked in. Code review from anyone who knows anything at all about personality functions would be much appreciated. What is in here is borrowed heavily from llvm/examples/ExceptionDemo/ExceptionDemo.cpp. There are some calls to abort() that should probably be changed to return an error code instead. There may be encodings under readEncodedPointer that need to be implemented. And my handling of type_info is almost a complete guess.
Howard Hinnant
2012-01-06 20:39:47 +0000
0acbd98b56Improved comment to explain why we can use __cxa_get_globals_fast here
Marshall Clow
2012-01-04 22:18:10 +0000
ed2ea9bfd2Just getting started on the personality routine. This is just a skeleton. Still learning how to fill it in...
Howard Hinnant
2012-01-04 20:49:43 +0000
aeed3a90ceDon't allocate TLS storage when checking to see if an exception has been thrown - really
Marshall Clow
2012-01-03 23:26:09 +0000
62edc0172bDon't allocate TLS storage when checking to see if an exception has been thrown
Marshall Clow
2012-01-03 23:10:20 +0000
57d64cd19acredits adjustment
Howard Hinnant
2011-12-22 16:00:06 +0000
64e0097014Updated __cxa_current_exception_type to call __cxa_get_globals_fast - will not allocate globals
Marshall Clow
2011-12-22 15:45:05 +0000
50dbae0b85Updated spec.html regarding __cxa_uncaught_exception.
Howard Hinnant
2011-12-22 00:03:36 +0000
dd47ca4f1cForgot to increment uncaughtExceptions in __cxa_rethrow_primary_exception
Howard Hinnant
2011-12-21 23:48:05 +0000
1b0aed9312Added __cxa_increment_exception_refcount, __cxa_decrement_exception_refcount, __cxa_current_primary_exception, __cxa_rethrow_primary_exception
Howard Hinnant
2011-12-21 23:32:11 +0000
4a6e1033ecAdd new and delete operators
Howard Hinnant
2011-12-20 20:38:05 +0000
ab87dcf97eFixed several bugs, implemented support for vector types, and cleaned out dead code.
Howard Hinnant
2011-12-15 20:02:15 +0000
5ee51a7062Fix size calculation for pointer to member function
Howard Hinnant
2011-12-13 01:23:16 +0000
d4028fe9faMade some minor tweaks to __cxa_rethrow
Howard Hinnant
2011-12-12 19:11:42 +0000
b5fea43d2dAdded dependent exception support to __cxa_current_exception_type
Howard Hinnant
2011-12-12 18:16:10 +0000
f270035a31Added support for <special-name> ::= TC <first type> <number> _ <second type> # construction vtable for second-in-first, and for <special-name> ::= GR <object name> # reference temporary for object
Howard Hinnant
2011-12-09 20:07:56 +0000
6eb54ad96eModified __cxa_end_catch to handle dependent exceptions.
Howard Hinnant
2011-12-08 19:35:18 +0000
e8fcf83b57Reviewing cxa_exception.cpp and marking as implemented as I go. Not marking as implemented on arm when I'm not sure about that platform.
Howard Hinnant
2011-12-07 21:16:40 +0000
cd081650f8Added __cxa_allocate_dependent_exception and __cxa_free_dependent_exception and marked them as done.
Howard Hinnant
2011-12-07 18:30:06 +0000
fb271ad9c5Substituted std::get_terminate() for direct access to the handler function pointer (which is now a static in cxa_handlers.cpp). This has the advantage of going through the atomic API and so is less likely to cause a data race. Ditto for unexpected.
Howard Hinnant
2011-12-06 19:02:03 +0000
b9f2cc816dAdd/update copyright notices
Howard Hinnant
2011-12-06 18:01:47 +0000