Module Name:    src
Committed By:   rillig
Date:           Mon Sep 28 22:38:32 UTC 2020

Modified Files:
        src/usr.bin/make: make.c make.h

Log Message:
make(1): remove the inline attribute from debug_printf

The code size overhead of a varargs function is much more than I had
expected.  Since GCC 5 didn't inline the function anyway and it is only
used in debug mode, there is no point keeping multiple copies of that
code around.


To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 src/usr.bin/make/make.c
cvs rdiff -u -r1.150 -r1.151 src/usr.bin/make/make.h

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/make.c
diff -u src/usr.bin/make/make.c:1.153 src/usr.bin/make/make.c:1.154
--- src/usr.bin/make/make.c:1.153	Mon Sep 28 22:23:35 2020
+++ src/usr.bin/make/make.c	Mon Sep 28 22:38:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.153 2020/09/28 22:23:35 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.154 2020/09/28 22:38:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -107,7 +107,7 @@
 #include    "job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.153 2020/09/28 22:23:35 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.154 2020/09/28 22:38:32 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked = 1;
@@ -125,6 +125,16 @@ static int MakeCheckOrder(void *, void *
 static int MakeBuildChild(void *, void *);
 static int MakeBuildParent(void *, void *);
 
+void
+debug_printf(const char *fmt, ...)
+{
+    va_list args;
+
+    va_start(args, fmt);
+    vfprintf(debug_file, fmt, args);
+    va_end(args);
+}
+
 MAKE_ATTR_DEAD static void
 make_abort(GNode *gn, int line)
 {

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.150 src/usr.bin/make/make.h:1.151
--- src/usr.bin/make/make.h:1.150	Mon Sep 28 22:23:35 2020
+++ src/usr.bin/make/make.h	Mon Sep 28 22:38:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.150 2020/09/28 22:23:35 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.151 2020/09/28 22:38:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -524,15 +524,7 @@ extern int debug;
 
 #define	DEBUG(module)	(debug & CONCAT(DEBUG_,module))
 
-static inline MAKE_ATTR_UNUSED void MAKE_ATTR_PRINTFLIKE(1, 2)
-debug_printf(const char *fmt, ...)
-{
-    va_list args;
-
-    va_start(args, fmt);
-    vfprintf(debug_file, fmt, args);
-    va_end(args);
-}
+void debug_printf(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2);
 
 #define DEBUG0(module, text) \
     if (!DEBUG(module)) (void)0; \

Reply via email to