Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): reduce pointer indirection for GNode.i...



details:   https://anonhg.NetBSD.org/src/rev/eceab182f1d6
branches:  trunk
changeset: 978665:eceab182f1d6
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Nov 28 19:22:32 2020 +0000

description:
make(1): reduce pointer indirection for GNode.implicitParents

diffstat:

 usr.bin/make/compat.c |   8 ++++----
 usr.bin/make/dir.c    |   6 +++---
 usr.bin/make/make.c   |   6 +++---
 usr.bin/make/make.h   |   4 ++--
 usr.bin/make/suff.c   |   6 +++---
 usr.bin/make/targ.c   |  10 +++++-----
 6 files changed, 20 insertions(+), 20 deletions(-)

diffs (180 lines):

diff -r 4cba96b60923 -r eceab182f1d6 usr.bin/make/compat.c
--- a/usr.bin/make/compat.c     Sat Nov 28 19:20:03 2020 +0000
+++ b/usr.bin/make/compat.c     Sat Nov 28 19:22:32 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat.c,v 1.195 2020/11/28 19:20:03 rillig Exp $      */
+/*     $NetBSD: compat.c,v 1.196 2020/11/28 19:22:32 rillig Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -96,7 +96,7 @@
 #include "pathnames.h"
 
 /*     "@(#)compat.c   8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: compat.c,v 1.195 2020/11/28 19:20:03 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.196 2020/11/28 19:22:32 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -495,7 +495,7 @@
                return FALSE;
        }
 
-       if (Lst_FindDatum(gn->implicitParents, pgn) != NULL)
+       if (Lst_FindDatum(&gn->implicitParents, pgn) != NULL)
                Var_Set(IMPSRC, GNode_VarTarget(gn), pgn);
 
        /*
@@ -587,7 +587,7 @@
 MakeOther(GNode *gn, GNode *pgn)
 {
 
-       if (Lst_FindDatum(gn->implicitParents, pgn) != NULL) {
+       if (Lst_FindDatum(&gn->implicitParents, pgn) != NULL) {
                const char *target = GNode_VarTarget(gn);
                Var_Set(IMPSRC, target != NULL ? target : "", pgn);
        }
diff -r 4cba96b60923 -r eceab182f1d6 usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Sat Nov 28 19:20:03 2020 +0000
+++ b/usr.bin/make/dir.c        Sat Nov 28 19:22:32 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.222 2020/11/23 23:41:11 rillig Exp $ */
+/*     $NetBSD: dir.c,v 1.223 2020/11/28 19:22:32 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -134,7 +134,7 @@
 #include "job.h"
 
 /*     "@(#)dir.c      8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: dir.c,v 1.222 2020/11/23 23:41:11 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.223 2020/11/28 19:22:32 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -1337,7 +1337,7 @@
                fullName = Dir_FindFile(gn->name, Suff_FindPath(gn));
 
                if (fullName == NULL && gn->flags & FROM_DEPEND &&
-                   !Lst_IsEmpty(gn->implicitParents))
+                   !Lst_IsEmpty(&gn->implicitParents))
                        fullName = ResolveMovedDepends(gn);
 
                DIR_DEBUG2("Found '%s' as '%s'\n",
diff -r 4cba96b60923 -r eceab182f1d6 usr.bin/make/make.c
--- a/usr.bin/make/make.c       Sat Nov 28 19:20:03 2020 +0000
+++ b/usr.bin/make/make.c       Sat Nov 28 19:22:32 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.c,v 1.222 2020/11/28 19:20:03 rillig Exp $        */
+/*     $NetBSD: make.c,v 1.223 2020/11/28 19:22:32 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -102,7 +102,7 @@
 #include "job.h"
 
 /*     "@(#)make.c     8.1 (Berkeley) 6/6/93"  */
