Module Name: src Committed By: rillig Date: Tue Dec 7 21:47:21 UTC 2021
Modified Files: src/usr.bin/make: var.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.967 -r1.968 src/usr.bin/make/var.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/make/var.c diff -u src/usr.bin/make/var.c:1.967 src/usr.bin/make/var.c:1.968 --- src/usr.bin/make/var.c:1.967 Tue Dec 7 21:30:11 2021 +++ src/usr.bin/make/var.c Tue Dec 7 21:47:21 2021 @@ -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 @@ ApplyModifier(const char **pp, ModChain 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 @@ ApplyModifier(const char **pp, ModChain 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: