aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2014-01-27 16:27:02 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2014-01-27 17:27:02 +0100
commit42959b0c5aa6a3ff084de4b27f4b3830c417697f (patch)
tree3dfaaf77aed500ab01118f57efe4e570c777627e /gcc
parent84e90123e6f43db35b07d8081fcdcb7fd08cdeda (diff)
downloadgcc-42959b0c5aa6a3ff084de4b27f4b3830c417697f.zip
gcc-42959b0c5aa6a3ff084de4b27f4b3830c417697f.tar.gz
gcc-42959b0c5aa6a3ff084de4b27f4b3830c417697f.tar.bz2
gnat_ugn.texi: Add Short_Enums to documentation of -gnatet/-gnateT.
2014-01-27 Robert Dewar <dewar@adacore.com> * gnat_ugn.texi: Add Short_Enums to documentation of -gnatet/-gnateT. 2014-01-27 Robert Dewar <dewar@adacore.com> * sem_prag.adb (Analyze_Input_Item): Correct check for input item in same package. * sem_util.ads, sem_util.adb (Within_Scope): New function. From-SVN: r207134
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog11
-rw-r--r--gcc/ada/gnat_ugn.texi1
-rw-r--r--gcc/ada/sem_prag.adb4
-rw-r--r--gcc/ada/sem_util.adb19
-rw-r--r--gcc/ada/sem_util.ads3
5 files changed, 36 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 363c4c9..929297b 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,14 @@
+2014-01-27 Robert Dewar <dewar@adacore.com>
+
+ * gnat_ugn.texi: Add Short_Enums to documentation of
+ -gnatet/-gnateT.
+
+2014-01-27 Robert Dewar <dewar@adacore.com>
+
+ * sem_prag.adb (Analyze_Input_Item): Correct check for input
+ item in same package.
+ * sem_util.ads, sem_util.adb (Within_Scope): New function.
+
2014-01-26 Arnaud Charlet <charlet@adacore.com>
* a-intnam-lynxos.ads, mlib-tgt-specific-lynxos.adb,
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index ca3eacc..17983ef 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -3869,6 +3869,7 @@ Long_Size : Pos; -- Standard.Long_Integer'Size
Maximum_Alignment : Pos; -- Maximum permitted alignment
Max_Unaligned_Field : Pos; -- Maximum size for unaligned bit field
Pointer_Size : Pos; -- System.Address'Size
+Short_Enums : Nat; -- Short foreign convention enums?
Short_Size : Pos; -- Standard.Short_Integer'Size
Strict_Alignment : Nat; -- Strict alignment?
System_Allocator_Alignment : Nat; -- Alignment for malloc calls
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index e76e688..70f9017 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -2551,11 +2551,11 @@ package body Sem_Prag is
-- The input cannot denote states or variables declared
-- within the related package.
- if In_Same_Code_Unit (Item, Input_Id) then
+ if Within_Scope (Input_Id, Current_Scope) then
Error_Msg_Name_1 := Chars (Pack_Id);
Error_Msg_NE
("input item & cannot denote a visible variable or "
- & "state of package %", Input, Input_Id);
+ & "state in package %", Input, Input_Id);
-- Detect a duplicate use of the same input item
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index cf00b2f..9c9a227 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -16100,6 +16100,25 @@ package body Sem_Util is
return Is_Init_Proc (S);
end Within_Init_Proc;
+ ------------------
+ -- Within_Scope --
+ ------------------
+
+ function Within_Scope (E : Entity_Id; S : Entity_Id) return Boolean is
+ SE : Entity_Id;
+ begin
+ SE := Scope (E);
+ loop
+ if SE = S then
+ return True;
+ elsif SE = Standard_Standard then
+ return False;
+ else
+ SE := Scope (SE);
+ end if;
+ end loop;
+ end Within_Scope;
+
----------------
-- Wrong_Type --
----------------
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index 3fb9cda..2e291ae 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -1754,6 +1754,9 @@ package Sem_Util is
function Within_Init_Proc return Boolean;
-- Determines if Current_Scope is within an init proc
+ function Within_Scope (E : Entity_Id; S : Entity_Id) return Boolean;
+ -- Returns True if entity Id is declared within scope S
+
procedure Wrong_Type (Expr : Node_Id; Expected_Type : Entity_Id);
-- Output error message for incorrectly typed expression. Expr is the node
-- for the incorrectly typed construct (Etype (Expr) is the type found),