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]

[RFA:] Demangler patch for type_info node/function


If it's ok with Dan Berlin, perhaps I can help with
maintainership of the old demangler.

Here's a patch for one of the problems Carlo Wood reported a
week ago.  Anything you "catch" will lead to a type_info node;
not restricted to templates or quali::fied types.  It can be a
pointer, for instance.  See also
<URL:http://gcc.gnu.org/ml/gcc/2000-09/msg00005.html>.  Note
that a space before "*" seems to be standard for the demangler
output.

If approved, I'll commit to the src repository too.

Ok to commit?

libiberty:
2000-09-10  Hans-Peter Nilsson  <hp@axis.com>

	* testsuite/demangle-expected: Add four tests for type_info
	pointer mangling.

	* cplus-dem.c (gnu_special): Use do_type, not demangle_fund_type,
	for a non-template non-qualified type_info function or node.

Index: testsuite/demangle-expected
===================================================================
RCS file: /cvs/gcc/egcs/libiberty/testsuite/demangle-expected,v
retrieving revision 1.5
diff -p -c -r1.5 demangle-expected
*** demangle-expected	2000/08/31 21:44:25	1.5
--- demangle-expected	2000/09/10 17:50:36
*************** TA<int, N___A___<-99> >::foo__bar___foob
*** 2542,2544 ****
--- 2542,2560 ----
  --format=gnu
  foo__bar___foobar_____t2TA2ZiZt4N__A1i9
  TA<int, N__A<9> >::foo__bar___foobar___(void)
+ #
+ --format=gnu
+ __tfP8sockaddr
+ sockaddr * type_info function
+ #
+ --format=gnu
+ __tfPQ25libcwt16option_event_tct1Z12burst_app_ct
+ libcw::option_event_tct<burst_app_ct> * type_info function
+ #
+ --format=gnu
+ __tiP8sockaddr
+ sockaddr * type_info node
+ #
+ --format=gnu
+ __tiPQ25libcwt16option_event_tct1Z12burst_app_ct
+ libcw::option_event_tct<burst_app_ct> * type_info node

Index: cplus-dem.c
===================================================================
RCS file: /cvs/gcc/egcs/libiberty/cplus-dem.c,v
retrieving revision 1.61
diff -p -c -r1.61 cplus-dem.c
*** cplus-dem.c	2000/09/05 01:01:12	1.61
--- cplus-dem.c	2000/09/10 17:30:24
*************** gnu_special (work, mangled, declp)
*** 2872,2878 ****
  	  success = demangle_template (work, mangled, declp, 0, 1, 1);
  	  break;
  	default:
! 	  success = demangle_fund_type (work, mangled, declp);
  	  break;
  	}
        if (success && **mangled != '\0')
--- 2872,2878 ----
  	  success = demangle_template (work, mangled, declp, 0, 1, 1);
  	  break;
  	default:
! 	  success = do_type (work, mangled, declp);
  	  break;
  	}
        if (success && **mangled != '\0')

brgds, H-P

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