diff options
author | Andrew MacLeod <amacleod@cygnus.com> | 1998-04-30 10:11:45 +0000 |
---|---|---|
committer | Andrew Macleod <amacleod@gcc.gnu.org> | 1998-04-30 10:11:45 +0000 |
commit | 61fbdb55bdf16f021d24f6b8130abe3f14d34dd9 (patch) | |
tree | cc97ec5dac35a36144a4806bd4bffc5fbd672eb4 | |
parent | d6bcc74ac6145adf20574e585ce5cb49a26302b8 (diff) | |
download | gcc-61fbdb55bdf16f021d24f6b8130abe3f14d34dd9.zip gcc-61fbdb55bdf16f021d24f6b8130abe3f14d34dd9.tar.gz gcc-61fbdb55bdf16f021d24f6b8130abe3f14d34dd9.tar.bz2 |
Update gxxint.texi to include squangling info
From-SVN: r19502
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/gxxint.texi | 71 |
2 files changed, 73 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c9c51bb..bbff3a0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/gxxint.texi b/gcc/cp/gxxint.texi index 6527d08..4868c27 100644 --- a/gcc/cp/gxxint.texi +++ b/gcc/cp/gxxint.texi @@ -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. |