This is the mail archive of the
mailing list for the GCC project.
Re: Would like to make one version of is_too_expensive in gcse.c and cprop.c
- From: Jeff Law <law at redhat dot com>
- To: Bradley Lucier <lucier at math dot purdue dot edu>, gcc at gcc dot gnu dot org
- Date: Wed, 11 Nov 2015 00:50:56 -0700
- Subject: Re: Would like to make one version of is_too_expensive in gcse.c and cprop.c
- Authentication-results: sourceware.org; auth=none
- References: <5642AC03 dot 90602 at math dot purdue dot edu>
On 11/10/2015 07:46 PM, Bradley Lucier wrote:
Yes, this would be fine. In fact, removing duplicates of this nature is
a good thing.
The routines declared as
is_too_expensive (const char *pass)
in both cprop.c and gcse.c are identical except for two comment lines.
I'd like to modify is_too_expensive, which implied to me that there
should be only one copy of the routine.
Would it be reasonable to add an extern declaration of is_too_expensive
(with perhaps a more descriptive name) in gcse.h, remove the static
declaration from gcse.c, include gcse.h in cprop.c?
(I realize this is a very simple question for regular C programmers, but
I'm not a regular C programmer, sorry).