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: inline MakeBuildParent



details:   https://anonhg.NetBSD.org/src/rev/58e060cb6d1b
branches:  trunk
changeset: 365984:58e060cb6d1b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat May 07 10:05:49 2022 +0000

description:
make: inline MakeBuildParent

The word "parent" didn't match exactly, since this part is about the
predecessor/successor relationship due to the .ORDER attribute.

No functional change.

diffstat:

 usr.bin/make/make.c |  28 ++++++++++------------------
 1 files changed, 10 insertions(+), 18 deletions(-)

diffs (63 lines):

diff -r bbefd1b97571 -r 58e060cb6d1b usr.bin/make/make.c
--- a/usr.bin/make/make.c       Sat May 07 09:44:50 2022 +0000
+++ b/usr.bin/make/make.c       Sat May 07 10:05:49 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.c,v 1.253 2022/05/07 09:44:50 rillig Exp $        */
+/*     $NetBSD: make.c,v 1.254 2022/05/07 10:05:49 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -104,7 +104,7 @@
 #include "job.h"
 
 /*     "@(#)make.c     8.1 (Berkeley) 6/6/93"  */
-MAKE_RCSID("$NetBSD: make.c,v 1.253 2022/05/07 09:44:50 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.254 2022/05/07 10:05:49 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked_seqno = 1;
@@ -633,7 +633,7 @@
        return false;
 }
 
-static void MakeBuildParent(GNode *, GNodeListNode *);
+static bool MakeBuildChild(GNode *, GNodeListNode *);
 
 static void
 ScheduleOrderSuccessors(GNode *gn)
@@ -641,8 +641,13 @@
        GNodeListNode *toBeMadeNext = toBeMade.first;
        GNodeListNode *ln;
 
-       for (ln = gn->order_succ.first; ln != NULL; ln = ln->next)
-               MakeBuildParent(ln->datum, toBeMadeNext);
+       for (ln = gn->order_succ.first; ln != NULL; ln = ln->next) {
+               GNode *succ = ln->datum;
+
+               if (succ->made == DEFERRED &&
+                   !MakeBuildChild(succ, toBeMadeNext))
+                       succ->flags.doneOrder = true;
+       }
 }
 
 /*
@@ -972,19 +977,6 @@
        return cn->type & OP_WAIT && cn->unmade > 0;
 }
 
-/* When a .ORDER LHS node completes, we do this on each RHS. */
-static void
-MakeBuildParent(GNode *pn, GNodeListNode *toBeMadeNext)
-{
-       if (pn->made != DEFERRED)
-               return;
-
-       if (!MakeBuildChild(pn, toBeMadeNext)) {
-               /* When this node is built, reschedule its parents. */
-               pn->flags.doneOrder = true;
-       }
-}
-
 static void
 MakeChildren(GNode *gn)
 {



Home | Main Index | Thread Index | Old Index