Re: secondary expansion changes

Boris Kolpackov <[email protected]>
Newsgroups gmane.comp.gnu.make.devel
Organization Code Synthesis Tools CC
Message-ID <[email protected]>
Hi Paul,

Paul D. Smith <[email protected]> writes:

> >  %.o: CFLAGS := -g
> >  %.o: CFLAGS := -g
> >  %.o: CFLAGS := -g
> > 
> >  All three assignments will end up in the list. I wonder if we can
> >  be smarter here?]
> 
> Do you mean there are three instances of the "%.o" pattern rule?

I mean that there will be three identical entries in the 
variables.c:pattern_vars list. I don't think we even need to keep
identical variables with different values. For example:

%.o: CFLAGS := -g
%.o: CFLAGS := -O3

Here we only need to keep the last assignment in pattern_vars
since the first one will never be used.


> Sure, we can fix this, at a bit of performance cost (well, "a bit"
> depends on how many pattern-specific variables you have).  We have to
> preserve the order because, just like pattern rules, they are searched
> in order.  Either we could just linearly search them to see if we
> already have one, or we could create a look-aside hash for them if a
> linear search was too slow.

Yes, we can try this. Though this is all just guessing. What I am 
planning to do later is fire up oprofile and really find out where 
all this time is spent.


> > http://www.codesynthesis.com/~boris/tmp/make-valgrind.log
> 
> Oops:
> 
>         You don't have permission to
>         access /~boris/tmp/make-valgrind.log on this server.

Sorry, fixed now.

Boris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.