diff mbox

[v2,3/N] Transform TDF_{lang,tree,ipa,rtl} to dump_kind enum.

Message ID adf33d93-7afe-3e61-3ca9-fd20e7def664@suse.cz
State New
Headers show

Commit Message

Martin Liška May 26, 2017, 1:25 p.m. UTC
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

Comments

Richard Biener May 30, 2017, 11:30 a.m. UTC | #1
On Fri, May 26, 2017 at 3:25 PM, Martin Liška <mliska@suse.cz> wrote:
> 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?

Yes.

Thanks,
Richard.

> Martin
diff mbox

Patch

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