This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Merge C++ conversion into trunk (5/6 - double_int rewrite)
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Diego Novillo <dnovillo at google dot com>, Lawrence Crowl <crowl at google dot com>, Richard Guenther <rguenther at suse dot de>, Richard Henderson <rth at redhat dot com>
- Date: Mon, 13 Aug 2012 11:41:31 +0200
- Subject: Re: Merge C++ conversion into trunk (5/6 - double_int rewrite)
- References: <20120812201515.GA14973@google.com> <alpine.DEB.2.02.1208122330461.3253@laptop-mg.saclay.inria.fr>
On Sun, Aug 12, 2012 at 11:30 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
> On Sun, 12 Aug 2012, Diego Novillo wrote:
>
>> This implements the double_int rewrite.
>>
>> See http://gcc.gnu.org/ml/gcc-patches/2012-08/msg00711.html for
>> details.
>>
>> Diego.
>
>
> I am taking it as a chance to ask a couple questions about the coding
> conventions.
>
>
>> 2012-08-12 Lawrence Crowl <crowl@google.com>
>>
>> * hash-table.h
>> (typedef double_int): Change to struct (POD).
>> (double_int::make): New overloads for int to double-int
>> conversion.
>
>
> Isn't that double_int::from_* now?
>
>> +typedef struct double_int
>> {
>
> [...]
>>
>> } double_int;
>
>
> Does the coding convention say something about this verbosity?
>
>
>> + HOST_WIDE_INT to_signed () const;
>> + unsigned HOST_WIDE_INT to_unsigned () const;
>> +
>> + /* Conversion query functions. */
>> +
>> + bool fits_unsigned() const;
>> + bool fits_signed() const;
>
>
> Space before the parentheses or not?
>
>
>> +inline double_int &
>> +double_int::operator ++ ()
>> +{
>> + *this + double_int_one;
>
>
> *this += double_int_one;
> would be less confusing.
Increment/decrement operations did not exist, please do not add them
at this point.
Richard.
>> + return *this;
>> +}
>
>
> --
> Marc Glisse