aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_dim.ads
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-12-21 12:53:33 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2011-12-21 12:53:33 +0100
commit6c57023b0cdc7fccc7db3963f847dbef53d43de8 (patch)
tree9ec76b82be58b48862686ea14e152c094cd33dea /gcc/ada/sem_dim.ads
parent26cd9add744f5649af087552808b388c3109b53a (diff)
downloadgcc-6c57023b0cdc7fccc7db3963f847dbef53d43de8.zip
gcc-6c57023b0cdc7fccc7db3963f847dbef53d43de8.tar.gz
gcc-6c57023b0cdc7fccc7db3963f847dbef53d43de8.tar.bz2
[multiple changes]
2011-12-21 Gary Dismukes <dismukes@adacore.com> * gnat_ugn.texi: Minor reformatting. 2011-12-21 Ed Schonberg <schonberg@adacore.com> * exp_ch5.adb (Expand_Iterator_Loop): The cursor operation Has_Element is the formal of Iterator_Interfaces, and within the instantion of this package it is a renaming of some local function with an unrelated name. Retrieve the operation from the instance itself, not from the container package. 2011-12-21 Vincent Pucci <pucci@adacore.com> * exp_ch6.adb (Expand_Call): Expand_Put_Call_With_Dimension_String replaced by Expand_Put_Call_With_Dimension_Symbol * sem_ch12.adb (Analyze_Package_Instantiation): New check for System.Dim_Float_IO and System.Dim_Integer_IO instantiation. * sem_ch3.adb (Analyze_Declarations): Removed Remove_Dimension_In_Declaration call. * sem_dim.adb: Update comments. Redefine the representation of a Rational. Propagate all changes involving data structures and types throughout the pakage. Output the dimension aggregates for each error messages. ("/"): Rational constructor "/" removed for Whole operands. ("/"): New rational operation "/" for Rational operands. ("*"): Operation "*" between Rational and Int removed. ("abs"): New unary operator "abs" for Rational. (Analyze_Aspect_Dimension_System): Reorganized. (Analyze_Dimension_Identifier): Removed. (Copy_Dimensions): Removed. (Create_Rational_From_Expr): New Boolean parameter. (Dimensions_Msg_Of): New routine. Return a string with the dimensions of the parameter. (From_Dimension_To_String_Of_Symbols): Renaming of From_Dimension_To_String_Id. * sem_dim.ads: Update comments. (Is_Dim_IO_Package_Instantiation): New routine. (Remove_Dimension_In_Declaration): Removed. * sem_res.adb (Resolve_Op_Expon): Reorganized calls of Eval_Op_Expon_For_Dimensioned_Type and Eval_Op_Expon. * s-diflio.ads, s-diinio.ads: Update comments. From-SVN: r182575
Diffstat (limited to 'gcc/ada/sem_dim.ads')
-rw-r--r--gcc/ada/sem_dim.ads37
1 files changed, 22 insertions, 15 deletions
diff --git a/gcc/ada/sem_dim.ads b/gcc/ada/sem_dim.ads
index be6a8da..ddee3da 100644
--- a/gcc/ada/sem_dim.ads
+++ b/gcc/ada/sem_dim.ads
@@ -95,19 +95,23 @@ package Sem_Dim is
procedure Analyze_Aspect_Dimension
(N : Node_Id;
- Id : Node_Id;
+ Id : Entity_Id;
Aggr : Node_Id);
-- Analyze the contents of aspect Dimension. Associate the provided values
-- and quantifiers with the related context N.
- -- ??? comment on usage of formals needed
+ -- Id is the corresponding Aspect_Id (Aspect_Dimension)
+ -- Aggr is the corresponding expression for the aspect Dimension declared
+ -- by the declaration of N.
procedure Analyze_Aspect_Dimension_System
(N : Node_Id;
- Id : Node_Id;
- Expr : Node_Id);
+ Id : Entity_Id;
+ Aggr : Node_Id);
-- Analyze the contents of aspect Dimension_System. Extract the numerical
-- type, unit name and corresponding symbol from each indivitual dimension.
- -- ??? comment on usage of formals needed
+ -- Id is the corresponding Aspect_Id (Aspect_Dimension_System)
+ -- Aggr is the corresponding expression for the aspect Dimension_System
+ -- declared by the declaration of N.
procedure Analyze_Dimension (N : Node_Id);
-- N may denote any of the following contexts:
@@ -133,13 +137,15 @@ package Sem_Dim is
-- involved do not violate the rules of a system.
procedure Eval_Op_Expon_For_Dimensioned_Type
- (N : Node_Id;
- B_Typ : Entity_Id);
- -- Evaluate the Expon operator for dimensioned type with rational exponent
- -- ??? the above doesn't explain the purpose of this routine. why is this
- -- procedure needed?
-
- procedure Expand_Put_Call_With_Dimension_String (N : Node_Id);
+ (N : Node_Id;
+ Btyp : Entity_Id);
+ -- Evaluate the Expon operator for dimensioned type with rational exponent.
+ -- Indeed the regular Eval_Op_Expon routine (see package Sem_Eval) is
+ -- restricted to Integer exponent.
+ -- This routine deals only with rational exponent which is not an integer
+ -- if Btyp is a dimensioned type.
+
+ procedure Expand_Put_Call_With_Dimension_Symbol (N : Node_Id);
-- Determine whether N denotes a subprogram call to one of the routines
-- defined in System.Dim_Float_IO or System.Dim_Integer_IO and add an
-- extra actual to the call to represent the symbolic representation of
@@ -148,12 +154,13 @@ package Sem_Dim is
function Has_Dimension_System (Typ : Entity_Id) return Boolean;
-- Return True if type Typ has aspect Dimension_System applied to it
+ function Is_Dim_IO_Package_Instantiation (N : Node_Id) return Boolean;
+ -- Return True if N is a package instantiation of System.Dim_Integer_IO or
+ -- of System.Dim_Float_IO.
+
procedure Remove_Dimension_In_Call (Call : Node_Id);
-- Remove the dimensions from all formal parameters of Call
- procedure Remove_Dimension_In_Declaration (Decl : Node_Id);
- -- Remove the dimensions from the expression of Decl
-
procedure Remove_Dimension_In_Statement (Stmt : Node_Id);
-- Remove the dimensions associated with Stmt