This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] -gused



On Friday, June 20, 2003, at 4:23 PM, Richard Henderson wrote:


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.

Yes. I'll remove this redundant line.


-     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.

It is to intercept call from outside. dbxout_symbol now only emits symbols
which are used so this is done to avoid overwriting TREE_USED bit
unnecessarily.



*************** 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?

Need to write free_symbol_queue() :-)



+       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?

I have not thought much about this.


Any reason this is part of the public interface?

Because I need to write free_symbol_queue() :-)


+ 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.

Can you explain this little bit more?.


-Devang


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]