Article View: gnu.g++.help
Article #523name mangler
From: Paul Vaughan
Date: Tue, 02 Apr 1991 16:05
Date: Tue, 02 Apr 1991 16:05
46 lines
2310 bytes
2310 bytes
You need to do the whole job because of typedefs. I.e.,
typedef int foo;
typedef int bar;
foo f (bar);
I was thinking that in the "function specification language", typedefs
in this sense would not be allowed. Even though foo might be declared
foo f(bar);
in some source code, it would have to be declared
int f(int)
in a function specification to be accepted by the mangler. Note that
there are other differences between this function specification
language and C++. For instance,
class Foo {
int foo(Foo*);
};
int Foo::foo(Foo*);
isn't a valid declaration in C++. (Oooh, speaking of valid C++, note
that the above is accepted by g++-1.39 but not by cfront 2.0--bug?.)
I was thinking that any identifier (name other than reserved words,
symbols, or basic types) would be assumed to directly name a user
defined type. Typedefed aliases or full anonymous struct definitions
would not be accepted.
It seems clear that one requirement would be that the mangler be able
to accept any output generated by the demangler and vice versa. I
think the simplifications I'm making are consistent with that. However
it's not clear what other requirements exist for a useful tool. For
instance, these specs would not necessarily let you directly use
pieces of source code or output from the compiler as input to the
mangler. I don't see any way of creating such a mangler without
analyzing the entire source code for a module and that's significantly
more work than I want the mangler to do. Aside from compilation, it
seems the reason most people have cited for wanting a mangler is for
dynamic loading. I'm not sure if these simplifications would
adequately support that.
Technical Details
Message-ID:
<9104021605.AA09745@puma.cad.mcc.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!tut.cis.ohio-state.edu!unreplyable!garbageReferences:
<9104020404.AA19492@cygnus.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!tut.cis.ohio-state.edu!unreplyable!garbage From: vaughan%cadillac.cad.mcc.com@MCC.COM (Paul Vaughan) Newsgroups: gnu.g++.help,comp.lang.c++ Subject: name mangler Message-ID: <9104021605.AA09745@puma.cad.mcc.com> Date: 2 Apr 91 16:05:14 GMT References: <9104020404.AA19492@cygnus.com> Sender: daemon@tut.cis.ohio-state.edu Followup-To: gnu.g++.help Distribution: world Organization: Gatewayed from the GNU Project mailing list help-g++@prep.ai.mit.edu Lines: 48