-MAKE_RCSID("$NetBSD: make.c,v 1.222 2020/11/28 19:20:03 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.223 2020/11/28 19:22:32 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked_seqno = 1;
@@ -550,7 +550,7 @@
        GNodeListNode *ln;
        const char *cpref = GNode_VarPrefix(cgn);
 
-       for (ln = cgn->implicitParents->first; ln != NULL; ln = ln->next) {
+       for (ln = cgn->implicitParents.first; ln != NULL; ln = ln->next) {
                GNode *pgn = ln->datum;
                if (pgn->flags & REMAKE) {
                        Var_Set(IMPSRC, cname, pgn);
diff -r 4cba96b60923 -r eceab182f1d6 usr.bin/make/make.h
--- a/usr.bin/make/make.h       Sat Nov 28 19:20:03 2020 +0000
+++ b/usr.bin/make/make.h       Sat Nov 28 19:22:32 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.h,v 1.224 2020/11/28 19:20:03 rillig Exp $        */
+/*     $NetBSD: make.h,v 1.225 2020/11/28 19:22:32 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -383,7 +383,7 @@
        /* The GNodes for which this node is an implied source. May be empty.
         * For example, when there is an inference rule for .c.o, the node for
         * file.c has the node for file.o in this list. */
-       GNodeList *implicitParents;
+       GNodeList implicitParents;
 
        /* The nodes that depend on this one, or in other words, the nodes for
         * which this is a source. */
diff -r 4cba96b60923 -r eceab182f1d6 usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Sat Nov 28 19:20:03 2020 +0000
+++ b/usr.bin/make/suff.c       Sat Nov 28 19:22:32 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: suff.c,v 1.312 2020/11/28 19:20:03 rillig Exp $        */
+/*     $NetBSD: suff.c,v 1.313 2020/11/28 19:22:32 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*     "@(#)suff.c     8.4 (Berkeley) 3/21/94" */
-MAKE_RCSID("$NetBSD: suff.c,v 1.312 2020/11/28 19:20:03 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.313 2020/11/28 19:22:32 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -1484,7 +1484,7 @@
      * Keep track of another parent to which this node is transformed so
      * the .IMPSRC variable can be set correctly for the parent.
      */
-    Lst_Append(sgn->implicitParents, tgn);
+    Lst_Append(&sgn->implicitParents, tgn);
 
     return TRUE;
 }
diff -r 4cba96b60923 -r eceab182f1d6 usr.bin/make/targ.c
--- a/usr.bin/make/targ.c       Sat Nov 28 19:20:03 2020 +0000
+++ b/usr.bin/make/targ.c       Sat Nov 28 19:22:32 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targ.c,v 1.145 2020/11/28 19:20:04 rillig Exp $        */
+/*     $NetBSD: targ.c,v 1.146 2020/11/28 19:22:32 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -119,7 +119,7 @@
 #include "dir.h"
 
 /*     "@(#)targ.c     8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: targ.c,v 1.145 2020/11/28 19:20:04 rillig Exp $");
+MAKE_RCSID("$NetBSD: targ.c,v 1.146 2020/11/28 19:22:32 rillig Exp $");
 
 /*
  * All target nodes that appeared on the left-hand side of one of the
@@ -201,7 +201,7 @@
     gn->unmade = 0;
     gn->mtime = 0;
     gn->youngestChild = NULL;
-    gn->implicitParents = Lst_New();
+    Lst_Init(&gn->implicitParents);
     Lst_Init(&gn->parents);
     Lst_Init(&gn->children);
     Lst_Init(&gn->order_pred);
@@ -234,7 +234,7 @@
     free(gn->uname);
     free(gn->path);
     /* gn->youngestChild is not owned by this node. */
-    Lst_Free(gn->implicitParents); /* Do not free the nodes themselves, */
+    Lst_Done(&gn->implicitParents); /* Do not free the nodes themselves, */
     Lst_Done(&gn->parents);    /* as they are not owned by this node. */
     Lst_Done(&gn->children);   /* likewise */
     Lst_Done(&gn->order_pred); /* likewise */
@@ -503,7 +503,7 @@
                    debug_printf("# unmade\n");
                }
            }
-           PrintNodeNamesLine("implicit parents", gn->implicitParents);
+           PrintNodeNamesLine("implicit parents", &gn->implicitParents);
        } else {
            if (gn->unmade)
                debug_printf("# %d unmade children\n", gn->unmade);



Home | Main Index | Thread Index | Old Index