Patchwork Merge C++ conversion into trunk (0/6 - Overview)

login
register
mail settings
Submitter H.J. Lu
Date Aug. 12, 2012, 10:38 p.m.
Message ID <CAMe9rOofYC=aARt6zSZEqFMsTx+AsE8a7u+UrpcUJbM_d5GVTg@mail.gmail.com>
Download mbox | patch
Permalink /patch/176807/
State New
Headers show

Comments

H.J. Lu - Aug. 12, 2012, 10:38 p.m.
On Sun, Aug 12, 2012 at 3:33 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sun, Aug 12, 2012 at 1:04 PM, Diego Novillo <dnovillo@google.com> wrote:
>> I will be sending 6 patches that implement all the changes we
>> have been making on the cxx-conversion branch.  As described in
>> http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, these patches
>> change the default bootstrap process so that stage 1 always
>> builds with a C++ compiler.
>>
>> Other than the bootstrap change, the patches make no functional
>> changes to the compiler.  Everything should build as it does now
>> in trunk.
>>
>> I have split the merge in 6 main patches.  I will send these
>> patches to the respective maintainers and gcc-patches.
>> Please remember that the patches conform to the new C++ coding
>> guidelines (http://gcc.gnu.org/codingconventions.html#Cxx_Conventions):
>>
>> 1- Configuration changes.
>> 2- Re-write of VEC.
>> 3- Re-write of gengtype to support C++ templates and
>>    user-provided marking functions.
>> 4- New hash table class.
>> 5- Re-write double_int.
>> 6- Implement tree macros as inline functions so they can be
>>    called from gdb.
>>
>> As discussed before, several of these patches do not fully change
>> the call sites to use the new APIs.  We will do this change once
>> the branch has been merged into trunk.  Otherwise, the branch
>> becomes a maintenance nightmare (despite not having changed many
>> caller sites we were already starting to run into maintenance
>> problems).
>>
>> For those who would like to build the conversion, you can either
>> checkout the branch from SVN
>> (svn://gcc.gnu.org/gcc/branches/cxx-conversion) or get the merged
>> trunk I have in the git repo (branch dnovillo/cxx-conversion).
>>
>
> dnovillo/cxx-conversion git branch failed to bootstrap on
> Fedora 17 x86-64 when configured with
>
> --enable-languages=c,c++,fortran,java,lto,objc,obj-c++,go
>
> I got
>
> /export/gnu/import/git/gcc-x32/gcc/objc/objc-act.c: In function
> \u2018tree_node* objc_build_constructor(tree,
> vec_t<constructor_elt_d>*)\u2019:
> /export/gnu/import/git/gcc-x32/gcc/objc/objc-act.c:3212:44: error:
> base operand of \u2018->\u2019 has non-pointer type
> \u2018constructor_elt_d\u2019
>    if (!VEC_index (constructor_elt, elts, 0)->index)
>

This patch fixes the error:
Diego Novillo - Aug. 13, 2012, 12:27 a.m.
On 12-08-12 18:38 , H.J. Lu wrote:
> On Sun, Aug 12, 2012 at 3:33 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Sun, Aug 12, 2012 at 1:04 PM, Diego Novillo <dnovillo@google.com> wrote:
>>> I will be sending 6 patches that implement all the changes we
>>> have been making on the cxx-conversion branch.  As described in
>>> http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, these patches
>>> change the default bootstrap process so that stage 1 always
>>> builds with a C++ compiler.
>>>
>>> Other than the bootstrap change, the patches make no functional
>>> changes to the compiler.  Everything should build as it does now
>>> in trunk.
>>>
>>> I have split the merge in 6 main patches.  I will send these
>>> patches to the respective maintainers and gcc-patches.
>>> Please remember that the patches conform to the new C++ coding
>>> guidelines (http://gcc.gnu.org/codingconventions.html#Cxx_Conventions):
>>>
>>> 1- Configuration changes.
>>> 2- Re-write of VEC.
>>> 3- Re-write of gengtype to support C++ templates and
>>>     user-provided marking functions.
>>> 4- New hash table class.
>>> 5- Re-write double_int.
>>> 6- Implement tree macros as inline functions so they can be
>>>     called from gdb.
>>>
>>> As discussed before, several of these patches do not fully change
>>> the call sites to use the new APIs.  We will do this change once
>>> the branch has been merged into trunk.  Otherwise, the branch
>>> becomes a maintenance nightmare (despite not having changed many
>>> caller sites we were already starting to run into maintenance
>>> problems).
>>>
>>> For those who would like to build the conversion, you can either
>>> checkout the branch from SVN
>>> (svn://gcc.gnu.org/gcc/branches/cxx-conversion) or get the merged
>>> trunk I have in the git repo (branch dnovillo/cxx-conversion).
>>>
>>
>> dnovillo/cxx-conversion git branch failed to bootstrap on
>> Fedora 17 x86-64 when configured with
>>
>> --enable-languages=c,c++,fortran,java,lto,objc,obj-c++,go
>>
>> I got
>>
>> /export/gnu/import/git/gcc-x32/gcc/objc/objc-act.c: In function
>> \u2018tree_node* objc_build_constructor(tree,
>> vec_t<constructor_elt_d>*)\u2019:
>> /export/gnu/import/git/gcc-x32/gcc/objc/objc-act.c:3212:44: error:
>> base operand of \u2018->\u2019 has non-pointer type
>> \u2018constructor_elt_d\u2019
>>     if (!VEC_index (constructor_elt, elts, 0)->index)
>>
>
> This patch fixes the error:
>
> diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
> index 5c924bf..caa16c7 100644
> --- a/gcc/objc/objc-act.c
> +++ b/gcc/objc/objc-act.c
> @@ -3209,7 +3209,7 @@ objc_build_constructor (tree type,
> VEC(constructor_elt,gc) *elts)
>   #ifdef OBJCPLUS
>     /* Adjust for impedance mismatch.  We should figure out how to build
>        CONSTRUCTORs that consistently please both the C and C++ gods.  */
> -  if (!VEC_index (constructor_elt, elts, 0)->index)
> +  if (!VEC_index (constructor_elt, elts, 0).index)
>       TREE_TYPE (constructor) = init_list_type_node;
>   #endif

Thanks.  Missed this because --enable-languages=all does not enable 
obj-c++.  Please commit to the branch.  I'll update the git image.


Diego.
H.J. Lu - Aug. 13, 2012, 2:44 a.m.
On Sun, Aug 12, 2012 at 5:27 PM, Diego Novillo <dnovillo@google.com> wrote:
> On 12-08-12 18:38 , H.J. Lu wrote:
>>
>> On Sun, Aug 12, 2012 at 3:33 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>
>>> On Sun, Aug 12, 2012 at 1:04 PM, Diego Novillo <dnovillo@google.com>
>>> wrote:
>>>>
>>>> I will be sending 6 patches that implement all the changes we
>>>> have been making on the cxx-conversion branch.  As described in
>>>> http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, these patches
>>>> change the default bootstrap process so that stage 1 always
>>>> builds with a C++ compiler.
>>>>
>>>> Other than the bootstrap change, the patches make no functional
>>>> changes to the compiler.  Everything should build as it does now
>>>> in trunk.
>>>>
>>>> I have split the merge in 6 main patches.  I will send these
>>>> patches to the respective maintainers and gcc-patches.
>>>> Please remember that the patches conform to the new C++ coding
>>>> guidelines (http://gcc.gnu.org/codingconventions.html#Cxx_Conventions):
>>>>
>>>> 1- Configuration changes.
>>>> 2- Re-write of VEC.
>>>> 3- Re-write of gengtype to support C++ templates and
>>>>     user-provided marking functions.
>>>> 4- New hash table class.
>>>> 5- Re-write double_int.
>>>> 6- Implement tree macros as inline functions so they can be
>>>>     called from gdb.
>>>>
>>>> As discussed before, several of these patches do not fully change
>>>> the call sites to use the new APIs.  We will do this change once
>>>> the branch has been merged into trunk.  Otherwise, the branch
>>>> becomes a maintenance nightmare (despite not having changed many
>>>> caller sites we were already starting to run into maintenance
>>>> problems).
>>>>
>>>> For those who would like to build the conversion, you can either
>>>> checkout the branch from SVN
>>>> (svn://gcc.gnu.org/gcc/branches/cxx-conversion) or get the merged
>>>> trunk I have in the git repo (branch dnovillo/cxx-conversion).
>>>>
>>>
>>> dnovillo/cxx-conversion git branch failed to bootstrap on
>>> Fedora 17 x86-64 when configured with
>>>
>>> --enable-languages=c,c++,fortran,java,lto,objc,obj-c++,go
>>>
>>> I got
>>>
>>> /export/gnu/import/git/gcc-x32/gcc/objc/objc-act.c: In function
>>> \u2018tree_node* objc_build_constructor(tree,
>>> vec_t<constructor_elt_d>*)\u2019:
>>> /export/gnu/import/git/gcc-x32/gcc/objc/objc-act.c:3212:44: error:
>>> base operand of \u2018->\u2019 has non-pointer type
>>> \u2018constructor_elt_d\u2019
>>>     if (!VEC_index (constructor_elt, elts, 0)->index)
>>>
>>
>> This patch fixes the error:
>>
>> diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
>> index 5c924bf..caa16c7 100644
>> --- a/gcc/objc/objc-act.c
>> +++ b/gcc/objc/objc-act.c
>> @@ -3209,7 +3209,7 @@ objc_build_constructor (tree type,
>> VEC(constructor_elt,gc) *elts)
>>   #ifdef OBJCPLUS
>>     /* Adjust for impedance mismatch.  We should figure out how to build
>>        CONSTRUCTORs that consistently please both the C and C++ gods.  */
>> -  if (!VEC_index (constructor_elt, elts, 0)->index)
>> +  if (!VEC_index (constructor_elt, elts, 0).index)
>>       TREE_TYPE (constructor) = init_list_type_node;
>>   #endif
>
>
> Thanks.  Missed this because --enable-languages=all does not enable obj-c++.
> Please commit to the branch.  I'll update the git image.
>
>

I checked it into cxx-conversion branch.

Patch

diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 5c924bf..caa16c7 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -3209,7 +3209,7 @@  objc_build_constructor (tree type,
VEC(constructor_elt,gc) *elts)
 #ifdef OBJCPLUS
   /* Adjust for impedance mismatch.  We should figure out how to build
      CONSTRUCTORs that consistently please both the C and C++ gods.  */
-  if (!VEC_index (constructor_elt, elts, 0)->index)
+  if (!VEC_index (constructor_elt, elts, 0).index)
     TREE_TYPE (constructor) = init_list_type_node;
 #endif