From: "Martin Liška" <mliska@suse.cz>
To: Martin Sebor <msebor@gmail.com>,
Trevor Saunders <tbsaunde@tbsaunde.org>,
Richard Biener <richard.guenther@gmail.com>
Cc: 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: Thu, 25 May 2017 09:56:00 -0000 [thread overview]
Message-ID: <8bd8fb87-ec36-3d0e-b2c8-8dd02bb3e6a6@suse.cz> (raw)
In-Reply-To: <58fdcca9-a13e-8c43-7896-440772de3aaa@gmail.com>
On 05/25/2017 05:35 AM, Martin Sebor wrote:
> On 05/12/2017 07:04 AM, Martin Liška wrote:
>> Third part removes TDF_* flags mentioned in the subject. These flags are used
>> to enable all passes of specific type and Nathan has recently separated these
>> by a new pair of macros. I hope moving these to a separate enum will help even more.
>
> Just as an FYI, the addition of the user-defined constructor makes
> the class non-trivial and so unsafe to initialize by calling memset
> in C++ 11 and later. In C++ 98 that GCC is compiled with, the class
> is not a POD and so not safe to realloc (i.e., new objects must be
> brought to life by calling a constructor). I noticed this by testing
> my latest patch for the new -Wclass-memassign warning but I thought
> it might be worth noting here as well.
Hi.
Thanks for heads up. I'm not sure why the class is no longer POD as one can define
constructors (but not copy-ctors) in order to preserve a type to be POD?
I'm also interested what is the new warning -Wclass-memassign about?
>
> + /* Constructor. */
> + dump_file_info ();
> +
> + /* Constructor. */
> + dump_file_info (const char *_suffix, const char *_swtch, dump_kind _dkind,
> + int _num);
> +
>
> Also, making the ctor constexpr and defining it in the .c file will
> trigger Clang -Wundefined-inline and makes the ctor unusable in other
> sources. AFAICS, there is no constexpr context where the constexpr
> ctor would be needed so I'm not sure I understand its purpose. Is
> it constexpr to allow the static initialization of dump_files[0]?
> (All the other elements of the array are dynamically initialized
> by calling the other, non-constexpr ctor so that doesn't seem like
> the answer.)
Yep, that was Richi's objection to use constexpr and I know it's used
just for the first elements of the array.
Richi?
Martin
>
> Martin
next prev parent reply other threads:[~2017-05-25 9:52 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 [this message]
2017-05-25 10:58 ` Nathan Sidwell
2017-05-26 13:00 ` Richard Biener
2017-05-26 13:54 ` Martin Liška
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=8bd8fb87-ec36-3d0e-b2c8-8dd02bb3e6a6@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).