diff options
author | Hristian Kirtchev <kirtchev@adacore.com> | 2019-07-04 08:07:14 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-07-04 08:07:14 +0000 |
commit | eedc5882dd635ce9cfaa650c790081b5130749af (patch) | |
tree | 378e65c731cdde63ee335b0833e2d11500e0e943 /gcc/ada/exp_ch4.adb | |
parent | 38818659c388491abe7ab11f8757c1ad2acd1506 (diff) | |
download | gcc-eedc5882dd635ce9cfaa650c790081b5130749af.zip gcc-eedc5882dd635ce9cfaa650c790081b5130749af.tar.gz gcc-eedc5882dd635ce9cfaa650c790081b5130749af.tar.bz2 |
[Ada] Minor reformatting
2019-07-04 Hristian Kirtchev <kirtchev@adacore.com>
gcc/ada/
* exp_ch3.adb, exp_ch4.adb, exp_ch4.ads, exp_ch5.adb,
exp_ch7.adb, exp_ch9.adb, exp_ch11.adb, exp_unst.adb,
rtsfind.ads, sem_attr.adb, sem_ch10.adb, sem_ch12.adb,
sem_ch13.adb, sem_dim.adb, sem_disp.adb, xref_lib.adb: Minor
reformatting.
From-SVN: r273070
Diffstat (limited to 'gcc/ada/exp_ch4.adb')
-rw-r--r-- | gcc/ada/exp_ch4.adb | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index cacc9d4..0d4c294 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -415,6 +415,52 @@ package body Exp_Ch4 is return; end Build_Boolean_Array_Proc_Call; + ----------------------- + -- Build_Eq_Call -- + ----------------------- + + function Build_Eq_Call + (Typ : Entity_Id; + Loc : Source_Ptr; + Lhs : Node_Id; + Rhs : Node_Id) return Node_Id + is + Prim : Node_Id; + Prim_E : Elmt_Id; + + begin + Prim_E := First_Elmt (Collect_Primitive_Operations (Typ)); + while Present (Prim_E) loop + Prim := Node (Prim_E); + + -- Locate primitive equality with the right signature + + if Chars (Prim) = Name_Op_Eq + and then Etype (First_Formal (Prim)) = + Etype (Next_Formal (First_Formal (Prim))) + and then Etype (Prim) = Standard_Boolean + then + if Is_Abstract_Subprogram (Prim) then + return + Make_Raise_Program_Error (Loc, + Reason => PE_Explicit_Raise); + + else + return + Make_Function_Call (Loc, + Name => New_Occurrence_Of (Prim, Loc), + Parameter_Associations => New_List (Lhs, Rhs)); + end if; + end if; + + Next_Elmt (Prim_E); + end loop; + + -- If not found, predefined operation will be used + + return Empty; + end Build_Eq_Call; + -------------------------------- -- Displace_Allocator_Pointer -- -------------------------------- @@ -1938,7 +1984,7 @@ package body Exp_Ch4 is Parameter_Specifications => Formals, Result_Definition => New_Occurrence_Of (Standard_Boolean, Loc)), - Declarations => Decls, + Declarations => Decls, Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, @@ -12553,52 +12599,6 @@ package body Exp_Ch4 is Adjust_Result_Type (N, Typ); end Expand_Short_Circuit_Operator; - ----------------------- - -- Build_Eq_Call -- - ----------------------- - - function Build_Eq_Call - (Typ : Entity_Id; - Loc : Source_Ptr; - Lhs : Node_Id; - Rhs : Node_Id) return Node_Id - is - Prim_E : Elmt_Id; - Prim : Node_Id; - - begin - Prim_E := First_Elmt (Collect_Primitive_Operations (Typ)); - while Present (Prim_E) loop - Prim := Node (Prim_E); - - -- Locate primitive equality with the right signature - - if Chars (Prim) = Name_Op_Eq - and then Etype (First_Formal (Prim)) = - Etype (Next_Formal (First_Formal (Prim))) - and then Etype (Prim) = Standard_Boolean - then - if Is_Abstract_Subprogram (Prim) then - return - Make_Raise_Program_Error (Loc, - Reason => PE_Explicit_Raise); - - else - return - Make_Function_Call (Loc, - Name => New_Occurrence_Of (Prim, Loc), - Parameter_Associations => New_List (Lhs, Rhs)); - end if; - end if; - - Next_Elmt (Prim_E); - end loop; - - -- If not found, predefined operation will be used - - return Empty; - end Build_Eq_Call; - ------------------------------------ -- Fixup_Universal_Fixed_Operation -- ------------------------------------- |