From patchwork Mon Aug 20 17:44:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 959852 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-483998-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AqAbeGTW"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vLlw2fnWz9s9F for ; Tue, 21 Aug 2018 03:44:27 +1000 (AEST) Received: (qmail 36888 invoked by alias); 20 Aug 2018 17:44:21 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 36867 invoked by uid 89); 20 Aug 2018 17:44:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Google-Smtp-Source:uWPw, Rid X-HELO: mail-yb0-f176.google.com Received: from mail-yb0-f176.google.com (HELO mail-yb0-f176.google.com) (209.85.213.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 20 Aug 2018 17:44:18 +0000 Received: by mail-yb0-f176.google.com with SMTP id l16-v6so4917088ybk.11 for ; Mon, 20 Aug 2018 10:44:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=whGlQ5KSH0FW8ZAkLrgxmHrmEFdDaoKwszh3r61F2Fo=; b=AqAbeGTWI7b28WpU84Wef4A7qw7DKGxa1xSN2H8DTXilaCTlZckwvL/f7MZWNdeSrr FcnEPdYCZk7LfvxxI7cH8dld+2as5WAPulFfadfNIe/HOUMFy0616bwZu7O74JaZNX2G Eb37+RQS7mqTq4eqnYJO3L899otzf+mcajS59836TvbVXkr8R1F9TK2dxehMljTAJYH/ MBU0p4xKhOxVFFUDd08LG29ssLW806iNr6fJunGnczdazGSX0Es1yemdHerIxMcJs14a 0N4CBD9kT+HwxWPBGThosCMLUSrJeB8V6AKh2KhiK9JQbf919h9lWnjLfLZrbE9J74rP X+HA== Received: from ?IPv6:2620:10d:c0a3:20fb:7500:e7fb:4a6f:2254? ([2620:10d:c091:200::5c29]) by smtp.googlemail.com with ESMTPSA id i22-v6sm3491592ywg.7.2018.08.20.10.44.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 10:44:16 -0700 (PDT) Sender: Nathan Sidwell To: GCC Patches From: Nathan Sidwell Subject: [CPP PATCH] node field bits Message-ID: <82ef15f8-cd52-dea8-a91d-5efe6242e663@acm.org> Date: Mon, 20 Aug 2018 13:44:14 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Last bit of cleanup in the preprocessor. We only need 2 bits to hold the node_type enumeration, and 8 bits for the flags. That leaves several unused bits, which we may as well note. nathan 2018-08-20 Nathan Sidwell * include/cpplib.h: Fixup some whitespace. (cpp_hashnode): Reduce type to 2 bit & flags to 8. Index: include/cpplib.h =================================================================== --- include/cpplib.h (revision 263667) +++ include/cpplib.h (working copy) @@ -813,8 +813,10 @@ struct GTY(()) cpp_hashnode { then index into directive table. Otherwise, a NODE_OPERATOR. */ unsigned char rid_code; /* Rid code - for front ends. */ - ENUM_BITFIELD(node_type) type : 6; /* CPP node type. */ - unsigned int flags : 10; /* CPP flags. */ + ENUM_BITFIELD(node_type) type : 2; /* CPP node type. */ + unsigned int flags : 8; /* CPP flags. */ + + /* 6 bits spare (plus another 32 on 64-bit hosts). */ union _cpp_hashnode_value GTY ((desc ("%1.type"))) value; }; @@ -940,7 +942,6 @@ extern const cpp_token *cpp_get_token_wi inline bool cpp_user_macro_p (const cpp_hashnode *node) { return node->type == NT_USER_MACRO; - } inline bool cpp_builtin_macro_p (const cpp_hashnode *node) { @@ -950,6 +951,7 @@ inline bool cpp_macro_p (const cpp_hashn { return node->type & NT_MACRO_MASK; } + /* Returns true if NODE is a function-like user macro. */ inline bool cpp_fun_like_macro_p (cpp_hashnode *node) {