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: Patch: Prune unused DECL_STMTs from saved tree structure


>>>>> "Jeffrey" == Jeffrey A Law <law@cygnus.com> writes:

    Jeffrey>   In message
    Jeffrey> <20000829093335W.mitchell@codesourcery.com>you write:
    >>  > * c-semantics.c (remove_unused_decls, >
    >> remove_unused_decls_from_block): New functions.  > *
    >> c-common.h: Prototype remove_unused_decls.  > cp: > *
    >> semantics.c (finish_stmt_tree): Call remove_unused_decls.  This
    >> is fine.  Please install this patch.
    >> 
    >> Oh, dear.  And here I was about to say that we should be using
    >> walk_tree for this instead.
    Jeffrey> OK.  Then let's have it use walk_tree.  I don't think
    Jeffrey> Zack has checked in the change yet (I approved it just a
    Jeffrey> few minutes ago).

    Jeffrey> Presumably walk_tree doesn't look at any nodes we don't
    Jeffrey> want to look at in this code?  I believe there was some
    Jeffrey> question about following the TREE_CHAINs in some of the
    Jeffrey> nodes.

Good question.  walk_tree is pretty flexible -- you can give it hints
about how to walk -- but perhaps it is not worth the bother.  Zack,
why don't you take a quick look, and if you can't make it work, use
your original patch.  We can always switch it later.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

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