public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Richard Biener <richard.guenther@gmail.com>
Cc: Martin Sebor <msebor@gmail.com>,
	Trevor Saunders <tbsaunde@tbsaunde.org>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	Nathan Sidwell <nathan@acm.org>
Subject: Re: [PATCH v2 3/N] Transform TDF_{lang,tree,ipa,rtl} to dump_kind enum.
Date: Fri, 26 May 2017 13:54:00 -0000	[thread overview]
Message-ID: <adf33d93-7afe-3e61-3ca9-fd20e7def664@suse.cz> (raw)
In-Reply-To: <CAFiYyc2nPXi-unHNo5iEadCoP2H3A0aOUdpS1J4+pbuUE8849g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 285 bytes --]

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

[-- Attachment #2: 0001-Remove-dump_file_info-dump_file_info-and-replace-it-.patch --]
[-- Type: text/x-patch, Size: 3656 bytes --]

From 5339db7288e6ba28b65b166bc3f008c08c765834 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
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  <mliska@suse.cz>

	* 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


  reply	other threads:[~2017-05-26 13:25 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-03  8:14 [RFC][PATCH] Introduce -fdump*-folding Martin Liška
2017-05-03  8:20 ` Andrew Pinski
2017-05-03 10:16 ` Richard Biener
2017-05-04  9:23   ` Martin Liška
2017-05-04 10:41     ` Richard Biener
2017-05-04 12:06       ` Martin Liška
2017-05-05 10:44         ` [PATCH 1/N] Introduce dump_flags_t type and use it instead of int type Martin Liška
2017-05-05 11:50           ` Richard Biener
2017-05-06 15:04             ` Trevor Saunders
2017-05-12 13:01               ` [PATCH v2 01/N] Add default value for last argument of dump functions Martin Liška
2017-05-16 13:49                 ` Richard Biener
2017-05-12 13:04               ` [PATCH v2 2/N] Introduce dump_flags_t type and use it instead of int, type Martin Liška
2017-05-16 13:50                 ` Richard Biener
2017-05-16 14:56                   ` Martin Liška
2017-05-17  7:55                     ` Richard Biener
2017-05-17  9:06                       ` Martin Liška
2017-05-18 13:37                         ` Thomas Schwinge
2017-05-18 14:26                           ` Martin Liška
2017-05-12 13:30               ` [PATCH v2 3/N] Transform TDF_{lang,tree,ipa,rtl} to dump_kind enum Martin Liška
2017-05-16 14:17                 ` Richard Biener
2017-05-17 12:22                 ` Richard Biener
2017-05-18 12:37                   ` Martin Liška
2017-05-25  5:29                 ` Martin Sebor
2017-05-25  9:56                   ` Martin Liška
2017-05-25 10:58                     ` Nathan Sidwell
2017-05-26 13:00                     ` Richard Biener
2017-05-26 13:54                       ` Martin Liška [this message]
2017-05-30 11:46                         ` Richard Biener
2017-05-16 13:55               ` [PATCH v2 04/N] Simplify usage of some TDF_* flags Martin Liška
2017-05-17 12:37                 ` Richard Biener
2017-05-18 12:58                   ` Martin Liška
2017-05-24 21:23                     ` Martin Liška
2017-05-26 11:46                       ` Richard Biener
2017-05-24 11:04               ` [PATCH v2 05/N] Add -fdump*-folding suboption Martin Liška
2017-05-24 13:53                 ` Richard Biener
2017-05-05 10:56         ` [PATCH 2/N] Add dump_flags_type<E> for handling of suboptions Martin Liška
2017-05-09 12:05           ` Martin Liška
2017-05-12 17:47           ` Martin Sebor
2017-05-15  6:52             ` Martin Sebor
2017-05-15  9:47           ` [RFC] Do we want hierarchical options & encapsulation in a class Martin Liška
2017-05-15 11:26             ` Nathan Sidwell
2017-05-15 12:24               ` Martin Liška
2017-05-15 11:46             ` Nathan Sidwell
2017-05-15 12:05               ` Martin Liška
2017-05-15 12:43                 ` Nathan Sidwell
2017-05-15 13:50                   ` Martin Liška
2017-05-15 14:13                     ` Nathan Sidwell
2017-05-15 14:24                       ` Martin Liška
2017-05-16 13:44                         ` Richard Biener
2017-05-05 11:57         ` [RFC][PATCH] Introduce -fdump*-folding Richard Biener
2017-05-09 12:03           ` Martin Liška
2017-05-09 12:19             ` Richard Biener
2017-05-09 12:52               ` Martin Liška
2017-05-09 13:01                 ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=adf33d93-7afe-3e61-3ca9-fd20e7def664@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=msebor@gmail.com \
    --cc=nathan@acm.org \
    --cc=richard.guenther@gmail.com \
    --cc=tbsaunde@tbsaunde.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).