This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Mangling
- To: mark at markmitchell dot com
- Subject: Mangling
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Sat, 24 Oct 1998 11:04:31 +0100
- Cc: egcs-patches at cygnus dot com
Hi Mark,
I think there are some errors in your update of gxxint.texi. The N
code is not used for namespaces, they use Q instead. N is generated
for repeated types, such as
struct StructureName{};
void f(StructureName,StructureName,StructureName)
{}
which gives f__FG13StructureNameN20. Theoretically,
f__FG13StructureNameiN20 would be
void f(StructureName,int,StructureName,StructureName)
{}
but g++ genereates f__FG13StructureNameiT0T0 here. Under squangling,
the first one becomes f__FG13StructureNamen2 ('n' code, not demangled
yet), whereas the latter becomes f__FG13StructureNameiB0n1.
I'll check in the patch below.
Martin
1998-10-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
* gxxint.texi: Correct documentation for n, N, Q, and B.
Index: gxxint.texi
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/gxxint.texi,v
retrieving revision 1.13
diff -u -r1.13 gxxint.texi
--- gxxint.texi 1998/10/23 14:53:04 1.13
+++ gxxint.texi 1998/10/24 09:48:17
@@ -1604,8 +1604,8 @@
non primitive type, regardless of whether its a parameter, template
parameter, or entire template. Certain codes are considered modifiers
of a type, and are not included as part of the type. These are the
-@samp{C}, @samp{V}, @samp{P}, @samp{A}, @samp{R}, and @samp{U} codes,
-denoting constant, volatile, pointer, array, reference, and unsigned.
+@samp{C}, @samp{V}, @samp{P}, @samp{A}, @samp{R}, @samp{U} and @samp{u} codes,
+denoting constant, volatile, pointer, array, reference, unsigned, and restrict.
These codes may precede a @samp{B} type in order to make the required
modifications to the type.
@@ -1784,17 +1784,20 @@
Encodes the C++ @code{long} type.
@item n
-Used with squangling.
+Immediate repeated type. Followed by the repeat count.
@item N
-Namespaces.
+Repeated type. Followed by the repeat count of the repeated type,
+followed by the type index of the repeated type. Due to a bug in
+g++ 2.7.2, this is only generated if index is 0. Superceded by
+@samp{n} when squangling.
@item P
Indicates a pointer type. Followed by the type pointed to.
@item Q
Used to mangle qualified names, which arise from nested classes.
-Should also be used for namespaces (?).
+Also used for namespaces.
In Java used to mangle package-qualified names, and inner classes.
@item r