aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_attr.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2017-01-23 12:51:26 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2017-01-23 12:51:26 +0100
commit0f83b0444cf59c7d73fd870e71f6cac3c69a134e (patch)
tree3cd396db2fefb65be70f35f769705e23a6e844cb /gcc/ada/sem_attr.adb
parent52b70b1bef33b0a6a339c631b084cf030bc501e9 (diff)
downloadgcc-0f83b0444cf59c7d73fd870e71f6cac3c69a134e.zip
gcc-0f83b0444cf59c7d73fd870e71f6cac3c69a134e.tar.gz
gcc-0f83b0444cf59c7d73fd870e71f6cac3c69a134e.tar.bz2
[multiple changes]
2017-01-23 Gary Dismukes <dismukes@adacore.com> * a-calend.adb, prep.adb, debug.adb, prj.ads, prepcomp.adb, exp_disp.adb, s-imgrea.adb, g-socket.adb, g-socket.ads, sem_ch13.adb, prj-tree.ads: Minor spelling change for consistency (behaviour -> behavior). 2017-01-23 Ed Schonberg <schonberg@adacore.com> * scng.adb (Scan): Use Ada version Ada_2020 to flag use of Target_Name. * par-ch4.adb (P_Primary): Ditto. * opt.ads: Add Ada_2020 (optimistically) to enumeration list of Ada_Version_Type. * switch-c.adb (Scan_Front_End_Switches): Recognize -gnat2020 for new Ada version Ada_2020. 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com> * exp_attr.adb (Expand_Loop_Entry_Attribute): Force the generation of a nominal type for the constant which captures the value of the attribute prefix. Various clean ups. * sem_attr.adb (Analyze_Attribute): Clean up the processing of 'Loop_Entry. 2017-01-23 Yannick Moy <moy@adacore.com> * sem_util.adb (Has_Enabled_Property): Treat protected objects and variables differently from other variables. From-SVN: r244787
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r--gcc/ada/sem_attr.adb30
1 files changed, 14 insertions, 16 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 5c244ee..bb719d3 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -4295,13 +4295,13 @@ package body Sem_Attr is
-- Local variables
- Context : constant Node_Id := Parent (N);
- Attr : Node_Id;
- Enclosing_Loop : Node_Id;
- Loop_Id : Entity_Id := Empty;
- Scop : Entity_Id;
- Stmt : Node_Id;
- Enclosing_Pragma : Node_Id := Empty;
+ Context : constant Node_Id := Parent (N);
+ Attr : Node_Id;
+ Encl_Loop : Node_Id;
+ Encl_Prag : Node_Id := Empty;
+ Loop_Id : Entity_Id := Empty;
+ Scop : Entity_Id;
+ Stmt : Node_Id;
-- Start of processing for Loop_Entry
@@ -4419,7 +4419,7 @@ package body Sem_Attr is
Name_Assert_And_Cut,
Name_Assume)
then
- Enclosing_Pragma := Original_Node (Stmt);
+ Encl_Prag := Original_Node (Stmt);
-- Locate the enclosing loop (if any). Note that Ada 2012 array
-- iteration may be expanded into several nested loops, we are
@@ -4431,14 +4431,14 @@ package body Sem_Attr is
and then Comes_From_Source (Original_Node (Stmt))
and then Nkind (Original_Node (Stmt)) = N_Loop_Statement
then
- Enclosing_Loop := Stmt;
+ Encl_Loop := Stmt;
-- The original attribute reference may lack a loop name. Use
-- the name of the enclosing loop because it is the related
-- loop.
if No (Loop_Id) then
- Loop_Id := Entity (Identifier (Enclosing_Loop));
+ Loop_Id := Entity (Identifier (Encl_Loop));
end if;
exit;
@@ -4467,7 +4467,7 @@ package body Sem_Attr is
then
null;
- elsif No (Enclosing_Pragma) then
+ elsif No (Encl_Prag) then
Error_Attr ("attribute% must appear within appropriate pragma", N);
end if;
@@ -4504,8 +4504,8 @@ package body Sem_Attr is
then
null;
- elsif Present (Enclosing_Loop)
- and then Entity (Identifier (Enclosing_Loop)) /= Loop_Id
+ elsif Present (Encl_Loop)
+ and then Entity (Identifier (Encl_Loop)) /= Loop_Id
then
Error_Attr_P
("prefix of attribute % that applies to outer loop must denote "
@@ -4521,9 +4521,7 @@ package body Sem_Attr is
-- early transformation also avoids the generation of a useless loop
-- entry constant.
- if Present (Enclosing_Pragma)
- and then Is_Ignored (Enclosing_Pragma)
- then
+ if Present (Encl_Prag) and then Is_Ignored (Encl_Prag) then
Rewrite (N, Relocate_Node (P));
Preanalyze_And_Resolve (N);