summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch9.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-15 12:57:34 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-15 12:57:34 +0000
commite0c769173e79fbee9bd1aba12d1ae19a2e357513 (patch)
tree3489ca9074d53f4ef4b6e41caf8e4ddb5ef09213 /gcc/ada/exp_ch9.adb
parentba14ef4a5e49f28bb4f8714cb23d392150ac76a1 (diff)
downloadgcc-e0c769173e79fbee9bd1aba12d1ae19a2e357513.tar.gz
2009-04-15 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch9.adb: Comment improvements. (Build_Entry_Family_Name): Add parentheses around the index of a entry family member. 2009-04-15 Bob Duff <duff@adacore.com> * sem_warn.adb (Check_Infinite_Loop_Warning): Catch cases like "while X /= null loop" where X is unchanged inside the loop. We were not warning in this case, because of the pointers -- we feared that the loop variable could be updated via a pointer, if there are any pointers around the place. But that is impossible in this case. * sem_util.adb (May_Be_Lvalue): This routine was overly pessimistic in the case of dereferences. In X.all, X cannot be an l-value. We now catch that case (and implicit dereferences, too). 2009-04-15 Vincent Celier <celier@adacore.com> * sinput-p.ads, sinput-p.adb (Clear_Source_File_Table): New procedure 2009-04-15 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Is_Actual_Of_Previous_Formal): Make fully recursive. From code reading. (Analyze_Package_Instantiation): If generic unit in child instance is the same as generic unit in parent instance, look for an outer homonym to locate the desired generic. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146112 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch9.adb')
-rw-r--r--gcc/ada/exp_ch9.adb41
1 files changed, 25 insertions, 16 deletions
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index 1a91bf1b0a3..e4afe673cec 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -1132,8 +1132,9 @@ package body Exp_Ch9 is
-- for Lnn in Family_Low .. Family_High loop
-- Inn := Inn + 1;
-- Set_Entry_Name
- -- (_init._object, Inn, new String ("<Entry name> " & Lnn'Img));
- -- _init._task_id
+ -- (_init._object <or> _init._task_id,
+ -- Inn,
+ -- new String ("<Entry name>(" & Lnn'Img & ")"));
-- end loop;
-- Note that the bounds of the range may reference discriminants. The
-- above construct is added directly to the statements of the block.
@@ -1141,8 +1142,10 @@ package body Exp_Ch9 is
procedure Build_Entry_Name (Id : Entity_Id);
-- Generate:
-- Inn := Inn + 1;
- -- Set_Entry_Name (_init._task_id, Inn, new String ("<Entry name>");
- -- _init._object
+ -- Set_Entry_Name
+ -- (_init._object <or>_init._task_id,
+ -- Inn,
+ -- new String ("<Entry name>");
-- The above construct is added directly to the statements of the block.
function Build_Set_Entry_Name_Call (Arg3 : Node_Id) return Node_Id;
@@ -1213,13 +1216,13 @@ package body Exp_Ch9 is
begin
Get_Name_String (Chars (Id));
- if Is_Enumeration_Type (Etype (Def)) then
- Name_Len := Name_Len + 1;
- Name_Buffer (Name_Len) := ' ';
- end if;
+ -- Add a leading '('
+
+ Name_Len := Name_Len + 1;
+ Name_Buffer (Name_Len) := '(';
-- Generate:
- -- new String'("<Entry name>" & Lnn'Img);
+ -- new String'("<Entry name>(" & Lnn'Img & ")");
-- This is an implicit heap allocation, and Comes_From_Source is
-- False, which ensures that it will get flagged as a violation of
@@ -1233,13 +1236,18 @@ package body Exp_Ch9 is
Expression =>
Make_Op_Concat (Loc,
Left_Opnd =>
- Make_String_Literal (Loc,
- String_From_Name_Buffer),
+ Make_Op_Concat (Loc,
+ Left_Opnd =>
+ Make_String_Literal (Loc,
+ Strval => String_From_Name_Buffer),
+ Right_Opnd =>
+ Make_Attribute_Reference (Loc,
+ Prefix =>
+ New_Reference_To (L_Id, Loc),
+ Attribute_Name => Name_Img)),
Right_Opnd =>
- Make_Attribute_Reference (Loc,
- Prefix =>
- New_Reference_To (L_Id, Loc),
- Attribute_Name => Name_Img))));
+ Make_String_Literal (Loc,
+ Strval => ")"))));
Increment_Index (L_Stmts);
Append_To (L_Stmts, Build_Set_Entry_Name_Call (Val));
@@ -1247,7 +1255,8 @@ package body Exp_Ch9 is
-- Generate:
-- for Lnn in Family_Low .. Family_High loop
-- Inn := Inn + 1;
- -- Set_Entry_Name (_init._task_id, Inn, <Val>);
+ -- Set_Entry_Name
+ -- (_init._object <or> _init._task_id, Inn, <Val>);
-- end loop;
Append_To (B_Stmts,