From patchwork Fri Jun 30 16:13:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 782917 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3wzhQt26s9z9sNX for ; Sat, 1 Jul 2017 02:13:25 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="joMIp4nw"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=QFhr3xCZGWZDRrto4Bpt7LDVhj8lYhjD8lnW8RD0lILCvxHE0e y8UxFkqILQUz9JJYhEMErvXXA8O52kEMOLKIX+r6QPBryHLdAJ6ZYpwG3UonwH4A JiDHVJ7VlITJYAGas5t6rPtWOsRNABzwycwvcvZ4t2bkW3J+tm6gh4is4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=PdUozb0dF8BG9z2x/AbDWCvyumM=; b=joMIp4nwB4C/rz1hNO9p /GLvIw+O7qAIhWTl7cK8Swb/8KDNepUzCDjJ29McpVqvmue0Zae1Kpn0F5Ereqo/ nbR9ZTZC9OBMz2d2SmAoh/SEwvxjd4qusyGOkpbXSWjU8e4jphv4RWiuAl6ex16l sKh+z877hQsLQExPlxV5JZs= Received: (qmail 117413 invoked by alias); 30 Jun 2017 16:13:16 -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 115007 invoked by uid 89); 30 Jun 2017 16:13:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=widespread, 2167 X-HELO: mail-yw0-f170.google.com Received: from mail-yw0-f170.google.com (HELO mail-yw0-f170.google.com) (209.85.161.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Jun 2017 16:13:09 +0000 Received: by mail-yw0-f170.google.com with SMTP id a12so2913166ywh.3 for ; Fri, 30 Jun 2017 09:13:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language; bh=6/xXDh/1EyFxBlxWLOa8JnYBJzsLdxKbErqYCG+BbRw=; b=kCQFfMgpFIIMT2g47/yJB8lvQQFexY8FlNZLbWPE4q1Ios9ktJTbMt+TP1MtaPKGwN VwuaoLP9aSvdg4S0KPRn8YrylcT618ZfMmU8g1QzimJAHMnLgzC0fbRFaxMi8TTb1zvK v8QptAZ2GK8OWvPRvSkcYw8gcPaq+FhUoQLrxnc+9MOVFr7yDGoPNMi0YhYEfjVDDVWa Jt32OkF3KCfsq3l6J68t3qi8SRjHF41nVXuzSjWEcty0eSjzoRsbcn+9CODohEGXWEFX xUZrUefo4TvT9n5spneE6Z9++YCKsAOhI1YEGlXrE9KbxVGIBDxEV2zBZOPZ+SE3Y55g 5sHg== X-Gm-Message-State: AKS2vOy9e4RDykFiKGxE7uhLiRrlvHrvtMN+txcNb10+yfyG3NyX453L fQsYck1Xvlqd8w== X-Received: by 10.129.104.197 with SMTP id d188mr7243656ywc.330.1498839188241; Fri, 30 Jun 2017 09:13:08 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a3:20fb:7500:e7fb:4a6f:2254? ([2620:10d:c091:200::1:9018]) by smtp.googlemail.com with ESMTPSA id v67sm3340113ywb.2.2017.06.30.09.13.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Jun 2017 09:13:07 -0700 (PDT) To: GCC Patches From: Nathan Sidwell Subject: [GC PATCH] Clean ggc.h Message-ID: <5831b139-da86-7a2d-4966-92b47330a86a@acm.org> Date: Fri, 30 Jun 2017 12:13:05 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 ggc.h had a bit of funky formatting and widespread pre-C++ idiom 'static inline'. Fixed as obvious. template static inline T *.... just looks weird :) nathan 2017-06-30 Nathan Sidwell * ggc.h: Replace all 'static inline' with plain 'inline'. Fix some formatting. Index: ggc.h =================================================================== --- ggc.h (revision 249835) +++ ggc.h (working copy) @@ -127,9 +127,8 @@ extern void *ggc_internal_alloc (size_t, size_t CXX_MEM_STAT_INFO) ATTRIBUTE_MALLOC; - static inline - void * - ggc_internal_alloc (size_t s CXX_MEM_STAT_INFO) +inline void * +ggc_internal_alloc (size_t s CXX_MEM_STAT_INFO) { return ggc_internal_alloc (s, NULL, 0, 1 PASS_MEM_STAT); } @@ -141,8 +140,7 @@ extern void *ggc_internal_cleared_alloc size_t, size_t CXX_MEM_STAT_INFO) ATTRIBUTE_MALLOC; -static inline -void * +inline void * ggc_internal_cleared_alloc (size_t s CXX_MEM_STAT_INFO) { return ggc_internal_cleared_alloc (s, NULL, 0, 1 PASS_MEM_STAT); @@ -168,7 +166,7 @@ finalize (void *p) } template -static inline bool +inline bool need_finalization_p () { #if GCC_VERSION >= 4003 @@ -179,7 +177,7 @@ need_finalization_p () } template -static inline T * +inline T * ggc_alloc (ALONE_CXX_MEM_STAT_INFO) { if (need_finalization_p ()) @@ -191,7 +189,7 @@ ggc_alloc (ALONE_CXX_MEM_STAT_INFO) } template -static inline T * +inline T * ggc_cleared_alloc (ALONE_CXX_MEM_STAT_INFO) { if (need_finalization_p ()) @@ -204,7 +202,7 @@ ggc_cleared_alloc (ALONE_CXX_MEM_STAT_IN } template -static inline T * +inline T * ggc_vec_alloc (size_t c CXX_MEM_STAT_INFO) { if (need_finalization_p ()) @@ -216,7 +214,7 @@ ggc_vec_alloc (size_t c CXX_MEM_STAT_INF } template -static inline T * +inline T * ggc_cleared_vec_alloc (size_t c CXX_MEM_STAT_INFO) { if (need_finalization_p ()) @@ -229,7 +227,7 @@ ggc_cleared_vec_alloc (size_t c CXX_MEM_ 0, 0 PASS_MEM_STAT)); } -static inline void * +inline void * ggc_alloc_atomic (size_t s CXX_MEM_STAT_INFO) { return ggc_internal_alloc (s PASS_MEM_STAT); @@ -274,52 +272,52 @@ extern void init_ggc_heuristics (void); /* Memory statistics passing versions of some allocators. Too few of them to make gengtype produce them, so just define the needed ones here. */ -static inline struct rtx_def * +inline struct rtx_def * ggc_alloc_rtx_def_stat (size_t s CXX_MEM_STAT_INFO) { return (struct rtx_def *) ggc_internal_alloc (s PASS_MEM_STAT); } -static inline union tree_node * +inline union tree_node * ggc_alloc_tree_node_stat (size_t s CXX_MEM_STAT_INFO) { return (union tree_node *) ggc_internal_alloc (s PASS_MEM_STAT); } -static inline union tree_node * +inline union tree_node * ggc_alloc_cleared_tree_node_stat (size_t s CXX_MEM_STAT_INFO) { return (union tree_node *) ggc_internal_cleared_alloc (s PASS_MEM_STAT); } -static inline gimple * +inline gimple * ggc_alloc_cleared_gimple_statement_stat (size_t s CXX_MEM_STAT_INFO) { return (gimple *) ggc_internal_cleared_alloc (s PASS_MEM_STAT); } -static inline void +inline void gt_ggc_mx (const char *s) { ggc_test_and_set_mark (const_cast (s)); } -static inline void +inline void gt_pch_nx (const char *) { } -static inline void +inline void gt_ggc_mx (int) { } -static inline void +inline void gt_pch_nx (int) { } -static inline void +inline void gt_pch_nx (unsigned int) { }