aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-01-31 16:51:51 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2014-01-31 16:51:51 +0100
commitd950f05197f4a02eb6e1347b068bbeaee3b4f768 (patch)
treeb0e662532ff1b1a2d622983d0182c45dc526a4e7
parent74c101097fb411445f543989120d83f53de5e4b0 (diff)
downloadgcc-d950f05197f4a02eb6e1347b068bbeaee3b4f768.zip
gcc-d950f05197f4a02eb6e1347b068bbeaee3b4f768.tar.gz
gcc-d950f05197f4a02eb6e1347b068bbeaee3b4f768.tar.bz2
[multiple changes]
2014-01-31 Hristian Kirtchev <kirtchev@adacore.com> * sem_res.adb (Resolve_Entity_Name): Comment reformatting. Allow volatile objects in various generated checks. 2014-01-31 Ed Schonberg <schonberg@adacore.com> * sem_attr.adb (Analyze_Attribute, case 'Update): For a record component association, set the etype of the identifier, for SPARK use. 2014-01-31 Ed Schonberg <schonberg@adacore.com> * exp_ch6.adb (Has_Visibility_Of_Subprogram): If type is not declared in a package, not checks can apply to the subprogram. From-SVN: r207353
-rw-r--r--gcc/ada/ChangeLog16
-rw-r--r--gcc/ada/exp_ch6.adb11
-rw-r--r--gcc/ada/sem_attr.adb5
-rw-r--r--gcc/ada/sem_res.adb18
4 files changed, 38 insertions, 12 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 12f5d5a..23cfa54 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,19 @@
+2014-01-31 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_res.adb (Resolve_Entity_Name): Comment
+ reformatting. Allow volatile objects in various generated checks.
+
+2014-01-31 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_attr.adb (Analyze_Attribute, case 'Update): For a record
+ component association, set the etype of the identifier, for
+ SPARK use.
+
+2014-01-31 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch6.adb (Has_Visibility_Of_Subprogram): If type is not
+ declared in a package, not checks can apply to the subprogram.
+
2014-01-31 Robert Dewar <dewar@adacore.com>
* erroutc.adb (Validate_Specific_Warnings): Warnings are
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index 494f11e..d4b0cc0 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -8697,9 +8697,7 @@ package body Exp_Ch6 is
function Has_Public_Visibility_Of_Subprogram return Boolean is
Subp_Decl : constant Node_Id := Unit_Declaration_Node (Subp_Id);
- Vis_Decls : constant List_Id :=
- Visible_Declarations (Specification
- (Unit_Declaration_Node (Scope (Typ))));
+
begin
-- An Initialization procedure must be considered visible even
-- though it is internally generated.
@@ -8707,6 +8705,9 @@ package body Exp_Ch6 is
if Is_Init_Proc (Defining_Entity (Subp_Decl)) then
return True;
+ elsif Ekind (Scope (Typ)) /= E_Package then
+ return False;
+
-- Internally generated code is never publicly visible except
-- for a subprogram that is the implementation of an expression
-- function. In that case the visibility is determined by the
@@ -8724,7 +8725,9 @@ package body Exp_Ch6 is
-- declarations of the package containing the type.
else
- return List_Containing (Subp_Decl) = Vis_Decls;
+ return List_Containing (Subp_Decl) =
+ Visible_Declarations
+ (Specification (Unit_Declaration_Node (Scope (Typ))));
end if;
end Has_Public_Visibility_Of_Subprogram;
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index b69c1b2..5770144 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -6014,10 +6014,11 @@ package body Sem_Attr is
while Present (Comp_Or_Discr) loop
if Chars (Comp_Or_Discr) = Comp_Name then
- -- Record component entity in the given aggregate choice,
- -- for subsequent resolution.
+ -- Record component entity and type in the given aggregate
+ -- choice, for subsequent resolution.
Set_Entity (Comp, Comp_Or_Discr);
+ Set_Etype (Comp, Etype (Comp_Or_Discr));
exit;
end if;
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index a01c20a..7cb47f2 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -6523,15 +6523,15 @@ package body Sem_Res is
Prev := N;
while Present (Par) loop
- -- The variable can appear on either side of an assignment
+ -- The volatile object can appear on either side of an assignment
if Nkind (Par) = N_Assignment_Statement then
Usage_OK := True;
exit;
- -- The variable is part of the initialization expression of an
- -- object. Ensure that the climb of the parent chain came from the
- -- expression side and not from the name side.
+ -- The volatile object is part of the initialization expression of
+ -- another object. Ensure that the climb of the parent chain came
+ -- from the expression side and not from the name side.
elsif Nkind (Par) = N_Object_Declaration
and then Present (Expression (Par))
@@ -6540,8 +6540,8 @@ package body Sem_Res is
Usage_OK := True;
exit;
- -- The variable appears as an actual parameter in a call to an
- -- instance of Unchecked_Conversion whose result is renamed.
+ -- The volatile object appears as an actual parameter in a call to
+ -- an instance of Unchecked_Conversion whose result is renamed.
elsif Nkind (Par) = N_Function_Call
and then Is_Unchecked_Conversion_Instance (Entity (Name (Par)))
@@ -6558,6 +6558,12 @@ package body Sem_Res is
Usage_OK := True;
exit;
+ -- Allow references to volatile objects in various checks
+
+ elsif Nkind (Par) in N_Raise_xxx_Error then
+ Usage_OK := True;
+ exit;
+
-- Prevent the search from going too far
elsif Is_Body_Or_Package_Declaration (Par) then