From patchwork Fri May 26 13:25:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 767399 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 3wZ6M755M5z9s7p for ; Fri, 26 May 2017 23:25:22 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="HpUC0yHP"; 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 :subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=UZpjEEcVV1ywzYxp1 KG2HpPXkia0rC7QKKX7ZTljj3tr5FktFOOW1ihbT/yl46uRW36vICDukdkPxpWVl C3eDcuyYgh5SiGSqCzSt7CRvnVWOQE9/Bl1o2trRGQ5kXARMxENams/381BhsSqA PvbR9WP0emFzXCqMt/3E+xqiHw= 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 :subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=+Ac3ECtD2LyCdfPXkr6/dFV E0xM=; b=HpUC0yHPzprrtANmfUI5g5/FKn0lsRt/tpMyQgWC/ou4WEbBcZp5bjC zbDk7Bs7OTNYc/bhG4YrTHdlAOmlFzCk14ayFR0n7QcvSxgiGTSaiKhN5VGm/XH+ xF+1fmbPgKQNHPVALgJV4dow8T/0hLKhHlkXfbkAw2GkxBRC9EUU= Received: (qmail 80289 invoked by alias); 26 May 2017 13:25:11 -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 80265 invoked by uid 89); 26 May 2017 13:25:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 26 May 2017 13:25:08 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2D331ACBD; Fri, 26 May 2017 13:25:10 +0000 (UTC) Subject: Re: [PATCH v2 3/N] Transform TDF_{lang, tree, ipa, rtl} to dump_kind enum. To: Richard Biener Cc: Martin Sebor , Trevor Saunders , GCC Patches , Nathan Sidwell References: <668c62b5-9603-47c5-9bfe-266d0d369a1f@suse.cz> <412435ae-4a9b-99ff-cb78-cf157b778303@suse.cz> <8cca10ba-1a98-2e0d-2fbd-ce1c1c4df1c2@suse.cz> <20170506125238.dw2qg5jniyyp7ss2@ball> <58fdcca9-a13e-8c43-7896-440772de3aaa@gmail.com> <8bd8fb87-ec36-3d0e-b2c8-8dd02bb3e6a6@suse.cz> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: Date: Fri, 26 May 2017 15:25:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: X-IsSubscribed: yes On 05/26/2017 02:31 PM, Richard Biener wrote: > Well, then we have to go without the constructor. Runtime init isn't > an option IMHO. > Just use some macros for the eye candy, will you? > > Richard. Yep. I'm testing following eye candy patch. Ready to install after tests? Martin From 5339db7288e6ba28b65b166bc3f008c08c765834 Mon Sep 17 00:00:00 2001 From: marxin Date: Fri, 26 May 2017 15:08:45 +0200 Subject: [PATCH] Remove dump_file_info::dump_file_info and replace it with macro. gcc/ChangeLog: 2017-05-26 Martin Liska * dumpfile.c: Use newly added macro DUMP_FILE_INFO. * dumpfile.h (struct dump_file_info): Remove ctors. --- gcc/dumpfile.c | 42 ++++++++++++++---------------------------- gcc/dumpfile.h | 7 ------- 2 files changed, 14 insertions(+), 35 deletions(-) diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c index 233e6b19916..b8bda3c9183 100644 --- a/gcc/dumpfile.c +++ b/gcc/dumpfile.c @@ -47,41 +47,27 @@ FILE *alt_dump_file = NULL; const char *dump_file_name; dump_flags_t dump_flags; -CONSTEXPR dump_file_info::dump_file_info (): suffix (NULL), swtch (NULL), - glob (NULL), pfilename (NULL), alt_filename (NULL), pstream (NULL), - alt_stream (NULL), dkind (DK_none), pflags (), alt_flags (0), - optgroup_flags (0), pstate (0), alt_state (0), num (0), owns_strings (false), - graph_dump_initialized (false) -{ -} - -dump_file_info::dump_file_info (const char *_suffix, const char *_swtch, - dump_kind _dkind, int _num): - suffix (_suffix), swtch (_swtch), glob (NULL), - pfilename (NULL), alt_filename (NULL), pstream (NULL), alt_stream (NULL), - dkind (_dkind), pflags (), alt_flags (0), optgroup_flags (0), - pstate (0), alt_state (0), num (_num), owns_strings (false), - graph_dump_initialized (false) -{ -} +#define DUMP_FILE_INFO(suffix, swtch, dkind, num) \ + {suffix, swtch, NULL, NULL, NULL, NULL, NULL, dkind, 0, 0, 0, 0, 0, num, \ + false, false} /* Table of tree dump switches. This must be consistent with the TREE_DUMP_INDEX enumeration in dumpfile.h. */ static struct dump_file_info dump_files[TDI_end] = { - dump_file_info (), - dump_file_info (".cgraph", "ipa-cgraph", DK_ipa, 0), - dump_file_info (".type-inheritance", "ipa-type-inheritance", DK_ipa, 0), - dump_file_info (".ipa-clones", "ipa-clones", DK_ipa, 0), - dump_file_info (".original", "tree-original", DK_tree, 3), - dump_file_info (".gimple", "tree-gimple", DK_tree, 4), - dump_file_info (".nested", "tree-nested", DK_tree, 5), + DUMP_FILE_INFO (NULL, NULL, DK_none, 0), + DUMP_FILE_INFO (".cgraph", "ipa-cgraph", DK_ipa, 0), + DUMP_FILE_INFO (".type-inheritance", "ipa-type-inheritance", DK_ipa, 0), + DUMP_FILE_INFO (".ipa-clones", "ipa-clones", DK_ipa, 0), + DUMP_FILE_INFO (".original", "tree-original", DK_tree, 3), + DUMP_FILE_INFO (".gimple", "tree-gimple", DK_tree, 4), + DUMP_FILE_INFO (".nested", "tree-nested", DK_tree, 5), #define FIRST_AUTO_NUMBERED_DUMP 3 - dump_file_info (NULL, "lang-all", DK_lang, 0), - dump_file_info (NULL, "tree-all", DK_tree, 0), - dump_file_info (NULL, "rtl-all", DK_rtl, 0), - dump_file_info (NULL, "ipa-all", DK_ipa, 0), + DUMP_FILE_INFO (NULL, "lang-all", DK_lang, 0), + DUMP_FILE_INFO (NULL, "tree-all", DK_tree, 0), + DUMP_FILE_INFO (NULL, "rtl-all", DK_rtl, 0), + DUMP_FILE_INFO (NULL, "ipa-all", DK_ipa, 0), }; /* Define a name->number mapping for a dump flag value. */ diff --git a/gcc/dumpfile.h b/gcc/dumpfile.h index a60777f344d..fda8d712c43 100644 --- a/gcc/dumpfile.h +++ b/gcc/dumpfile.h @@ -120,13 +120,6 @@ typedef uint64_t dump_flags_t; /* Define a tree dump switch. */ struct dump_file_info { - /* Constructor. */ - CONSTEXPR dump_file_info (); - - /* Constructor. */ - dump_file_info (const char *_suffix, const char *_swtch, dump_kind _dkind, - int _num); - /* Suffix to give output file. */ const char *suffix; /* Command line dump switch. */ -- 2.12.2