aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-01-23 09:42:18 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2012-01-23 09:42:18 +0100
commit6cbab9594e2b9655126ebf2cdfb6ce02265d3d46 (patch)
tree0e3a8b5542365c8d18ae8656e213a5e28132dd98
parent67bdbf1ebd52a2599cae74d4b1b6def861c8c8bc (diff)
downloadgcc-6cbab9594e2b9655126ebf2cdfb6ce02265d3d46.zip
gcc-6cbab9594e2b9655126ebf2cdfb6ce02265d3d46.tar.gz
gcc-6cbab9594e2b9655126ebf2cdfb6ce02265d3d46.tar.bz2
[multiple changes]
2012-01-23 Robert Dewar <dewar@adacore.com> * sem_ch10.adb (Analyze_Subunit): Properly save/restore cunit restrictions. 2012-01-23 Ed Schonberg <schonberg@adacore.com> * snames.ads-tmpl: Add Name_Synchronization. * aspects.ads, aspects.adb: Add Aspect_Synchronization to enumeration type and related maps. * sem_ch13.adb (Analyze_Aspect_Specifications): Handle Aspect Synchronization, build corresponding pragma Implemented. * sem_util.adb (Implementation_Kind): Handle both explicit and implicit pragma_argument association to retrieve the given synchronization mode. From-SVN: r183410
-rw-r--r--gcc/ada/ChangeLog16
-rwxr-xr-xgcc/ada/aspects.adb3
-rwxr-xr-xgcc/ada/aspects.ads5
-rw-r--r--gcc/ada/sem_ch10.adb19
-rw-r--r--gcc/ada/sem_ch13.adb26
-rw-r--r--gcc/ada/sem_util.adb7
-rw-r--r--gcc/ada/snames.ads-tmpl4
7 files changed, 69 insertions, 11 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 6104a07..1cca2ee 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,21 @@
2012-01-23 Robert Dewar <dewar@adacore.com>
+ * sem_ch10.adb (Analyze_Subunit): Properly save/restore cunit
+ restrictions.
+
+2012-01-23 Ed Schonberg <schonberg@adacore.com>
+
+ * snames.ads-tmpl: Add Name_Synchronization.
+ * aspects.ads, aspects.adb: Add Aspect_Synchronization to
+ enumeration type and related maps.
+ * sem_ch13.adb (Analyze_Aspect_Specifications): Handle Aspect
+ Synchronization, build corresponding pragma Implemented.
+ * sem_util.adb (Implementation_Kind): Handle both explicit and
+ implicit pragma_argument association to retrieve the given
+ synchronization mode.
+
+2012-01-23 Robert Dewar <dewar@adacore.com>
+
* sem_ch10.adb, errout.adb: Minor reformatting.
2012-01-23 Ed Schonberg <schonberg@adacore.com>
diff --git a/gcc/ada/aspects.adb b/gcc/ada/aspects.adb
index cd3bdc0..5894a46 100755
--- a/gcc/ada/aspects.adb
+++ b/gcc/ada/aspects.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2010-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2010-2012, 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- --
@@ -305,6 +305,7 @@ package body Aspects is
Aspect_Stream_Size => Aspect_Stream_Size,
Aspect_Suppress => Aspect_Suppress,
Aspect_Suppress_Debug_Info => Aspect_Suppress_Debug_Info,
+ Aspect_Synchronization => Aspect_Synchronization,
Aspect_Test_Case => Aspect_Test_Case,
Aspect_Type_Invariant => Aspect_Invariant,
Aspect_Unchecked_Union => Aspect_Unchecked_Union,
diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads
index 3ce21c5..2f60cb9 100755
--- a/gcc/ada/aspects.ads
+++ b/gcc/ada/aspects.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2010-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 2010-2012, 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- --
@@ -81,6 +81,7 @@ package Aspects is
Aspect_Storage_Size,
Aspect_Stream_Size,
Aspect_Suppress,
+ Aspect_Synchronization,
Aspect_Test_Case, -- GNAT
Aspect_Type_Invariant,
Aspect_Unsuppress,
@@ -281,6 +282,7 @@ package Aspects is
Aspect_Storage_Size => Expression,
Aspect_Stream_Size => Expression,
Aspect_Suppress => Name,
+ Aspect_Synchronization => Name,
Aspect_Test_Case => Expression,
Aspect_Type_Invariant => Expression,
Aspect_Unsuppress => Name,
@@ -367,6 +369,7 @@ package Aspects is
Aspect_Stream_Size => Name_Stream_Size,
Aspect_Suppress => Name_Suppress,
Aspect_Suppress_Debug_Info => Name_Suppress_Debug_Info,
+ Aspect_Synchronization => Name_Synchronization,
Aspect_Test_Case => Name_Test_Case,
Aspect_Type_Invariant => Name_Type_Invariant,
Aspect_Unchecked_Union => Name_Unchecked_Union,
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb
index 07dfdf6..e2d1c2b 100644
--- a/gcc/ada/sem_ch10.adb
+++ b/gcc/ada/sem_ch10.adb
@@ -1962,6 +1962,12 @@ package body Sem_Ch10 is
Enclosing_Child : Entity_Id := Empty;
Svg : constant Suppress_Array := Scope_Suppress;
+ Save_Cunit_Restrictions : constant Save_Cunit_Boolean_Restrictions :=
+ Cunit_Boolean_Restrictions_Save;
+ -- Save non-partition wide restrictions before processing the subunit.
+ -- All subunits are analyzed with config restrictions reset and we need
+ -- to restore these saved values at the end.
+
procedure Analyze_Subunit_Context;
-- Capture names in use clauses of the subunit. This must be done before
-- re-installing parent declarations, because items in the context must
@@ -2175,6 +2181,15 @@ package body Sem_Ch10 is
-- Start of processing for Analyze_Subunit
begin
+ -- For subunit in main extended unit, we reset the configuration values
+ -- for the non-partition-wide restrictions. For other units reset them.
+
+ if In_Extended_Main_Source_Unit (N) then
+ Restore_Config_Cunit_Boolean_Restrictions;
+ else
+ Reset_Cunit_Boolean_Restrictions;
+ end if;
+
if Style_Check then
declare
Nam : Node_Id := Name (Unit (N));
@@ -2280,6 +2295,10 @@ package body Sem_Ch10 is
end loop;
end;
end if;
+
+ -- Deal with restore of restrictions
+
+ Cunit_Boolean_Restrictions_Restore (Save_Cunit_Restrictions);
end Analyze_Subunit;
----------------------------
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 6ffe9f2..7e46a78 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
@@ -1103,6 +1103,21 @@ package body Sem_Ch13 is
pragma Assert (not Delay_Required);
+ when Aspect_Synchronization =>
+
+ -- The aspect corresponds to pragma Implemented.
+ -- Construct the pragma
+
+ Aitem :=
+ Make_Pragma (Loc,
+ Pragma_Argument_Associations => New_List (
+ New_Occurrence_Of (E, Loc),
+ Relocate_Node (Expr)),
+ Pragma_Identifier =>
+ Make_Identifier (Sloc (Id), Name_Implemented));
+
+ pragma Assert (not Delay_Required);
+
-- Aspects corresponding to pragmas with two arguments, where
-- the second argument is a local name referring to the entity,
-- and the first argument is the aspect definition expression.
@@ -6115,11 +6130,12 @@ package body Sem_Ch13 is
Analyze (Expression (ASN));
return;
- -- Suppress/Unsuppress/Warnings should never be delayed
+ -- Suppress/Unsuppress/Synchronization/Warnings should not be delayed
- when Aspect_Suppress |
- Aspect_Unsuppress |
- Aspect_Warnings =>
+ when Aspect_Suppress |
+ Aspect_Unsuppress |
+ Aspect_Synchronization |
+ Aspect_Warnings =>
raise Program_Error;
-- Pre/Post/Invariant/Predicate take boolean expressions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 1028461..37ab950 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
@@ -6037,10 +6037,11 @@ package body Sem_Util is
function Implementation_Kind (Subp : Entity_Id) return Name_Id is
Impl_Prag : constant Node_Id := Get_Rep_Pragma (Subp, Name_Implemented);
+ Arg : Node_Id;
begin
pragma Assert (Present (Impl_Prag));
- return
- Chars (Expression (Last (Pragma_Argument_Associations (Impl_Prag))));
+ Arg := Last (Pragma_Argument_Associations (Impl_Prag));
+ return Chars (Get_Pragma_Arg (Arg));
end Implementation_Kind;
--------------------------
diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl
index df284ad..f40d0f2 100644
--- a/gcc/ada/snames.ads-tmpl
+++ b/gcc/ada/snames.ads-tmpl
@@ -6,7 +6,7 @@
-- --
-- T e m p l a t e --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
@@ -1086,6 +1086,7 @@ package Snames is
-- Additional reserved words and identifiers used in GNAT Project Files
-- Note that Name_External is already previously declared.
+
-- The names with the -- GB annotation are only used in gprbuild.
Name_Aggregate : constant Name_Id := N + $;
@@ -1226,6 +1227,7 @@ package Snames is
Name_Switches : constant Name_Id := N + $;
Name_Symbolic_Link_Supported : constant Name_Id := N + $;
Name_Synchronize : constant Name_Id := N + $;
+ Name_Synchronization : constant Name_Id := N + $;
Name_Toolchain_Description : constant Name_Id := N + $;
Name_Toolchain_Version : constant Name_Id := N + $;
Name_Trailing_Required_Switches : constant Name_Id := N + $;