Calls to Finalize_Address routines were already being omitted for CodePeer. If we are never going to call them, then we also shouldn't generate them.
This change has no user-visible effect except when Gnat2scil is running. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-04-25 Steve Baird <ba...@adacore.com> * exp_ch7.adb (Build_Array_Deep_Procs, Build_Record_Deep_Procs, Make_Finalize_Address_Body): Don't generate Finalize_Address routines for CodePeer.
Index: exp_ch7.adb =================================================================== --- exp_ch7.adb (revision 247157) +++ exp_ch7.adb (working copy) @@ -787,13 +787,15 @@ Typ => Typ, Stmts => Make_Deep_Array_Body (Finalize_Case, Typ))); - -- Create TSS primitive Finalize_Address. + -- Create TSS primitive Finalize_Address (unless CodePeer_Mode). - Set_TSS (Typ, - Make_Deep_Proc - (Prim => Address_Case, - Typ => Typ, - Stmts => Make_Deep_Array_Body (Address_Case, Typ))); + if not CodePeer_Mode then + Set_TSS (Typ, + Make_Deep_Proc + (Prim => Address_Case, + Typ => Typ, + Stmts => Make_Deep_Array_Body (Address_Case, Typ))); + end if; end if; end Build_Array_Deep_Procs; @@ -3669,13 +3671,15 @@ Typ => Typ, Stmts => Make_Deep_Record_Body (Finalize_Case, Typ))); - -- Create TSS primitive Finalize_Address + -- Create TSS primitive Finalize_Address (unless CodePeer_Mode). - Set_TSS (Typ, - Make_Deep_Proc - (Prim => Address_Case, - Typ => Typ, - Stmts => Make_Deep_Record_Body (Address_Case, Typ))); + if not CodePeer_Mode then + Set_TSS (Typ, + Make_Deep_Proc + (Prim => Address_Case, + Typ => Typ, + Stmts => Make_Deep_Record_Body (Address_Case, Typ))); + end if; end if; end Build_Record_Deep_Procs; @@ -7797,6 +7801,11 @@ return; end if; + -- Don't generate Finalize_Address routine for CodePeer + if CodePeer_Mode then + return; + end if; + Proc_Id := Make_Defining_Identifier (Loc, Make_TSS_Name (Typ, TSS_Finalize_Address));