From: Marc Poulhiès Date: Fri, 5 Jun 2026 12:25:10 +0000 (+0200) Subject: ada: Minor cosmetic change: use Discard_Node X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f20643b55eae2d3cfd327586e9b2ffceefbb00d;p=thirdparty%2Fgcc.git ada: Minor cosmetic change: use Discard_Node Instead of using a dedicated block with a local variable, use the Discard_Node function. gcc/ada/ChangeLog: * exp_ch3.adb (Build_Implicit_Copy_Constructor) (Build_Implicit_Parameterless_Constructor): Refactor how node is discarded. --- diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 96374dcdb12..2f799b0a169 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -1974,16 +1974,12 @@ package body Exp_Ch3 is Set_Parameter_Specifications (Spec_Node, Parameters); Freeze_Extra_Formals (Copy_Id); - declare - Ignore : Node_Id; - begin - Ignore := - Make_Subprogram_Body (Loc, - Specification => Spec_Node, - Aspect_Specifications => Aspect_Specs, - Handled_Statement_Sequence => - Make_Handled_Sequence_Of_Statements (Loc, Body_Stmts)); - end; + Discard_Node ( + Make_Subprogram_Body (Loc, + Specification => Spec_Node, + Aspect_Specifications => Aspect_Specs, + Handled_Statement_Sequence => + Make_Handled_Sequence_Of_Statements (Loc, Body_Stmts))); Set_Is_Public (Copy_Id, Is_Public (Typ)); Set_Is_Internal (Copy_Id); @@ -2047,7 +2043,6 @@ package body Exp_Ch3 is -- Aspect Initialize enables default initialization declare - Ignore : Node_Id; Default_Initialize : constant Node_Id := Make_Aspect_Specification (Loc, Identifier => Make_Identifier (Loc, Name_Initialize), @@ -2059,12 +2054,12 @@ package body Exp_Ch3 is Box_Present => True)), Is_Parenthesis_Aggregate => True)); begin - Ignore := + Discard_Node ( Make_Subprogram_Body (Loc, Specification => Spec_Node, Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc), - Aspect_Specifications => New_List (Default_Initialize)); + Aspect_Specifications => New_List (Default_Initialize))); end; Set_Is_Public (Constructor_Id, Is_Public (Typ));