aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/targparm.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-06-13 11:38:29 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-06-13 11:38:29 +0200
commit28bc33232d59072bc16ee35f5677820b455edfcd (patch)
treed434ad3c8743b3c579c8f5ce36984de47a3e600f /gcc/ada/targparm.adb
parentca6cbdca8a7223e9b7ed828306b09f80db92fdb7 (diff)
downloadgcc-28bc33232d59072bc16ee35f5677820b455edfcd.zip
gcc-28bc33232d59072bc16ee35f5677820b455edfcd.tar.gz
gcc-28bc33232d59072bc16ee35f5677820b455edfcd.tar.bz2
[multiple changes]
2014-06-13 Robert Dewar <dewar@adacore.com> * back_end.adb (Make_Id): New function. (Make_SC): New function. (Set_RND): New procedure. * back_end.ads (Make_Id): New function. (Make_SC): New function. (Set_RND): New procedure. * einfo.ads: Minor comment updates. * frontend.adb: Move Atree.Initialize call to Gnat1drv. * gnat1drv.adb (Gnat1drv): New calling sequence for Get_Target_Parameters. (Gnat1drv): Move Atree.Initialize here from Frontend. * targparm.adb (Get_Target_Parameters): New calling sequence (Get_Target_Parameters): Handle pragma Restriction (No_Dependence,..) * targparm.ads (Get_Target_Parameters): New calling sequence. 2014-06-13 Gary Dismukes <dismukes@adacore.com> * sem_prag.adb (Process_Import_Or_Interface): Exit the homonym loop if the pragma does not come from source, so that an implicit pragma Import only applies to the first declaration, avoiding possible conflicts with earlier explicit and implicit declarations due to multiple Provide_Shift_Operators pragmas. (Set_Imported): Remove previous fix that bypassed pragma duplication error. * gnat_rm.texi: Change 'equivalent' to 'similar' in description of Provide_Shift_Operators. From-SVN: r211610
Diffstat (limited to 'gcc/ada/targparm.adb')
-rw-r--r--gcc/ada/targparm.adb73
1 files changed, 69 insertions, 4 deletions
diff --git a/gcc/ada/targparm.adb b/gcc/ada/targparm.adb
index 3357c5d..0f93344ef 100644
--- a/gcc/ada/targparm.adb
+++ b/gcc/ada/targparm.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2013, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -160,7 +160,11 @@ package body Targparm is
-- Version which reads in system.ads
- procedure Get_Target_Parameters is
+ procedure Get_Target_Parameters
+ (Make_Id : Make_Id_Type := null;
+ Make_SC : Make_SC_Type := null;
+ Set_RND : Set_RND_Type := null)
+ is
Text : Source_Buffer_Ptr;
Hi : Source_Ptr;
@@ -183,7 +187,10 @@ package body Targparm is
Get_Target_Parameters
(System_Text => Text,
Source_First => 0,
- Source_Last => Hi);
+ Source_Last => Hi,
+ Make_Id => Make_Id,
+ Make_SC => Make_SC,
+ Set_RND => Set_RND);
end Get_Target_Parameters;
-- Version where caller supplies system.ads text
@@ -191,7 +198,10 @@ package body Targparm is
procedure Get_Target_Parameters
(System_Text : Source_Buffer_Ptr;
Source_First : Source_Ptr;
- Source_Last : Source_Ptr)
+ Source_Last : Source_Ptr;
+ Make_Id : Make_Id_Type := null;
+ Make_SC : Make_SC_Type := null;
+ Set_RND : Set_RND_Type := null)
is
P : Source_Ptr;
-- Scans source buffer containing source of system.ads
@@ -341,6 +351,61 @@ package body Targparm is
null;
end loop Ploop;
+ -- No_Dependence case
+
+ if System_Text (P .. P + 16) = "No_Dependence => " then
+ P := P + 17;
+
+ -- Skip this processing (and simply ignore No_Dependence lines)
+ -- if caller did not supply the three subprograms we need to
+ -- process these lines.
+
+ if Make_Id = null then
+ goto Line_Loop_Continue;
+ end if;
+
+ -- We have scanned out "pragma Restrictions (No_Dependence =>"
+
+ declare
+ Unit : Node_Id;
+ Id : Node_Id;
+ Start : Source_Ptr;
+
+ begin
+ Unit := Empty;
+
+ -- Loop through components of name, building up Unit
+
+ loop
+ Start := P;
+ while System_Text (P) /= '.'
+ and then
+ System_Text (P) /= ')'
+ loop
+ P := P + 1;
+ end loop;
+
+ Id := Make_Id (System_Text (Start .. P - 1));
+
+ -- If first name, just capture the identifier
+
+ if Unit = Empty then
+ Unit := Id;
+ else
+ Unit := Make_SC (Unit, Id);
+ end if;
+
+ exit when System_Text (P) = ')';
+ P := P + 1;
+ end loop;
+
+ Set_RND (Unit);
+ goto Line_Loop_Continue;
+ end;
+ end if;
+
+ -- Here if unrecognizable restrictions pragma form
+
Set_Standard_Error;
Write_Line
("fatal error: system.ads is incorrectly formatted");