Commit e9999161 by Arnaud Charlet

[multiple changes]

2015-03-02  Gary Dismukes  <dismukes@adacore.com>

	* einfo.adb, checks.adb: Minor reformatting and typo fixes.

2015-03-02  Ed Schonberg  <schonberg@adacore.com>

	* exp_aggr.adb (Get_Assoc_Expr): If the Default_Component_Value
	is defined for the array type, use it instead of a Default_Value
	specified for the component type itself.

From-SVN: r221102
parent c9d70ab1
2015-03-02 Gary Dismukes <dismukes@adacore.com>
* einfo.adb, checks.adb: Minor reformatting and typo fixes.
2015-03-02 Ed Schonberg <schonberg@adacore.com>
* exp_aggr.adb (Get_Assoc_Expr): If the Default_Component_Value
is defined for the array type, use it instead of a Default_Value
specified for the component type itself.
2015-03-02 Thomas Quinot <quinot@adacore.com> 2015-03-02 Thomas Quinot <quinot@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference, case Input): When * exp_attr.adb (Expand_N_Attribute_Reference, case Input): When
......
...@@ -2576,7 +2576,7 @@ package body Checks is ...@@ -2576,7 +2576,7 @@ package body Checks is
or else Is_Formal_Subprogram (Subp) or else Is_Formal_Subprogram (Subp)
-- Do not process imported subprograms since pre and post conditions -- Do not process imported subprograms since pre- and postconditions
-- are never verified on routines coming from a different language. -- are never verified on routines coming from a different language.
or else Is_Imported (Subp) or else Is_Imported (Subp)
......
...@@ -6708,7 +6708,7 @@ package body Einfo is ...@@ -6708,7 +6708,7 @@ package body Einfo is
-- The first/next entity chain of a generic subprogram contains all -- The first/next entity chain of a generic subprogram contains all
-- generic formal parameters, followed by the formal parameters. Go -- generic formal parameters, followed by the formal parameters. Go
-- directly to the paramters by skipping the formal part. -- directly to the parameters by skipping the formal part.
if Is_Generic_Subprogram (Id) then if Is_Generic_Subprogram (Id) then
while Present (Formal) and then not Is_Formal (Formal) loop while Present (Formal) and then not Is_Formal (Formal) loop
...@@ -6747,7 +6747,7 @@ package body Einfo is ...@@ -6747,7 +6747,7 @@ package body Einfo is
-- The first/next entity chain of a generic subprogram contains all -- The first/next entity chain of a generic subprogram contains all
-- generic formal parameters, followed by the formal parameters. Go -- generic formal parameters, followed by the formal parameters. Go
-- directly to the paramters by skipping the formal part. -- directly to the parameters by skipping the formal part.
if Is_Generic_Subprogram (Id) then if Is_Generic_Subprogram (Id) then
while Present (Formal) and then not Is_Formal (Formal) loop while Present (Formal) and then not Is_Formal (Formal) loop
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -786,8 +786,10 @@ package body Exp_Aggr is ...@@ -786,8 +786,10 @@ package body Exp_Aggr is
-- Otherwise we call Build_Code recursively -- Otherwise we call Build_Code recursively
function Get_Assoc_Expr (Assoc : Node_Id) return Node_Id; function Get_Assoc_Expr (Assoc : Node_Id) return Node_Id;
-- For an association with a box, use default aspect of component type -- For an association with a box, use value given by aspect
-- if present, to initialize one or more components. -- Default_Component_Value of array type if specified, else use
-- value given by aspect Default_Value for component type itself
-- if specified, else return Empty.
function Local_Compile_Time_Known_Value (E : Node_Id) return Boolean; function Local_Compile_Time_Known_Value (E : Node_Id) return Boolean;
function Local_Expr_Value (E : Node_Id) return Uint; function Local_Expr_Value (E : Node_Id) return Uint;
...@@ -1533,12 +1535,19 @@ package body Exp_Aggr is ...@@ -1533,12 +1535,19 @@ package body Exp_Aggr is
-------------------- --------------------
function Get_Assoc_Expr (Assoc : Node_Id) return Node_Id is function Get_Assoc_Expr (Assoc : Node_Id) return Node_Id is
Typ : constant Entity_Id := Base_Type (Etype (N));
begin begin
if Box_Present (Assoc) then if Box_Present (Assoc) then
if Is_Scalar_Type (Ctype) if Is_Scalar_Type (Ctype) then
and then Present (Default_Aspect_Value (Ctype)) if Present (Default_Aspect_Component_Value (Typ)) then
then return Default_Aspect_Component_Value (Typ);
return Default_Aspect_Value (Ctype);
elsif Present (Default_Aspect_Value (Ctype)) then
return Default_Aspect_Value (Ctype);
else
return Empty;
end if;
else else
return Empty; return Empty;
end if; end if;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment