This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [cfg] [RFC] Real datastructure for dominance information
- From: DJ Delorie <dj at redhat dot com>
- To: jh at suse dot cz
- Cc: gcc-patches at gcc dot gnu dot org, bim at artax dot karlin dot mff dot cuni dot cz, rakdver at atrey dot karlin dot mff dot cuni dot cz, gcc-pdo at atrey dot karlin dot mff dot cuni dot cz
- Date: Thu, 6 Jun 2002 19:01:43 -0400
- Subject: Re: [cfg] [RFC] Real datastructure for dominance information
- References: <20020606210417.GA16130@atrey.karlin.mff.cuni.cz>
Documentation should be in libiberty.texi, not in the .h file.
+ /* ET-trees datastructure implementation.
+ Contributed by Pavel Nejedly
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions.
There is no Cygnus Solutions. Does Pavel have suitable assignments
for libiberty? Remember that libiberty code is also used in gdb and
binutils, so I don't know if a generic gcc assignment would be enough.
Jeff?
+ #include <ansidecl.h>
Should be "ansidecl.h"
> DJ: I still plan some changes to et-forest datastructure,
+ struct et_forest
Note that once something's in libiberty, it's pretty much cast in
stone, because other projects will start using it also. You might
want to put this in gcc for a while until the API settles (or until
some other project wants to use it, whichever comes *last*). Figuring
out a way to hide the structure definition (i.e. by not defining it in
the .h) would allow you to change it in the future.
+ int
+ calculate_value (node)
Global?
+ et_forest_t forest = xmalloc (sizeof (struct et_forest));
hashtab just changed to support allocation hooks. You should either
do that, or use malloc(); and properly propogate errors back to the
caller. BFD, for example, has a rule against using xmalloc.
Plus, htab_create seems to have been rendered obsolete, and you don't
check for htab_create() returning NULL anyway.
+ abort ();
Errors should be properly propogated back to the caller. Calling
abort() from a library function is a Bad Idea (especially as abort()
in libiberty is *not* fancy_abort()).