This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Lazy allocation of DECL_ASSEMBLER_NAME
Could you mention this in the documentation of DECL_ASSEMBLER_NAME in
c-tree.texi?
I committed the attached patch to the mainline.
--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com
2004-03-02 Mark Mitchell <mark@codesourcery.com>
* doc/c-tree.texi (DECL_ASSEMBLER_NAME): Mention that using this
macro results in memory allocation.
Index: c-tree.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/c-tree.texi,v
retrieving revision 1.52
diff -c -5 -p -r1.52 c-tree.texi
*** c-tree.texi 18 Jan 2004 11:57:11 -0000 1.52
--- c-tree.texi 2 Mar 2004 16:57:12 -0000
*************** name is computed in the same way on all
*** 1103,1112 ****
--- 1103,1119 ----
is required to deal with the object file format used on a particular
platform, it is the responsibility of the back end to perform those
modifications. (Of course, the back end should not modify
@code{DECL_ASSEMBLER_NAME} itself.)
+ Using @code{DECL_ASSEMBLER_NAME} will cause additional memory to be
+ allocated (for the mangled name of the entity) so it should be used
+ only when emitting assembly code. It should not be used within the
+ optimizers to determine whether or not two declarations are the same,
+ even though some of the existing optimizers do use it in that way.
+ These uses will be removed over time.
+
@item DECL_EXTERNAL
This predicate holds if the function is undefined.
@item TREE_PUBLIC
This predicate holds if the function has external linkage.