OSDN Git Service

Update gxxint.texi to include squangling info
authoramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 30 Apr 1998 10:11:45 +0000 (10:11 +0000)
committeramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 30 Apr 1998 10:11:45 +0000 (10:11 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19502 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/gxxint.texi

index c9c51bb..bbff3a0 100644 (file)
@@ -1,3 +1,7 @@
+Thu Apr 30 13:05:33 EDT 1998  Andrew MacLeod  <amacleod@cygnus.com>
+
+       * gxxint.texi: Add info for squangling codes K and B.
+
 Tue Apr 28 13:22:01 1998  Mark Mitchell  <mmitchell@usa.net>
 
        * semantics.c (begin_stmt_expr): Avoid duplicating the effect of
index 6527d08..4868c27 100644 (file)
@@ -1664,6 +1664,39 @@ A Java object reference type is equivalent
 to a C++ pointer parameter, so we mangle such an parameter type
 as @samp{P} followed by the mangling of the class name.
 
+@subsection Squangled type compression
+
+Squangling (enabled with the @samp{-fsquangle} option), utilizes 
+the @samp{B} code to indicate reuse of a previously
+seen type within an indentifier. Types are recognized in a left to
+right manner and given increasing values, which are
+appended to the code in the standard manner. Ie, multiple digit numbers
+are delimited by @samp{_} characters. A type is considered to be any 
+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. 
+These codes may precede a @samp{B} type in order to make the required 
+modifications to the type.
+
+For example:
+@example
+template <class T> class class1 @{ @};
+
+template <class T> class class2 @{ @};
+
+class class3 @{ @};
+
+int f(class2<class1<class3> > a ,int b, const class1<class3>&c, class3 *d) @{ @}
+
+    B0 -> class2<class1<class3>
+    B1 -> class1<class3>
+    B2 -> class3
+@end example
+Produces the mangled name @samp{f__FGt6class21Zt6class11Z6class3iRCB1PB2}.
+The int parameter is a basic type, and does not receive a B encoding...
+
 @subsection Qualified names
 
 Both C++ and Java allow a class to be lexically nested inside another
@@ -1680,6 +1713,40 @@ Then follows each part of the qualified name, as described above.
 For example @code{Foo::\u0319::Bar} is encoded as
 @samp{Q33FooU5_03193Bar}.
 
+Squangling utilizes the the letter @samp{K} to indicate a 
+remembered portion of a qualified name. As qualified names are processed
+for an identifier, the names are numbered and remembered in a 
+manner similar to the @samp{B} type compression code. 
+Names are recognized left to right, and given increasing values, which are
+appended to the code in the standard manner. ie, multiple digit numbers
+are delimited by @samp{_} characters.
+
+For example 
+@example
+class Andrew 
+@{
+  class WasHere 
+  @{
+      class AndHereToo 
+      @{
+      @};
+  @};
+@};
+
+f(Andrew&r1, Andrew::WasHere& r2, Andrew::WasHere::AndHereToo& r3) @{ @}
+
+   K0 ->  Andrew
+   K1 ->  Andrew::WasHere
+   K2 ->  Andrew::WasHere::AndHereToo
+@end example
+Function @samp{f()} would be mangled as : 
+@samp{f__FR6AndrewRQ2K07WasHereRQ2K110AndHereToo}
+
+There are some occasions when either a @samp{B} or @samp{K} code could
+be chosen, preference is always given to the @samp{B} code. Ie, the example
+in the section on @samp{B} mangling could have used a @samp{K} code 
+instead of @samp{B2}.
+
 @subsection Templates
 
 A class template instantiation is encoded as the letter @samp{t},
@@ -1747,7 +1814,7 @@ Encodes the C++ @code{bool} type,
 and the Java @code{boolean} type.
 
 @item B
-Used for squangling.
+Used for squangling. Similar in concept to the 'T' non-squangled code.
 
 @item c
 Encodes the C++ @code{char} type, and the Java @code{byte} type.
@@ -1782,7 +1849,7 @@ Encodes the C++ and Java @code{int} types.
 Indicates a complex type.
 
 @item K
-Used for squangling.
+Used by squangling to compress qualified names.
 
 @item l
 Encodes the C++ @code{long} type.