summaryrefslogtreecommitdiff
path: root/gcc/ada/sinfo.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-02-24 15:57:59 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-02-24 15:57:59 +0000
commit77591435e713c93b828a8f55c99ac83069835b31 (patch)
tree46a167c9b553903043944a624f2a6452327543cb /gcc/ada/sinfo.ads
parentcf913da7539663d2b82329f69bc3f7cc172b7562 (diff)
downloadgcc-77591435e713c93b828a8f55c99ac83069835b31.tar.gz
2014-02-24 Ed Schonberg <schonberg@adacore.com>
* sinfo.ads, sinfo.adb: New attribute Generalized_Indexing, for indexed_components that are instances of Ada 2012 container indexing operations. Analysis and resolution of such nodes is performed on the attribute, and the original source is preserved for ASIS operations. If expansion is enabled, the indexed component is replaced by the value of this attribute, which is in a call to an Indexing aspect, in most case wrapped in a dereference operation. * sem_ch4.adb (Analyze_Indexed_Component): Create Generalized_Indexing attribute when appropriate. (Analyze_Call): If prefix is not overloadable and has an indexing aspect, transform into an indexed component so it can be analyzed as a potential container indexing. (Analyze_Expression): If node is an indexed component with a Generalized_ Indexing, do not re-analyze. * sem_res.adb (Resolve_Generalized_Indexing): Complete resolution of an indexed_component that has been transformed into a container indexing operation. (Resolve_Indexed_Component): Call the above when required. (Resolve): Do not insert an explicit dereference operation on an indexed_component whose type has an implicit dereference: the operation is inserted when resolving the related Generalized_Indexing. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208074 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sinfo.ads')
-rw-r--r--gcc/ada/sinfo.ads19
1 files changed, 18 insertions, 1 deletions
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads
index af476c0da82..e115e7ad707 100644
--- a/gcc/ada/sinfo.ads
+++ b/gcc/ada/sinfo.ads
@@ -1277,6 +1277,15 @@ package Sinfo is
-- declaration is treated as an implicit reference to the formal in the
-- ali file.
+ -- Generalized_Indexing (Node4-Sem)
+ -- Generalized_Indexing is set in Indexed_Component nodes that are Ada 2012
+ -- container indexing operations. The value of the attribute is a function
+ -- call (possibly dereferenced) that corresponds to the proper expansion
+ -- of the source indexing operation. Before expansion, the source node
+ -- is rewritten as the resolved generalized indexing. In ASIS mode, the
+ -- expansion does not take place, so that the source is preserved and
+ -- properly annotated with types.
+
-- Generic_Parent (Node5-Sem)
-- Generic_Parent is defined on declaration nodes that are instances. The
-- value of Generic_Parent is the generic entity from which the instance
@@ -3470,6 +3479,7 @@ package Sinfo is
-- Sloc contains a copy of the Sloc value of the Prefix
-- Prefix (Node3)
-- Expressions (List1)
+ -- Generalized_Indexing (Node4-Sem)
-- Atomic_Sync_Required (Flag14-Sem)
-- plus fields for expression
@@ -8912,6 +8922,8 @@ package Sinfo is
function From_Default
(N : Node_Id) return Boolean; -- Flag6
+ function Generalized_Indexing
+ (N : Node_Id) return Node_Id; -- Node4
function Generic_Associations
(N : Node_Id) return List_Id; -- List3
@@ -9908,6 +9920,9 @@ package Sinfo is
procedure Set_From_Default
(N : Node_Id; Val : Boolean := True); -- Flag6
+ procedure Set_Generalized_Indexing
+ (N : Node_Id; Val : Node_Id); -- Node4
+
procedure Set_Generic_Associations
(N : Node_Id; Val : List_Id); -- List3
@@ -10918,7 +10933,7 @@ package Sinfo is
(1 => True, -- Expressions (List1)
2 => False, -- unused
3 => True, -- Prefix (Node3)
- 4 => False, -- unused
+ 4 => False, -- Generalized_Indexing (Node4-Sem)
5 => False), -- Etype (Node5-Sem)
N_Slice =>
@@ -12372,6 +12387,7 @@ package Sinfo is
pragma Inline (From_At_End);
pragma Inline (From_At_Mod);
pragma Inline (From_Default);
+ pragma Inline (Generalized_Indexing);
pragma Inline (Generic_Associations);
pragma Inline (Generic_Formal_Declarations);
pragma Inline (Generic_Parent);
@@ -12701,6 +12717,7 @@ package Sinfo is
pragma Inline (Set_From_At_End);
pragma Inline (Set_From_At_Mod);
pragma Inline (Set_From_Default);
+ pragma Inline (Set_Generalized_Indexing);
pragma Inline (Set_Generic_Associations);
pragma Inline (Set_Generic_Formal_Declarations);
pragma Inline (Set_Generic_Parent);