Commit Graph

74 Commits

Author SHA1 Message Date
Howard Hinnant 242566e552 Change header to generic, instead of implementation specific
llvm-svn: 148646
2012-01-22 01:19:20 +00:00
Howard Hinnant b24c9441d1 One 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.
llvm-svn: 148246
2012-01-16 18:21:05 +00:00
Howard Hinnant 44a2895a03 Comment smithing. Changed some casts from C-style to C++. And added timings to all of the tests.
llvm-svn: 148241
2012-01-16 17:06:51 +00:00
Howard Hinnant 77fb8ab9f2 I 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).
llvm-svn: 148227
2012-01-16 00:13:46 +00:00
Howard Hinnant 50f7eeec9d Enclosed 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.
llvm-svn: 148083
2012-01-13 01:22:31 +00:00
Howard Hinnant b1ca881191 Oops, forgot to svn add the new test.
llvm-svn: 148047
2012-01-12 21:08:25 +00:00
Howard Hinnant b7d59ec6e1 Put 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.
llvm-svn: 148046
2012-01-12 21:06:12 +00:00
Howard Hinnant af07bfdb67 Fixed 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.
llvm-svn: 148038
2012-01-12 19:48:14 +00:00
Howard Hinnant bf8a39bb94 Fixed several bugs, implemented support for vector types, and cleaned out dead code.
llvm-svn: 146677
2011-12-15 20:02:15 +00:00
Howard Hinnant 7a084fdd39 Fix size calculation for pointer to member function
llvm-svn: 146463
2011-12-13 01:23:16 +00:00
Howard Hinnant 8de583abf2 Added 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
llvm-svn: 146274
2011-12-09 20:07:56 +00:00
Howard Hinnant 987afbeede Add/update copyright notices
llvm-svn: 145949
2011-12-06 18:01:47 +00:00
Howard Hinnant dc82cca6bf Updated heuristic regulating small string buffer
llvm-svn: 145543
2011-12-01 00:08:59 +00:00
Howard Hinnant 26a9d23657 demangler: Drop preceeding () from function types, but not from pointers and references to function types
llvm-svn: 137469
2011-08-12 17:33:10 +00:00
Marshall Clow e2dcb75b2e Memory manangement routines for exception objects
llvm-svn: 135587
2011-07-20 15:04:39 +00:00
Marshall Clow 1df50ca6a2 Exception handling stuctures, and thread-local variables for exception handling
llvm-svn: 135586
2011-07-20 14:53:53 +00:00
Howard Hinnant 471e111324 In cxa_demangle.cpp, rewrite __parse_unresolved_name to reflect updated understanding and sync with updated clang mangling. Also fix think-o in __parse_encoding enabling the parsing of trailing .eh and .b.
llvm-svn: 133632
2011-06-22 19:27:39 +00:00
Marshall Clow 92091dbe41 Clean up the vector tests
llvm-svn: 132921
2011-06-13 17:57:10 +00:00
Marshall Clow 280ddee8bd Implement vector new and delete functionality
llvm-svn: 132832
2011-06-10 03:40:19 +00:00
Howard Hinnant 575498b52f tabs to spaces
llvm-svn: 132729
2011-06-07 19:56:49 +00:00
Nick Lewycky 6fde150697 Add more tests for cxa_guard methods. This includes our first two tests using
actual threads!

There's no build file for libcxxabi, so I'll tell you that I built it with this:
$ g++-4.6 -pthread -std=gnu++0x test_guard.cpp ../src/cxa_guard.o -o test_guard

llvm-svn: 132644
2011-06-04 18:01:24 +00:00
Marshall Clow f8da5b22af Tests for bad_typeid and bad_cast
llvm-svn: 132545
2011-06-03 13:54:37 +00:00
Howard Hinnant 4a88971ac1 Introduce cxa_virtual.cpp and cxa_guard.cpp. Contributed by Nick Lewycky, Howard Hinnant and John McCall
llvm-svn: 132009
2011-05-24 22:01:16 +00:00
Howard Hinnant d3da57f99b initial import
llvm-svn: 130921
2011-05-05 15:27:28 +00:00