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: merge branches for modifiers ':D' and ':U'



details:   https://anonhg.NetBSD.org/src/rev/aca9791e4b83
branches:  trunk
changeset: 1027152:aca9791e4b83
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Dec 07 21:47:21 2021 +0000

description:
make: merge branches for modifiers ':D' and ':U'

These branches have the exact same code, without involving any macros,
nevertheless GCC 10 doesn't merge them.  Further, GCC thinks that the
function ApplyModifier_Defined were called from two different places,
thus creating an actual function definition.  Merging the case labels
inlines the function, saving a few instructions and a few hundred bytes
in the binary.

No functional change.

diffstat:

 usr.bin/make/var.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 32a97b5b923f -r aca9791e4b83 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Tue Dec 07 21:45:31 2021 +0000
+++ b/usr.bin/make/var.c        Tue Dec 07 21:47:21 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.967 2021/12/07 21:30:11 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.968 2021/12/07 21:47:21 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.967 2021/12/07 21:30:11 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.968 2021/12/07 21:47:21 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -3841,6 +3841,7 @@
                return ApplyModifier_Regex(pp, ch);
 #endif
        case 'D':
+       case 'U':
                return ApplyModifier_Defined(pp, ch);
        case 'E':
                return ApplyModifier_WordFunc(pp, ch, ModifyWord_Suffix);
@@ -3878,8 +3879,6 @@
                return ApplyModifier_WordFunc(pp, ch, ModifyWord_Tail);
        case 't':
                return ApplyModifier_To(pp, ch);
-       case 'U':
-               return ApplyModifier_Defined(pp, ch);
        case 'u':
                return ApplyModifier_Unique(pp, ch);
        default:



Home | Main Index | Thread Index | Old Index