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.o...



details:   https://anonhg.NetBSD.org/src/rev/d688ba1c6b64
branches:  trunk
changeset: 957439:d688ba1c6b64
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Nov 28 19:16:53 2020 +0000

description:
make(1): reduce pointer indirection for GNode.order_pred and order_succ

diffstat:

 usr.bin/make/make.c  |  10 +++++-----
 usr.bin/make/make.h  |   6 +++---
 usr.bin/make/parse.c |   8 ++++----
 usr.bin/make/suff.c  |   6 +++---
 usr.bin/make/targ.c  |  16 ++++++++--------
 5 files changed, 23 insertions(+), 23 deletions(-)

diffs (175 lines):

diff -r e6cc7400a9f1 -r d688ba1c6b64 usr.bin/make/make.c
--- a/usr.bin/make/make.c       Sat Nov 28 19:12:28 2020 +0000
+++ b/usr.bin/make/make.c       Sat Nov 28 19:16:53 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.c,v 1.220 2020/11/28 19:12:28 rillig Exp $        */
+/*     $NetBSD: make.c,v 1.221 2020/11/28 19:16:53 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.220 2020/11/28 19:12:28 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.221 2020/11/28 19:16:53 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked_seqno = 1;
@@ -566,7 +566,7 @@
 {
        GNodeListNode *ln;
 
-       for (ln = gn->order_pred->first; ln != NULL; ln = ln->next) {
+       for (ln = gn->order_pred.first; ln != NULL; ln = ln->next) {
                GNode *ogn = ln->datum;
 
                if (GNode_IsDone(ogn) || !(ogn->flags & REMAKE))
@@ -588,7 +588,7 @@
        GNodeListNode *toBeMadeNext = toBeMade->first;
        GNodeListNode *ln;
 
-       for (ln = gn->order_succ->first; ln != NULL; ln = ln->next)
+       for (ln = gn->order_succ.first; ln != NULL; ln = ln->next)
                if (MakeBuildParent(ln->datum, toBeMadeNext) != 0)
                        break;
 }
@@ -1026,7 +1026,7 @@
 MakePrintStatusOrder(GNode *gn)
 {
        GNodeListNode *ln;
-       for (ln = gn->order_pred->first; ln != NULL; ln = ln->next)
+       for (ln = gn->order_pred.first; ln != NULL; ln = ln->next)
                MakePrintStatusOrderNode(ln->datum, gn);
 }
 
diff -r e6cc7400a9f1 -r d688ba1c6b64 usr.bin/make/make.h
--- a/usr.bin/make/make.h       Sat Nov 28 19:12:28 2020 +0000
+++ b/usr.bin/make/make.h       Sat Nov 28 19:16:53 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.h,v 1.222 2020/11/28 19:12:28 rillig Exp $        */
+/*     $NetBSD: make.h,v 1.223 2020/11/28 19:16:53 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -394,11 +394,11 @@
        /* .ORDER nodes we need made. The nodes that must be made (if they're
         * made) before this node can be made, but that do not enter into the
         * datedness of this node. */
-       GNodeList *order_pred;
+       GNodeList order_pred;
        /* .ORDER nodes who need us. The nodes that must be made (if they're
         * made at all) after this node is made, but that do not depend on
         * this node, in the normal sense. */
-       GNodeList *order_succ;
+       GNodeList order_succ;
 
        /* Other nodes of the same name, for the '::' dependency operator. */
        GNodeList *cohorts;
diff -r e6cc7400a9f1 -r d688ba1c6b64 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Sat Nov 28 19:12:28 2020 +0000
+++ b/usr.bin/make/parse.c      Sat Nov 28 19:16:53 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.455 2020/11/28 19:12:28 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.456 2020/11/28 19:16:53 rillig Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*     "@(#)parse.c    8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.455 2020/11/28 19:12:28 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.456 2020/11/28 19:16:53 rillig Exp $");
 
 /* types and constants */
 
@@ -927,8 +927,8 @@
     if (doing_depend)
        ParseMark(gn);
     if (order_pred != NULL) {
-       Lst_Append(order_pred->order_succ, gn);
-       Lst_Append(gn->order_pred, order_pred);
+       Lst_Append(&order_pred->order_succ, gn);
+       Lst_Append(&gn->order_pred, order_pred);
        if (DEBUG(PARSE)) {
            debug_printf("# %s: added Order dependency %s - %s\n",
                         __func__, order_pred->name, gn->name);
diff -r e6cc7400a9f1 -r d688ba1c6b64 usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Sat Nov 28 19:12:28 2020 +0000
+++ b/usr.bin/make/suff.c       Sat Nov 28 19:16:53 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: suff.c,v 1.310 2020/11/28 19:12:28 rillig Exp $        */
+/*     $NetBSD: suff.c,v 1.311 2020/11/28 19:16:53 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.310 2020/11/28 19:12:28 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.311 2020/11/28 19:16:53 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -1239,7 +1239,7 @@
     GNode *gn;                 /* New source 8) */
     char *cp;                  /* Expanded value */
 
-    if (!Lst_IsEmpty(cgn->order_pred) || !Lst_IsEmpty(cgn->order_succ))
+    if (!Lst_IsEmpty(&cgn->order_pred) || !Lst_IsEmpty(&cgn->order_succ))
        /* It is all too hard to process the result of .ORDER */
        return;
 
diff -r e6cc7400a9f1 -r d688ba1c6b64 usr.bin/make/targ.c
--- a/usr.bin/make/targ.c       Sat Nov 28 19:12:28 2020 +0000
+++ b/usr.bin/make/targ.c       Sat Nov 28 19:16:53 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targ.c,v 1.143 2020/11/28 19:12:28 rillig Exp $        */
+/*     $NetBSD: targ.c,v 1.144 2020/11/28 19:16:53 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.143 2020/11/28 19:12:28 rillig Exp $");
+MAKE_RCSID("$NetBSD: targ.c,v 1.144 2020/11/28 19:16:53 rillig Exp $");
 
 /*
  * All target nodes that appeared on the left-hand side of one of the
@@ -204,8 +204,8 @@
     gn->implicitParents = Lst_New();
     Lst_Init(&gn->parents);
     Lst_Init(&gn->children);
-    gn->order_pred = Lst_New();
-    gn->order_succ = Lst_New();
+    Lst_Init(&gn->order_pred);
+    Lst_Init(&gn->order_succ);
     gn->cohorts = Lst_New();
     gn->cohort_num[0] = '\0';
     gn->unmade_cohorts = 0;
@@ -237,8 +237,8 @@
     Lst_Free(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_Free(gn->order_pred);  /* likewise */
-    Lst_Free(gn->order_succ);  /* likewise */
+    Lst_Done(&gn->order_pred); /* likewise */
+    Lst_Done(&gn->order_succ); /* likewise */
     Lst_Free(gn->cohorts);     /* likewise */
     HashTable_Done(&gn->vars); /* Do not free the variables themselves,
                                 * even though they are owned by this node.
@@ -509,8 +509,8 @@
                debug_printf("# %d unmade children\n", gn->unmade);
        }
        PrintNodeNamesLine("parents", &gn->parents);
-       PrintNodeNamesLine("order_pred", gn->order_pred);
-       PrintNodeNamesLine("order_succ", gn->order_succ);
+       PrintNodeNamesLine("order_pred", &gn->order_pred);
+       PrintNodeNamesLine("order_succ", &gn->order_succ);
 
        debug_printf("%-16s%s", gn->name, GNode_OpName(gn));
        Targ_PrintType(gn->type);



Home | Main Index | Thread Index | Old Index