aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sinfo.ads
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2017-01-23 11:29:17 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2017-01-23 12:29:17 +0100
commitae33543ca51ec15393064ab2075fed28c33ce2d0 (patch)
tree0d42deb5fa5f86755159535db76effcdd549b3f5 /gcc/ada/sinfo.ads
parent13230c68da020c55d3369b489c0b49032637e242 (diff)
downloadgcc-ae33543ca51ec15393064ab2075fed28c33ce2d0.zip
gcc-ae33543ca51ec15393064ab2075fed28c33ce2d0.tar.gz
gcc-ae33543ca51ec15393064ab2075fed28c33ce2d0.tar.bz2
scans.ads: New token At_Sign.
2017-01-23 Ed Schonberg <schonberg@adacore.com> * scans.ads: New token At_Sign. Remove '@' from list of illegal characters for future version of the language. '@' is legal name. * scng.ads, scng.adb (Scan): Handle '@' appropriately. * scn.adb (Scan_Reserved_Identifier): An occurrence of '@' denotes a Target_Name. * par-ch4.adb (P_Name, P_Primary): Handle Target_Name. * sinfo.ads, sinfo.adb (N_Target_Name): New non-terminal node. (Has_Target_Names): New flag on N_Assignment_Statement, to indicate that RHS has occurrences of N_Target_Name. * sem.adb: Call Analyze_Target_Name. * sem_ch5.ads, sem_ch5.adb (Analyze_Target_Name): New subpogram. (urrent_LHS): Global variable that denotes LHS of assignment, used in the analysis of Target_Name nodes. * sem_res.adb (Resolve_Target_Name): New procedure. * exp_ch5.adb (Expand_Assign_With_Target_Names): (AI12-0125): N is an assignment statement whose RHS contains occurences of @ that designate the value of the LHS of the assignment. If the LHS is side-effect free the target names can be replaced with a copy of the LHS; otherwise the semantics of the assignment is described in terms of a procedure with an in-out parameter, and expanded as such. (Expand_N_Assignment_Statement): Call Expand_Assign_With_Target_Names when needed. * exp_util.adb (Insert_Actions): Take into account N_Target_Name. * sprint.adb: Handle N_Target_Name. From-SVN: r244783
Diffstat (limited to 'gcc/ada/sinfo.ads')
-rw-r--r--gcc/ada/sinfo.ads34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads
index e63229a..56c7745 100644
--- a/gcc/ada/sinfo.ads
+++ b/gcc/ada/sinfo.ads
@@ -1543,6 +1543,10 @@ package Sinfo is
-- code outside the Character range but within Wide_Character range)
-- appears in the string. Used to implement pragma preference rules.
+ -- Has_Target_Names (Flag8-Sem)
+ -- Present in assignment statements. Indicates that the RHS contains
+ -- target names (see AI12-0125-3) and must be expanded accordingly.
+
-- Has_Wide_Wide_Character (Flag13-Sem)
-- Present in string literals, set if any wide character (i.e. character
-- code outside the Wide_Character range) appears in the string. Used to
@@ -4794,6 +4798,7 @@ package Sinfo is
-- Forwards_OK (Flag5-Sem)
-- Backwards_OK (Flag6-Sem)
-- No_Ctrl_Actions (Flag7-Sem)
+ -- Has_Target_Names (Flag8-Sem)
-- Componentwise_Assignment (Flag14-Sem)
-- Suppress_Assignment_Checks (Flag18-Sem)
@@ -4808,6 +4813,19 @@ package Sinfo is
-- case the front end must generate an extra temporary and initialize
-- this temporary as required (the temporary itself is not atomic).
+ ------------------
+ -- Target_Name --
+ ------------------
+
+ -- N_Target_Name
+ -- Sloc points to @
+ -- Etype (Node5-Sem)
+
+ -- Note (Ada 2020): node is used during analysis as a placeholder for
+ -- the value of the LHS of the enclosing assignment statement. Node is
+ -- eventually rewritten together with enclosing assignment, and backends
+ -- are not aware of it.
+
-----------------------
-- 5.3 If Statement --
-----------------------
@@ -8463,6 +8481,7 @@ package Sinfo is
N_Reference,
N_Selected_Component,
N_Slice,
+ N_Target_Name,
N_Type_Conversion,
N_Unchecked_Expression,
N_Unchecked_Type_Conversion,
@@ -9385,6 +9404,9 @@ package Sinfo is
function Has_Storage_Size_Pragma
(N : Node_Id) return Boolean; -- Flag5
+ function Has_Target_Names
+ (N : Node_Id) return Boolean; -- Flag8
+
function Has_Wide_Character
(N : Node_Id) return Boolean; -- Flag11
@@ -10438,6 +10460,9 @@ package Sinfo is
procedure Set_Has_Storage_Size_Pragma
(N : Node_Id; Val : Boolean := True); -- Flag5
+ procedure Set_Has_Target_Names
+ (N : Node_Id; Val : Boolean := True); -- Flag8
+
procedure Set_Has_Wide_Character
(N : Node_Id; Val : Boolean := True); -- Flag11
@@ -11737,6 +11762,13 @@ package Sinfo is
4 => False, -- unused
5 => False), -- unused
+ N_Target_Name =>
+ (1 => False, -- unused
+ 2 => False, -- unused
+ 3 => False, -- unused
+ 4 => False, -- unused
+ 5 => False), -- Etype (Node5-Sem)
+
N_If_Statement =>
(1 => True, -- Condition (Node1)
2 => True, -- Then_Statements (List2)
@@ -12944,6 +12976,7 @@ package Sinfo is
pragma Inline (Has_Private_View);
pragma Inline (Has_Relative_Deadline_Pragma);
pragma Inline (Has_Storage_Size_Pragma);
+ pragma Inline (Has_Target_Names);
pragma Inline (Has_Wide_Character);
pragma Inline (Has_Wide_Wide_Character);
pragma Inline (Header_Size_Added);
@@ -13292,6 +13325,7 @@ package Sinfo is
pragma Inline (Set_Has_Self_Reference);
pragma Inline (Set_Has_SP_Choice);
pragma Inline (Set_Has_Storage_Size_Pragma);
+ pragma Inline (Set_Has_Target_Names);
pragma Inline (Set_Has_Wide_Character);
pragma Inline (Set_Has_Wide_Wide_Character);
pragma Inline (Set_Header_Size_Added);