aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2020-04-22 20:51:16 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-06-18 05:08:26 -0400
commit5126ca1fa7796d252c0b418f20d21073e7772508 (patch)
treee01c2ddfb79ee566e683b559a3a0944da406fd9e /gcc
parent12be130c3f1d09b4b9923de6b4c1c66d61c9497c (diff)
downloadgcc-5126ca1fa7796d252c0b418f20d21073e7772508.zip
gcc-5126ca1fa7796d252c0b418f20d21073e7772508.tar.gz
gcc-5126ca1fa7796d252c0b418f20d21073e7772508.tar.bz2
[Ada] Minor cleanup in Expand_Call_Helper
2020-06-18 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_ch6.adb (Expand_Call_Helper): Remove superfluous calls to Relocate_Node and merge calls to Analyze and Resolve in a couple of places. Do not attempt to generate a range check for an actual parameter against the formal's type of a derived subprogram after generating a conversion to the formal's type of the parent subprogram.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/exp_ch6.adb24
1 files changed, 6 insertions, 18 deletions
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index 1e0047b..9a32f7e 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -4666,9 +4666,8 @@ package body Exp_Ch6 is
procedure Convert (Act : Node_Id; Typ : Entity_Id) is
begin
- Rewrite (Act, OK_Convert_To (Typ, Relocate_Node (Act)));
- Analyze (Act);
- Resolve (Act, Typ);
+ Rewrite (Act, OK_Convert_To (Typ, Act));
+ Analyze_And_Resolve (Act, Typ);
end Convert;
-- Local variables
@@ -4686,8 +4685,8 @@ package body Exp_Ch6 is
Formal_Typ := Etype (Formal);
Parent_Typ := Etype (Parent_Formal);
- -- For an IN parameter of a scalar type, the parent formal
- -- type and derived formal type differ or the parent formal
+ -- For an IN parameter of a scalar type, the derived formal
+ -- type and parent formal type differ, and the parent formal
-- type and actual type do not match statically.
if Is_Scalar_Type (Formal_Typ)
@@ -4698,15 +4697,6 @@ package body Exp_Ch6 is
and then not Raises_Constraint_Error (Actual)
then
Convert (Actual, Parent_Typ);
- Enable_Range_Check (Actual);
-
- -- If the actual has been marked as requiring a range
- -- check, then generate it here.
-
- if Do_Range_Check (Actual) then
- Generate_Range_Check
- (Actual, Etype (Formal), CE_Range_Check_Failed);
- end if;
-- For access types, the parent formal type and actual type
-- differ.
@@ -4728,10 +4718,8 @@ package body Exp_Ch6 is
-- inlined.
Rewrite (Actual,
- Unchecked_Convert_To (Parent_Typ,
- Relocate_Node (Actual)));
- Analyze (Actual);
- Resolve (Actual, Parent_Typ);
+ Unchecked_Convert_To (Parent_Typ, Actual));
+ Analyze_And_Resolve (Actual, Parent_Typ);
end if;
-- If there is a change of representation, then generate a