This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] -gused
On Fri, Jun 20, 2003 at 03:37:50PM -0700, Devang Patel wrote:
> --- gcc/dbxout.c 20 Jun 2003 22:27:25 -0000
> + extern int flag_debug_only_used_symbols;
Should be in flags.h.
> - dbxout_symbol (decl, 0);
> + {
> + int saved_tree_used = TREE_USED (decl);
> + TREE_USED (decl) = 1;
> + dbxout_symbol (decl, 0);
> + TREE_USED (decl) = saved_tree_used;
> + }
Why? Should definitely be a comment there, whatever the answer is.
> *************** dbxout_finish (filename)
> *** 719,724 ****
> --- 732,743 ----
> #ifdef DBX_OUTPUT_MAIN_SOURCE_FILE_END
> DBX_OUTPUT_MAIN_SOURCE_FILE_END (asmfile, filename);
> #endif /* DBX_OUTPUT_MAIN_SOURCE_FILE_END */
> + if (symbol_queue)
> + {
> + free (symbol_queue);
> + symbol_queue = NULL;
> + symbol_queue_size = 0;
> + }
Didn't get moved?
> + if ((TREE_CODE (type) == RECORD_TYPE
> + || TREE_CODE (type) == UNION_TYPE
> + || TREE_CODE (type) == QUAL_UNION_TYPE
> + || TREE_CODE (type) == ENUMERAL_TYPE)
> + && TYPE_STUB_DECL (type)
> + && TREE_CODE_CLASS (TREE_CODE (TYPE_STUB_DECL (type))) == 'd'
> + && ! DECL_IGNORED_P (TYPE_STUB_DECL (type)))
You have this complex test replicated many times. Seems like
you'd just send in "type" and be done with it.
> + extern tree *symbol_queue;
> + extern int symbol_queue_index;
> + extern int symbol_queue_size;
VARRAY? Any reason this is part of the public interface?
> + debug_queue_symbol (tree decl)
I'd actually had it in my head to have final call the queueing
functions directly, instead of the calling the debug functions
directly. Not that this just be a library for the debug functions
to call.
r~