This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH,RFC/RFH] remove uses of build_constructor_from_list from?Ada FE


> 	* gcc-interface/gigi.h (gnat_build_constructor): Take a VEC instead of
> 	a TREE_LIST.  Update commit.
> 	* gcc-interface/trans.c (gigi): Build a VEC instead of a TREE_LIST.
> 	Adjust call to gnat_build_constructor.
> 	(Attribute_to_gnu): Likewise.
> 	(gnat_to_gnu): Likewise.
> 	(pos_to_constructor): Likewise.
> 	(extract_values): Likewise.
> 	* gcc-interface/utils.c (build_template): Likewise.
> 	(convert_vms_descriptor64): Likewise.
> 	(convert_vms_descriptor32): Likewise.
> 	(convert_to_fat_pointer): Likewise.
> 	(convert): Likewise.
> 	(unchecked_convert): Likewise.
> 	* gcc-interface/decl.c (gnat_to_gnu_entity): Likewise.
> 	* gcc-interface/utils2.c (build_allocator): Likewise.
> 	(fill_vms_descriptor): Likewise.
> 	(gnat_build_constructor): Take a VEC instead of a TREE_LIST.
> 	(compare_elmt_bitpos): Adjust for parameters being constructor_elts
> 	instead of TREE_LISTs.

OK for mainline, modulo:

> --- a/gcc/ada/gcc-interface/utils2.c
> +++ b/gcc/ada/gcc-interface/utils2.c
> @@ -1521,34 +1521,31 @@ build_call_raise (int msg, Node_Id gnat_node, char
> kind) static int
>  compare_elmt_bitpos (const PTR rt1, const PTR rt2)
>  {
> -  const_tree const elmt1 = * (const_tree const *) rt1;
> -  const_tree const elmt2 = * (const_tree const *) rt2;
> -  const_tree const field1 = TREE_PURPOSE (elmt1);
> -  const_tree const field2 = TREE_PURPOSE (elmt2);
> +  const constructor_elt const *elmt1 = (const constructor_elt const *) rt1;
> +  const constructor_elt const *elmt2 = (const constructor_elt const *) rt2;

Misplaced 2nd const, you probably want:

  const constructor_elt * const elmt1 = (const constructor_elt * const) rt1;
  const constructor_elt * const elmt2 = (const constructor_elt * const) rt2;


-- 
Eric Botcazou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]