diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2021-01-28 12:40:18 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-05-07 05:29:14 -0400 |
commit | a6d3b4990f9db77e2f6f7fa15d17b22ecea46e74 (patch) | |
tree | 8568dee243a782cf09bb3a84035cbf06ca83b4e2 /gcc/ada/gcc-interface | |
parent | d6de75d526bf5958fe9e66195dc0bf1c458e9b06 (diff) | |
download | gcc-a6d3b4990f9db77e2f6f7fa15d17b22ecea46e74.zip gcc-a6d3b4990f9db77e2f6f7fa15d17b22ecea46e74.tar.gz gcc-a6d3b4990f9db77e2f6f7fa15d17b22ecea46e74.tar.bz2 |
[Ada] Fix type mismatch warnings during LTO bootstrap #3
gcc/ada/
* atree.h (Slots_Ptr): Change pointed-to type to any_slot.
* fe.h (Get_RT_Exception_Name): Change type of parameter.
* namet.ads (Name_Entry): Mark non-boolean components as aliased,
reorder the boolean components and add an explicit Spare component.
* namet.adb (Name_Enter): Adjust aggregate accordingly.
(Name_Find): Likewise.
(Reinitialize): Likewise.
* namet.h (struct Name_Entry): Adjust accordingly.
(Names_Ptr): Use correct type.
(Name_Chars_Ptr): Likewise.
(Get_Name_String): Fix declaration and adjust to above changes.
* types.ads (RT_Exception_Code): Add pragma Convention C.
* types.h (Column_Number_Type): Fix original type.
(slot): Rename union type to...
(any_slot): ...this and adjust assertion accordingly.
(RT_Exception_Code): New enumeration type.
* uintp.ads (Uint_Entry): Mark components as aliased.
* uintp.h (Uints_Ptr): Use correct type.
(Udigits_Ptr): Likewise.
* gcc-interface/gigi.h (gigi): Adjust name and type of parameter.
* gcc-interface/cuintp.c (UI_To_gnu): Adjust references to Uints_Ptr
and Udigits_Ptr.
* gcc-interface/trans.c (Slots_Ptr): Adjust pointed-to type.
(gigi): Adjust type of parameter.
(build_raise_check): Add cast in call to Get_RT_Exception_Name.
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r-- | gcc/ada/gcc-interface/cuintp.c | 13 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/gigi.h | 2 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 6 |
3 files changed, 10 insertions, 11 deletions
diff --git a/gcc/ada/gcc-interface/cuintp.c b/gcc/ada/gcc-interface/cuintp.c index 08ecdae..6ac82d7 100644 --- a/gcc/ada/gcc-interface/cuintp.c +++ b/gcc/ada/gcc-interface/cuintp.c @@ -49,8 +49,7 @@ For efficiency, this method is used only for integer values larger than the constant Uint_Bias. If a Uint is less than this constant, then it contains - the integer value itself. The origin of the Uints_Ptr table is adjusted so - that a Uint value of Uint_Bias indexes the first element. + the integer value itself. First define a utility function that is build_int_cst for integral types and does a conversion for floating-point types. */ @@ -85,9 +84,9 @@ UI_To_gnu (Uint Input, tree type) gnu_ret = build_cst_from_int (comp_type, Input - Uint_Direct_Bias); else { - Int Idx = Uints_Ptr[Input].Loc; - Pos Length = Uints_Ptr[Input].Length; - Int First = Udigits_Ptr[Idx]; + Int Idx = (*Uints_Ptr)[Input - Uint_Table_Start].Loc; + Pos Length = (*Uints_Ptr)[Input - Uint_Table_Start].Length; + Int First = (*Udigits_Ptr)[Idx]; tree gnu_base; gcc_assert (Length > 0); @@ -109,14 +108,14 @@ UI_To_gnu (Uint Input, tree type) fold_build2 (MULT_EXPR, comp_type, gnu_ret, gnu_base), build_cst_from_int (comp_type, - Udigits_Ptr[Idx])); + (*Udigits_Ptr)[Idx])); else for (Idx++, Length--; Length; Idx++, Length--) gnu_ret = fold_build2 (PLUS_EXPR, comp_type, fold_build2 (MULT_EXPR, comp_type, gnu_ret, gnu_base), build_cst_from_int (comp_type, - Udigits_Ptr[Idx])); + (*Udigits_Ptr)[Idx])); } gnu_ret = convert (type, gnu_ret); diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index 7b754da..807f50d 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -235,7 +235,7 @@ extern void gigi (Node_Id gnat_root, int max_gnat_node, int number_name, Field_Offset *node_offsets_ptr, - slot *Slots, + any_slot *slots_ptr, Node_Id *next_node_ptr, Node_Id *prev_node_ptr, struct Elist_Header *elists_ptr, diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 719cdec..2a85cde 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -76,7 +76,7 @@ /* Pointers to front-end tables accessed through macros. */ Field_Offset *Node_Offsets_Ptr; -slot *Slots_Ptr; +any_slot *Slots_Ptr; Node_Id *Next_Node_Ptr; Node_Id *Prev_Node_Ptr; struct Elist_Header *Elists_Ptr; @@ -280,7 +280,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name ATTRIBUTE_UNUSED, Field_Offset *node_offsets_ptr, - slot *slots_ptr, + any_slot *slots_ptr, Node_Id *next_node_ptr, Node_Id *prev_node_ptr, struct Elist_Header *elists_ptr, @@ -752,7 +752,7 @@ build_raise_check (int check, enum exception_info_kind kind) strcpy (Name_Buffer, pfx); Name_Len = sizeof (pfx) - 1; - Get_RT_Exception_Name (check); + Get_RT_Exception_Name ((enum RT_Exception_Code) check); if (kind == exception_simple) { |