This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] Demangle a couple of typeid.name() in the testsuite


Hi,

it's just that I don't like mangled names in the outputs ;)

Tested x86-linux.

Paolo.

///////////////
2004-01-09  Paolo Carlini  <pcarlini@suse.de>

	* testsuite/performance/allocator.cc: Demangle typeid(obj).name().
	* testsuite/performance/allocator_thread.cc: Likewise.
diff -urN libstdc++-v3-orig/testsuite/performance/allocator.cc libstdc++-v3/testsuite/performance/allocator.cc
--- libstdc++-v3-orig/testsuite/performance/allocator.cc	2004-01-07 06:59:19.000000000 +0100
+++ libstdc++-v3/testsuite/performance/allocator.cc	2004-01-09 10:57:42.000000000 +0100
@@ -39,6 +39,7 @@
 #include <sstream>
 #include <ext/mt_allocator.h>
 #include <ext/malloc_allocator.h>
+#include <cxxabi.h>
 #include <testsuite_performance.h>
 
 using namespace std;
@@ -108,6 +109,7 @@
   test_container(Container obj)
   {
     using namespace __gnu_test;
+    int status;
 
     time_counter time;
     resource_counter resource;
@@ -118,7 +120,8 @@
  
     std::ostringstream comment;
     comment << "iterations: " << test_iterations << '\t';
-    comment << "type: " << typeid(obj).name();
+    comment << "type: " << abi::__cxa_demangle(typeid(obj).name(),
+					       0, 0, &status);
     report_header(__FILE__, comment.str());
     report_performance(__FILE__, string(), time, resource);
   }
diff -urN libstdc++-v3-orig/testsuite/performance/allocator_thread.cc libstdc++-v3/testsuite/performance/allocator_thread.cc
--- libstdc++-v3-orig/testsuite/performance/allocator_thread.cc	2004-01-07 06:59:19.000000000 +0100
+++ libstdc++-v3/testsuite/performance/allocator_thread.cc	2004-01-09 10:57:33.000000000 +0100
@@ -40,6 +40,7 @@
 #include <pthread.h>
 #include <ext/mt_allocator.h>
 #include <ext/malloc_allocator.h>
+#include <cxxabi.h>
 #include <testsuite_performance.h>
 
 using namespace std;
@@ -110,6 +111,8 @@
   test_container(Container obj)
   {
     using namespace __gnu_test;
+    int status;
+
     time_counter time;
     resource_counter resource;
 
@@ -131,7 +134,8 @@
  
     std::ostringstream comment;
     comment << "iterations: " << iterations << '\t';
-    comment << "type: " << typeid(obj).name();
+    comment << "type: " << abi::__cxa_demangle(typeid(obj).name(),
+					       0, 0, &status);
     report_header(__FILE__, comment.str());
     report_performance(__FILE__, string(), time, resource);
   }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]