Received: by mail.netbsd.org (Postfix, from userid 605) id F036A84F0C; Sun, 28 Nov 2021 19:51:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 3160384EFC for ; Sun, 28 Nov 2021 19:51:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id Gy3mea0KKf-l for ; Sun, 28 Nov 2021 19:51:06 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 7DB4984C71 for ; Sun, 28 Nov 2021 19:51:06 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 78E09FAEC; Sun, 28 Nov 2021 19:51:06 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Sun, 28 Nov 2021 19:51:06 +0000 From: "Roland Illig" Subject: CVS commit: src/usr.bin/make To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20211128195106.78E09FAEC@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Roland Illig" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: rillig Date: Sun Nov 28 19:51:06 UTC 2021 Modified Files: src/usr.bin/make: arch.c compat.c dir.c job.c make.c make.h targ.c Log Message: make: convert GNodeFlags from enum into bit-fields Now that Enum_ToString is implemented for each type separately, it's easy to convert them to bit-fields. This gets rid of the magic numbers 12 for CYCLE and 13 for DONECYCLE that left a suspicious gap in the numbers. This gap was not needed since the code didn't make use of the relative ordering of the enum constants. The effects of this conversion are fewer capital letters in the code, smaller scope for the GNode flags, and clearer code especially when setting a flag back to false. One strange thing is that GCC 10.3.0 doesn't optimize GNodeFlags_IsNone to an single bitmasking instruction, at least on x86_64. Instead it generates a testb instruction for each of the flags, even loading bit 8 separately from the others. Clang 12.0.1 knows this optimization though and generates the obvious sequence of movzwl, testl, jz. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.203 -r1.204 src/usr.bin/make/arch.c cvs rdiff -u -r1.227 -r1.228 src/usr.bin/make/compat.c cvs rdiff -u -r1.273 -r1.274 src/usr.bin/make/dir.c cvs rdiff -u -r1.439 -r1.440 src/usr.bin/make/job.c cvs rdiff -u -r1.245 -r1.246 src/usr.bin/make/make.c cvs rdiff -u -r1.267 -r1.268 src/usr.bin/make/make.h cvs rdiff -u -r1.172 -r1.173 src/usr.bin/make/targ.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.