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]

Re: Another 3 debug hooks


On Fri, Jul 20, 2001 at 12:22:32AM +0100, Neil Booth wrote:
> In the meantime :-), here's a couple more hooks.  Sadly, for sdb at
> least, global decls seem to be exported at decl assembly time or at
> end-of-compilation time depending upon the decl.  So I've made that a
> parameter to the function, rather than a member of the debug hooks
> structure.

You know, it would be a lot cleaner if sdbout took care of this
itself.  That is, global_decl it gets called at the same time
as for everyone else, but it puts the decls that it wants to
deferr on a queue.  These would be emitted in debug->finish.

Careful that you get this queue registered as a GC root.

You probably want to use a VARRAY like so:

  varray_type sdb_deferred_globals;

  VARRAY_TREE_INIT (sdb_deferred_globals, 8, "sdb_deferred_globals");
  ggc_add_tree_varray_root (&sdb_deferred_globals, 1);

  if (do it later)
    VARRAY_PUSH_TREE (sdb_deferred_globals, decl);


r~


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