type_info::name question
Mark Mitchell
mark@markmitchell.com
Tue Oct 13 19:22:00 GMT 1998
>>>>> "Mike" == Mike Stump <mrs@wrs.com> writes:
>> To: kunert@physik.tu-dresden.de, egcs@cygnus.com From: Jason
>> Merrill <jason@cygnus.com> Date: 11 Oct 1998 13:12:38 -0700
>> How would people feel about including the demangler in libgcc,
>> and calling from type_info::name?
Mike> The only concerns I guess I have are:
Mike> kankakee bash[42] size cxxmain.o text data bss dec hex
Mike> filename 24349 120 4 24473 5f99 cxxmain.o
I agree with Mike. I think the two consistent approaches are to put
the fully demangled names directly into the object file, and to keep
things as they are. I don't really think the demangler should be in
libgcc.
I think the right solution is to install a new header file with a well
documented demangling interface, along with the code to do the
demangling. We don't need the full complexity of demangle.h, just
__demangle_name (const char*) or some such. On many compilers, this
is a separate library (libdemangle), and I think that's what we should
do, too; it's a C++-specific (and maybe Java) concept, and it doesn't
really need to take up space in libgcc.a. This library should be
created/installed only if LANGUAGES contains C++ (Java?).
Another advantage of this approach over your suggestion is that you
can use the demangler for more than just RTTI: for example, you could
demangle names used with dlsym and friends.
--
Mark Mitchell mark@markmitchell.com
Mark Mitchell Consulting http://www.markmitchell.com
More information about the Gcc
mailing list