Patchwork [Ada] Allow pragma Partition_Elaboration_Policy in system.ads

login
register
mail settings
Submitter Arnaud Charlet
Date July 8, 2013, 8:06 a.m.
Message ID <20130708080606.GA794@adacore.com>
Download mbox | patch
Permalink /patch/257489/
State New
Headers show

Comments

Arnaud Charlet - July 8, 2013, 8:06 a.m.
This patch allows pragma Partition_Elaboration_Policy to be recognized
in system.ads in a manner analogous to the other Policy pragmas.

Given a version of System to which the line

pragma Partition_Elaboration_Policy (Sequential);

has been added, compilation of the following program
with switch -gnatj60 yields the result:

     1. pragma Partition_Elaboration_Policy (Concurrent);
        |
        >>> partition elaboration policy incompatible with
            policy in package System

     2. package pelab is end;

Tested on x86_64-pc-linux-gnu, committed on trunk

2013-07-08  Robert Dewar  <dewar@adacore.com>

	* targparm.adb (Get_Target_Parameters): Recognize pragma
	Partition_Elaboration_Policy.

Patch

Index: targparm.adb
===================================================================
--- targparm.adb	(revision 200688)
+++ targparm.adb	(working copy)
@@ -388,6 +388,16 @@ 
             Opt.Init_Or_Norm_Scalars := True;
             goto Line_Loop_Continue;
 
+         --  Partition_Elaboration_Policy
+
+         elsif System_Text (P .. P + 36) =
+                 "pragma Partition_Elaboration_Policy ("
+         then
+            P := P + 37;
+            Opt.Partition_Elaboration_Policy := System_Text (P);
+            Opt.Partition_Elaboration_Policy_Sloc := System_Location;
+            goto Line_Loop_Continue;
+
          --  Polling (On)
 
          elsif System_Text (P .. P + 19) = "pragma Polling (On);" then