aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch3.ads
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-02 15:39:08 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-02 15:39:08 +0200
commitdb72f10a75e878cf0c678e21bdc4b7222acca271 (patch)
treebb14d06f938e48886c3a29d49cfcab4c8a831a20 /gcc/ada/sem_ch3.ads
parent23685ae6ecac53a9365195feaf56c986d7c2eae0 (diff)
downloadgcc-db72f10a75e878cf0c678e21bdc4b7222acca271.zip
gcc-db72f10a75e878cf0c678e21bdc4b7222acca271.tar.gz
gcc-db72f10a75e878cf0c678e21bdc4b7222acca271.tar.bz2
[multiple changes]
2011-08-02 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch5.adb (Expand_Iterator_Loop): Code cleanup and refactoring. When a container is provided via a function call, generate a renaming of the function result. This avoids the creation of a transient scope and the premature finalization of the container. * exp_ch7.adb (Is_Container_Cursor): Removed. (Wrap_Transient_Declaration): Remove the supression of the finalization of the list controller when the declaration denotes a container cursor, it is not needed. 2011-08-02 Yannick Moy <moy@adacore.com> * restrict.adb (Check_Formal_Restriction): only issue a warning if the node is from source, instead of the original node being from source. * sem_aggr.adb (Resolve_Array_Aggregate): refine the check for a static expression, to recognize also static ranges * sem_ch3.adb, sem_ch3.ads (Analyze_Component_Declaration, Array_Type_Declaration): postpone the test for the type being a subtype mark after the type has been resolved, so that component-selection and expanded-name are discriminated. (Make_Index, Process_Range_Expr_In_Decl): add a parameter In_Iter_Schm to distinguish the case of an iteration scheme, so that an error is issed on a non-static range in SPARK except in an iteration scheme. * sem_ch5.adb (Analyze_Iteration_Scheme): call Make_Index with In_Iter_Schm = True. * sem_ch6.adb (Analyze_Subprogram_Specification): refine the check for user-defined operators so that they are allowed in renaming * sem_ch8.adb (Find_Selected_Component): refine the check for prefixing of operators so that they are allowed in renaming. Move the checks for restrictions on selector name after analysis discriminated between component-selection and expanded-name. * sem_res.adb (Resolve_Op_Concat_Arg): do not issue a warning on concatenation argument of string type if it is static. * sem_util.adb, sem_util.ads (Check_Later_Vs_Basic_Declarations): add a new function Is_Later_Declarative_Item to decice which declarations are allowed as later items, in the two different modes Ada 83 and SPARK. In the SPARK mode, add that renamings are considered as later items. (Enclosing_Package): new function to return the enclosing package (Enter_Name): correct the rule for homonyms in SPARK (Is_SPARK_Initialization_Expr): default to returning True on nodes not from source (result of expansion) to avoid issuing wrong warnings. 2011-08-02 Ed Schonberg <schonberg@adacore.com> * errout.adb: On anything but an expression First_Node returns its argument. From-SVN: r177152
Diffstat (limited to 'gcc/ada/sem_ch3.ads')
-rw-r--r--gcc/ada/sem_ch3.ads19
1 files changed, 12 insertions, 7 deletions
diff --git a/gcc/ada/sem_ch3.ads b/gcc/ada/sem_ch3.ads
index 7888a32..514cdf3 100644
--- a/gcc/ada/sem_ch3.ads
+++ b/gcc/ada/sem_ch3.ads
@@ -192,14 +192,17 @@ package Sem_Ch3 is
(I : Node_Id;
Related_Nod : Node_Id;
Related_Id : Entity_Id := Empty;
- Suffix_Index : Nat := 1);
+ Suffix_Index : Nat := 1;
+ In_Iter_Schm : Boolean := False);
-- Process an index that is given in an array declaration, an entry
-- family declaration or a loop iteration. The index is given by an
-- index declaration (a 'box'), or by a discrete range. The later can
-- be the name of a discrete type, or a subtype indication.
--
-- Related_Nod is the node where the potential generated implicit types
- -- will be inserted. The 2 last parameters are used for creating the name.
+ -- will be inserted. The next last parameters are used for creating the
+ -- name. In_Iter_Schm is True if Make_Index is called on the discrete
+ -- subtype definition in an iteration scheme.
procedure Make_Class_Wide_Type (T : Entity_Id);
-- A Class_Wide_Type is created for each tagged type definition. The
@@ -251,10 +254,11 @@ package Sem_Ch3 is
-- Priv_T is the private view of the type whose full declaration is in N.
procedure Process_Range_Expr_In_Decl
- (R : Node_Id;
- T : Entity_Id;
- Check_List : List_Id := Empty_List;
- R_Check_Off : Boolean := False);
+ (R : Node_Id;
+ T : Entity_Id;
+ Check_List : List_Id := Empty_List;
+ R_Check_Off : Boolean := False;
+ In_Iter_Schm : Boolean := False);
-- Process a range expression that appears in a declaration context. The
-- range is analyzed and resolved with the base type of the given type, and
-- an appropriate check for expressions in non-static contexts made on the
@@ -265,7 +269,8 @@ package Sem_Ch3 is
-- when the subprogram is called from Build_Record_Init_Proc and is used to
-- return a set of constraint checking statements generated by the Checks
-- package. R_Check_Off is set to True when the call to Range_Check is to
- -- be skipped.
+ -- be skipped. In_Iter_Schm is True if Process_Range_Expr_In_Decl is called
+ -- on the discrete subtype definition in an iteration scheme.
function Process_Subtype
(S : Node_Id;