public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] for CodePeer, omit Finalize_Address routines
@ 2017-04-25 10:09 Arnaud Charlet
  0 siblings, 0 replies; only message in thread
From: Arnaud Charlet @ 2017-04-25 10:09 UTC (permalink / raw)
  To: gcc-patches; +Cc: Stephen Baird

[-- Attachment #1: Type: text/plain, Size: 474 bytes --]

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  <baird@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.


[-- Attachment #2: difs --]
[-- Type: text/plain, Size: 1942 bytes --]

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));

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-25 10:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-25 10:09 [Ada] for CodePeer, omit Finalize_Address routines Arnaud Charlet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).