From: Bob Duff <d...@adacore.com> A "return;" at the end of a procedure is unnecessary and misleading. This patch removes them.
gcc/ada/ChangeLog: * checks.adb: Remove unnecessary "return;" statements. * eval_fat.adb: Likewise. * exp_aggr.adb: Likewise. * exp_attr.adb: Likewise. * exp_ch3.adb: Likewise. * exp_ch4.adb: Likewise. * exp_ch5.adb: Likewise. * exp_ch6.adb: Likewise. * exp_unst.adb: Likewise. * krunch.adb: Likewise. * layout.adb: Likewise. * libgnat/s-excdeb.adb: Likewise. * libgnat/s-trasym__dwarf.adb: Likewise. * par-endh.adb: Likewise. * par-tchk.adb: Likewise. * sem.adb: Likewise. * sem_attr.adb: Likewise. * sem_ch6.adb: Likewise. * sem_elim.adb: Likewise. * sem_eval.adb: Likewise. * sfn_scan.adb: Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/checks.adb | 10 ++-------- gcc/ada/eval_fat.adb | 2 -- gcc/ada/exp_aggr.adb | 4 ++-- gcc/ada/exp_attr.adb | 2 +- gcc/ada/exp_ch3.adb | 6 +++--- gcc/ada/exp_ch4.adb | 12 ++++++------ gcc/ada/exp_ch5.adb | 4 ++-- gcc/ada/exp_ch6.adb | 2 +- gcc/ada/exp_unst.adb | 2 -- gcc/ada/krunch.adb | 2 -- gcc/ada/layout.adb | 4 +--- gcc/ada/libgnat/s-excdeb.adb | 2 +- gcc/ada/libgnat/s-trasym__dwarf.adb | 2 +- gcc/ada/par-endh.adb | 2 -- gcc/ada/par-tchk.adb | 1 - gcc/ada/sem.adb | 3 --- gcc/ada/sem_attr.adb | 1 - gcc/ada/sem_ch6.adb | 1 - gcc/ada/sem_elim.adb | 2 -- gcc/ada/sem_eval.adb | 1 - gcc/ada/sfn_scan.adb | 2 -- 21 files changed, 20 insertions(+), 47 deletions(-) diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 6a98292d1cc..0b3ae02259e 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -750,7 +750,7 @@ package body Checks is -- mode then just skip the check (it is not required in any case). when RE_Not_Available => - return; + null; end Apply_Address_Clause_Check; ------------------------------------- @@ -1078,7 +1078,7 @@ package body Checks is exception when RE_Not_Available => - return; + null; end; end Apply_Arithmetic_Overflow_Strict; @@ -6437,8 +6437,6 @@ package body Checks is if Debug_Flag_CC then w (" exception occurred, overflow flag set"); end if; - - return; end Enable_Overflow_Check; ------------------------ @@ -6686,8 +6684,6 @@ package body Checks is if Debug_Flag_CC then w (" exception occurred, range flag set"); end if; - - return; end Enable_Range_Check; ------------------ @@ -7091,8 +7087,6 @@ package body Checks is end loop; -- If we fall through entry was not found - - return; end Find_Check; --------------------------------- diff --git a/gcc/ada/eval_fat.adb b/gcc/ada/eval_fat.adb index 09a5b3fa1b7..5a2e43ef597 100644 --- a/gcc/ada/eval_fat.adb +++ b/gcc/ada/eval_fat.adb @@ -146,8 +146,6 @@ package body Eval_Fat is if UR_Is_Negative (X) then Fraction := -Fraction; end if; - - return; end Decompose; ------------------- diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index e3734a2d8c9..fcf57bf9c31 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -6633,7 +6633,7 @@ package body Exp_Aggr is exception when RE_Not_Available => - return; + null; end Expand_N_Aggregate; ------------------------------- @@ -7957,7 +7957,7 @@ package body Exp_Aggr is exception when RE_Not_Available => - return; + null; end Expand_N_Extension_Aggregate; ----------------------------- diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index 0f09ba587ac..4f9f16cfa55 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -8776,7 +8776,7 @@ package body Exp_Attr is exception when RE_Not_Available => - return; + null; end Expand_N_Attribute_Reference; -------------------------------- diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 7c18f81cb07..2372a9f11df 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -5956,7 +5956,7 @@ package body Exp_Ch3 is exception when RE_Not_Available => - return; + null; end Expand_Freeze_Enumeration_Type; ------------------------------- @@ -9239,7 +9239,7 @@ package body Exp_Ch3 is exception when RE_Not_Available => - return; + null; end Expand_N_Object_Declaration; --------------------------------- @@ -9501,7 +9501,7 @@ package body Exp_Ch3 is exception when RE_Not_Available => - return; + null; end Expand_Tagged_Root; ------------------------------ diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index a845982d690..76386fc9f6a 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -432,7 +432,7 @@ package body Exp_Ch4 is exception when RE_Not_Available => - return; + null; end Build_Boolean_Array_Proc_Call; --------------------------------- @@ -1236,7 +1236,7 @@ package body Exp_Ch4 is exception when RE_Not_Available => - return; + null; end Expand_Allocator_Expression; ----------------------------- @@ -5067,7 +5067,7 @@ package body Exp_Ch4 is exception when RE_Not_Available => - return; + null; end Expand_N_Allocator; ----------------------- @@ -7758,7 +7758,7 @@ package body Exp_Ch4 is exception when RE_Not_Available => - return; + null; end Expand_N_Null; --------------------- @@ -9143,7 +9143,7 @@ package body Exp_Ch4 is exception when RE_Not_Available => - return; + null; end Expand_N_Op_Expon; -------------------- @@ -13573,7 +13573,7 @@ package body Exp_Ch4 is exception when RE_Not_Available => - return; + null; end Insert_Dereference_Action; -------------------------------- diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index f46fb4779a6..66a4fc0512b 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -1154,7 +1154,7 @@ package body Exp_Ch5 is exception when RE_Not_Available => - return; + null; end Expand_Assign_Array; ------------------------------ @@ -3455,7 +3455,7 @@ package body Exp_Ch5 is exception when RE_Not_Available => - return; + null; end Expand_N_Assignment_Statement; ------------------------------ diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 621619220a0..72d00bcb318 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -5764,7 +5764,7 @@ package body Exp_Ch6 is exception when RE_Not_Available => - return; + null; end Expand_N_Simple_Return_Statement; ------------------------------ diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index 4dc75693d8f..58f668944a0 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -2305,8 +2305,6 @@ package body Exp_Unst is end if; end Adjust_One_Call; end loop Adjust_Calls; - - return; end Unnest_Subprogram; ------------------------ diff --git a/gcc/ada/krunch.adb b/gcc/ada/krunch.adb index 35df625f3bf..409431d5a69 100644 --- a/gcc/ada/krunch.adb +++ b/gcc/ada/krunch.adb @@ -271,6 +271,4 @@ begin Buffer (Len) := Buffer (J); end if; end loop; - - return; end Krunch; diff --git a/gcc/ada/layout.adb b/gcc/ada/layout.adb index 08bbcc0d9a4..099ea49656d 100644 --- a/gcc/ada/layout.adb +++ b/gcc/ada/layout.adb @@ -227,9 +227,7 @@ package body Layout is procedure Layout_Object (E : Entity_Id) is pragma Unreferenced (E); begin - -- Nothing to do for now, assume backend does the layout - - return; + null; -- Nothing to do for now, assume backend does the layout end Layout_Object; ----------------- diff --git a/gcc/ada/libgnat/s-excdeb.adb b/gcc/ada/libgnat/s-excdeb.adb index 5cbd6c09d83..4ad847817bf 100644 --- a/gcc/ada/libgnat/s-excdeb.adb +++ b/gcc/ada/libgnat/s-excdeb.adb @@ -69,7 +69,7 @@ package body System.Exceptions_Debug is procedure Local_Raise (Excep : System.Address) is pragma Warnings (Off, Excep); begin - return; + null; end Local_Raise; end System.Exceptions_Debug; diff --git a/gcc/ada/libgnat/s-trasym__dwarf.adb b/gcc/ada/libgnat/s-trasym__dwarf.adb index 1b4b807f566..479b5d34d11 100644 --- a/gcc/ada/libgnat/s-trasym__dwarf.adb +++ b/gcc/ada/libgnat/s-trasym__dwarf.adb @@ -479,7 +479,7 @@ package body System.Traceback.Symbolic is exception when others => - return; + null; end Module_Symbolic_Traceback; ------------------------------------- diff --git a/gcc/ada/par-endh.adb b/gcc/ada/par-endh.adb index b045d74bd0e..816670568a6 100644 --- a/gcc/ada/par-endh.adb +++ b/gcc/ada/par-endh.adb @@ -658,8 +658,6 @@ package body Endh is Scan; -- past junk token on same line end loop; end if; - - return; end End_Skip; -------------------- diff --git a/gcc/ada/par-tchk.adb b/gcc/ada/par-tchk.adb index 803d3a22f2d..e59d6b496a7 100644 --- a/gcc/ada/par-tchk.adb +++ b/gcc/ada/par-tchk.adb @@ -513,7 +513,6 @@ package body Tchk is Error_Msg_AP -- CODEFIX ("|missing "";"""); - return; end T_Semicolon; ------------ diff --git a/gcc/ada/sem.adb b/gcc/ada/sem.adb index dcff62e63bc..e168d62eafb 100644 --- a/gcc/ada/sem.adb +++ b/gcc/ada/sem.adb @@ -1401,7 +1401,6 @@ package body Sem is Prev => Global_Suppress_Stack_Top, Next => Suppress_Stack_Entries); Suppress_Stack_Entries := Global_Suppress_Stack_Top; - return; end Push_Global_Suppress_Stack_Entry; ------------------------------------- @@ -1422,8 +1421,6 @@ package body Sem is Prev => Local_Suppress_Stack_Top, Next => Suppress_Stack_Entries); Suppress_Stack_Entries := Local_Suppress_Stack_Top; - - return; end Push_Local_Suppress_Stack_Entry; --------------- diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 40963b0b8bc..96029444717 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -7767,7 +7767,6 @@ package body Sem_Attr is when Bad_Attribute => Set_Analyzed (N); Set_Etype (N, Any_Type); - return; end Analyze_Attribute; -------------------- diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 7bce7fb19a7..48dcf8e4f1b 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -7831,7 +7831,6 @@ package body Sem_Ch6 is end if; Overridden_Subp := Candidate; - return; end; end Check_Synchronized_Overriding; diff --git a/gcc/ada/sem_elim.adb b/gcc/ada/sem_elim.adb index 6bd3b77e2d4..7d9dca824c0 100644 --- a/gcc/ada/sem_elim.adb +++ b/gcc/ada/sem_elim.adb @@ -713,8 +713,6 @@ package body Sem_Elim is <<Continue>> Elmt := Elmt.Homonym; end loop; - - return; end Check_Eliminated; ------------------------------------- diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index 2d64d845ae2..f970932df8f 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -3997,7 +3997,6 @@ package body Sem_Eval is -- Otherwise the result depends on the right operand Fold_Uint (N, Expr_Value (Right), Rstat); - return; end Eval_Short_Circuit; ---------------- diff --git a/gcc/ada/sfn_scan.adb b/gcc/ada/sfn_scan.adb index d96a5e9f914..a0f26aa5fe3 100644 --- a/gcc/ada/sfn_scan.adb +++ b/gcc/ada/sfn_scan.adb @@ -261,8 +261,6 @@ package body SFN_Scan is if At_EOF then Error ("unexpected end of file"); end if; - - return; end Check_Not_At_EOF; ----------------- -- 2.43.0