Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make Back out last night's optimization for now.
details: https://anonhg.NetBSD.org/src/rev/32fd02490bfd
branches: trunk
changeset: 487661:32fd02490bfd
user: mycroft <mycroft%NetBSD.org@localhost>
date: Sat Jun 10 22:28:33 2000 +0000
description:
Back out last night's optimization for now.
diffstat:
usr.bin/make/make.c | 47 ++++++++++++-----------------------------------
usr.bin/make/make.h | 3 +--
usr.bin/make/parse.c | 16 +++++++++-------
usr.bin/make/suff.c | 29 +++++++++++++++++------------
4 files changed, 39 insertions(+), 56 deletions(-)
diffs (243 lines):
diff -r cfd00e1ce7a4 -r 32fd02490bfd usr.bin/make/make.c
--- a/usr.bin/make/make.c Sat Jun 10 22:24:21 2000 +0000
+++ b/usr.bin/make/make.c Sat Jun 10 22:28:33 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: make.c,v 1.29 2000/06/10 22:24:21 mycroft Exp $ */
+/* $NetBSD: make.c,v 1.30 2000/06/10 22:28:33 mycroft Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -39,14 +39,14 @@
*/
#ifdef MAKE_BOOTSTRAP
-static char rcsid[] = "$NetBSD: make.c,v 1.29 2000/06/10 22:24:21 mycroft Exp $";
+static char rcsid[] = "$NetBSD: make.c,v 1.30 2000/06/10 22:28:33 mycroft Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: make.c,v 1.29 2000/06/10 22:24:21 mycroft Exp $");
+__RCSID("$NetBSD: make.c,v 1.30 2000/06/10 22:28:33 mycroft Exp $");
#endif
#endif /* not lint */
#endif
@@ -102,7 +102,6 @@
static int MakeAddChild __P((ClientData, ClientData));
static int MakeFindChild __P((ClientData, ClientData));
-static int MakeUnmark __P((ClientData, ClientData));
static int MakeAddAllSrc __P((ClientData, ClientData));
static int MakeTimeStamp __P((ClientData, ClientData));
static int MakeHandleUse __P((ClientData, ClientData));
@@ -411,9 +410,11 @@
gn = tgn;
}
- (void) Lst_AtEnd (pgn->children, gn);
- (void) Lst_AtEnd (gn->parents, pgn);
- pgn->unmade += 1;
+ if (Lst_Member (pgn->children, gn) == NILLNODE) {
+ (void) Lst_AtEnd (pgn->children, gn);
+ (void) Lst_AtEnd (gn->parents, pgn);
+ pgn->unmade += 1;
+ }
}
Lst_Close (cgn->children);
}
@@ -436,17 +437,11 @@
return (0);
}
static int
-MakeHandleUse (pgnp, cgnp)
- ClientData pgnp; /* the current parent */
- ClientData cgnp; /* the child we've just examined */
+MakeHandleUse (pgn, cgn)
+ ClientData pgn; /* the current parent */
+ ClientData cgn; /* the child we've just examined */
{
- GNode *cgn = (GNode *) cgnp;
-
- if (cgn->type & OP_MARK)
- return (0);
- cgn->type |= OP_MARK;
-
- return Make_HandleUse((GNode *) pgnp, cgn);
+ return Make_HandleUse((GNode *) pgn, (GNode *) cgn);
}
@@ -674,17 +669,6 @@
*-----------------------------------------------------------------------
*/
static int
-MakeUnmark (cgnp, pgnp)
- ClientData cgnp;
- ClientData pgnp;
-{
- GNode *cgn = (GNode *) cgnp;
-
- cgn->type &= ~OP_MARK;
- return (0);
-}
-
-static int
MakeAddAllSrc (cgnp, pgnp)
ClientData cgnp; /* The child to add */
ClientData pgnp; /* The parent to whose ALLSRC variable it should be */
@@ -692,11 +676,6 @@
{
GNode *cgn = (GNode *) cgnp;
GNode *pgn = (GNode *) pgnp;
-
- if (cgn->type & OP_MARK)
- return (0);
- cgn->type |= OP_MARK;
-
if ((cgn->type & (OP_EXEC|OP_USE|OP_INVISIBLE)) == 0) {
char *child;
char *p1 = NULL;
@@ -763,7 +742,6 @@
Make_DoAllVar (gn)
GNode *gn;
{
- Lst_ForEach (gn->children, MakeUnmark, (ClientData) gn);
Lst_ForEach (gn->children, MakeAddAllSrc, (ClientData) gn);
if (!Var_Exists (OODATE, gn)) {
@@ -990,7 +968,6 @@
(void)Dir_MTime(gn);
Var_Set (TARGET, gn->path ? gn->path : gn->name, gn);
- Lst_ForEach (gn->children, MakeUnmark, (ClientData)gn);
Lst_ForEach (gn->children, MakeHandleUse, (ClientData)gn);
Suff_FindDeps (gn);
diff -r cfd00e1ce7a4 -r 32fd02490bfd usr.bin/make/make.h
--- a/usr.bin/make/make.h Sat Jun 10 22:24:21 2000 +0000
+++ b/usr.bin/make/make.h Sat Jun 10 22:28:33 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: make.h,v 1.27 2000/06/10 21:44:08 mycroft Exp $ */
+/* $NetBSD: make.h,v 1.28 2000/06/10 22:28:33 mycroft Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -230,7 +230,6 @@
* commands for a target */
#define OP_SAVE_CMDS 0x04000000 /* Saving commands on .END (Compat) */
#define OP_DEPS_FOUND 0x02000000 /* Already processed by Suff_FindDeps */
-#define OP_MARK 0x01000000 /* Node found while expanding .ALLSRC */
/*
* OP_NOP will return TRUE if the node with the given type was not the
diff -r cfd00e1ce7a4 -r 32fd02490bfd usr.bin/make/parse.c
--- a/usr.bin/make/parse.c Sat Jun 10 22:24:21 2000 +0000
+++ b/usr.bin/make/parse.c Sat Jun 10 22:28:33 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.50 2000/06/10 21:44:08 mycroft Exp $ */
+/* $NetBSD: parse.c,v 1.51 2000/06/10 22:28:34 mycroft Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -39,14 +39,14 @@
*/
#ifdef MAKE_BOOTSTRAP
-static char rcsid[] = "$NetBSD: parse.c,v 1.50 2000/06/10 21:44:08 mycroft Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.51 2000/06/10 22:28:34 mycroft Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: parse.c,v 1.50 2000/06/10 21:44:08 mycroft Exp $");
+__RCSID("$NetBSD: parse.c,v 1.51 2000/06/10 22:28:34 mycroft Exp $");
#endif
#endif /* not lint */
#endif
@@ -443,13 +443,15 @@
{
GNode *pgn = (GNode *) pgnp;
GNode *cgn = (GNode *) cgnp;
-
if ((pgn->type & OP_DOUBLEDEP) && !Lst_IsEmpty (pgn->cohorts))
pgn = (GNode *) Lst_Datum (Lst_Last (pgn->cohorts));
- (void)Lst_AtEnd (pgn->children, (ClientData)cgn);
- if (specType == Not)
+ if (Lst_Member (pgn->children, (ClientData)cgn) == NILLNODE) {
+ (void)Lst_AtEnd (pgn->children, (ClientData)cgn);
+ if (specType == Not) {
(void)Lst_AtEnd (cgn->parents, (ClientData)pgn);
- pgn->unmade += 1;
+ }
+ pgn->unmade += 1;
+ }
return (0);
}
diff -r cfd00e1ce7a4 -r 32fd02490bfd usr.bin/make/suff.c
--- a/usr.bin/make/suff.c Sat Jun 10 22:24:21 2000 +0000
+++ b/usr.bin/make/suff.c Sat Jun 10 22:28:33 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: suff.c,v 1.29 2000/06/10 21:44:09 mycroft Exp $ */
+/* $NetBSD: suff.c,v 1.30 2000/06/10 22:28:34 mycroft Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -39,14 +39,14 @@
*/
#ifdef MAKE_BOOTSTRAP
-static char rcsid[] = "$NetBSD: suff.c,v 1.29 2000/06/10 21:44:09 mycroft Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.30 2000/06/10 22:28:34 mycroft Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94";
#else
-__RCSID("$NetBSD: suff.c,v 1.29 2000/06/10 21:44:09 mycroft Exp $");
+__RCSID("$NetBSD: suff.c,v 1.30 2000/06/10 22:28:34 mycroft Exp $");
#endif
#endif /* not lint */
#endif
@@ -1680,12 +1680,15 @@
char *tname; /* Name of transformation rule */
GNode *gn; /* Node for same */
- /*
- * Form the proper links between the target and source.
- */
- (void)Lst_AtEnd(tGn->children, (ClientData)sGn);
- (void)Lst_AtEnd(sGn->parents, (ClientData)tGn);
- tGn->unmade += 1;
+ if (Lst_Member(tGn->children, (ClientData)sGn) == NILLNODE) {
+ /*
+ * Not already linked, so form the proper links between the
+ * target and source.
+ */
+ (void)Lst_AtEnd(tGn->children, (ClientData)sGn);
+ (void)Lst_AtEnd(sGn->parents, (ClientData)tGn);
+ tGn->unmade += 1;
+ }
/*
* Locate the transformation rule itself
@@ -1797,9 +1800,11 @@
/*
* Create the link between the two nodes right off
*/
- (void)Lst_AtEnd(gn->children, (ClientData)mem);
- (void)Lst_AtEnd(mem->parents, (ClientData)gn);
- gn->unmade += 1;
+ if (Lst_Member(gn->children, (ClientData)mem) == NILLNODE) {
+ (void)Lst_AtEnd(gn->children, (ClientData)mem);
+ (void)Lst_AtEnd(mem->parents, (ClientData)gn);
+ gn->unmade += 1;
+ }
/*
* Copy in the variables from the member node to this one.
Home |
Main Index |
Thread Index |
Old Index