RFC: Make a standalone GNU V3 C++ demangler

H. J. Lu hjl@lucon.org
Wed Apr 23 23:49:00 GMT 2003


It is known that the curren GNU V3 C++ demangler in libiberty has many
shortcomings and the one in libstdc++-v3 works much better. Noone seems
maintaining the libiberty demangler while the one in libstdc++ is being
actively worked on by Carlo. This is an attempt to create a standalone
GNU V3 C++ demangler and make it available to libiberty. The main
reason to make it standalone is this demangler is in C++ and requires
a working C++ compiler with a working <vector>. That means it can only
be built after libstdc++ is available. The standalone demangler will
be built after libiberty and libstdc++ are completed. I am enclosing 2
patches here. One is for demangler and the other is for libstdc++ to
use it. The demangler's patch is also for binutils. I have tested them
natively on gcc mainline and binutils under RedHat 9 and I didn't
notice any problems.

Known issues:

1. Although I tried to deal with the case where no C++ compiler is
available, I didn't test it myself. Let me know if there is a problem.
2. I didn't test cross build. I don't expect there are many serious
problems. Again let me know if there is a problem.
3. Multi-lib support is incomplete. Someone who is familiar with it
should look into it.

BTW, after applying demangler-new.patch.gz, you need to run autoconf
2.13 at the top level to regenerate configure.

Here are ChangeLog entries. Any comments are welcome.

BTW, please CC me since I am not on gcc-patches@gcc.gnu.org.


H.J.
---
2003-04-23  H.J. Lu <hjl@gnu.org>

	* Makefile.def: Add demangler.
	* Makefile.tpl: Likewise.
	* configure.in: Likewise.

	* Makefile.in: Regenerated.
	* configure: Likewise.

demangler/

2003-04-23  H.J. Lu <hjl@gnu.org>

	* Makefile.am: New file.
	* Makefile.in: Likewise.
	* acinclude.m4: Likewise.
	* aclocal.m4: Likewise.
	* configure: Likewise.
	* configure.in: Likewise.

2003-04-23  Carlo Wood  <carlo@alinoe.com>
	    H.J. Lu <hjl@gnu.org>

	* allocator.h: New C++ file.
	* demangler.cc: Likewise.
	* demangler.h: Likewise.
	* dynstring.h: Likewise.

libiberty/

2003-04-23  H.J. Lu <hjl@gnu.org>

	* testsuite/demangle-expected: Add more GNU V3 testcases.

libstdc++-v3/

2003-04-19  H.J. Lu <hjl@gnu.org>

	* include/Makefile.am (bits_headers): Remove
	${bits_srcdir}/demangle.h.
	* include/Makefile.in: Regenerated.

	* include/bits/demangle.h: Removed.

	* libsupc++/Makefile.am (headers): Add bits/demangle.h.
	(sources): Add demangle.cc.
	(demangle.lo): New rule.
	(demangle.o): Likewise.
	(demangle.cc): Likewise.
	(bits/demangle.h): Likewise.
	(install-glibcppinstallHEADERS): Install bits/demangle.h.
	* libsupc++/Makefile.in: Regenerated.

	* src/Makefile.am (sources): Remove demangle.cc.
	(demangle.lo): Likewise.
	(demangle.o): Likewise.
	* src/Makefile.in: Regenerated.

	* src/demangle.cc: Removed.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: demangler-new.patch.gz
Type: application/x-gzip
Size: 54644 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20030423/5d9a3aab/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3.4-libstdc++-demangler.patch.gz
Type: application/x-gzip
Size: 22921 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20030423/5d9a3aab/attachment-0001.bin>


More information about the Gcc-patches mailing list