[multiple changes]

2009-04-22  Robert Dewar  <dewar@adacore.com>

	* sem_aggr.adb: Minor reformatting.

	* sem_type.adb: Minor reformatting

2009-04-22  Vincent Celier  <celier@adacore.com>

	* prj-attr.adb: New single project level attribute
	Separate_Run_Path_Options.

	* prj-nmsc.adb (Process_Project_Level_Simple_Attributes): Process
	attribute Seperate_Run_Path_Options.

	* prj.ads: (Project_Configuration): New Boolean component
	Separate_Run_Path_Options, defaulted to False.

	* snames.ads-tmpl: New standard name Seperate_Run_Path_Options

From-SVN: r146563
This commit is contained in:
Arnaud Charlet 2009-04-22 12:42:35 +02:00
parent 6d2a112099
commit c9a1acdcc6
7 changed files with 102 additions and 66 deletions

View File

@ -1,5 +1,20 @@
2009-04-22 Vincent Celier <celier@adacore.com>
* prj-attr.adb: New single project level attribute
Separate_Run_Path_Options.
* prj-nmsc.adb (Process_Project_Level_Simple_Attributes): Process
attribute Seperate_Run_Path_Options.
* prj.ads: (Project_Configuration): New Boolean component
Separate_Run_Path_Options, defaulted to False.
* snames.ads-tmpl: New standard name Seperate_Run_Path_Options
2009-04-22 Robert Dewar <dewar@adacore.com>
* sem_type.adb: Minor reformatting
* mlib.adb: Minor reformatting
* sem_aggr.adb: Minor reformatting. Defend against junk aggregate from

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
-- Copyright (C) 2001-2009, Free Software Foundation, Inc. --
-- --
-- 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- --
@ -112,6 +112,7 @@ package body Prj.Attr is
"SVdefault_language#" &
"LVrun_path_option#" &
"SVseparate_run_path_options#" &
"Satoolchain_version#" &
"Satoolchain_description#" &
"Saobject_generated#" &

View File

@ -2155,6 +2155,24 @@ package body Prj.Nmsc is
In_Tree => In_Tree);
end if;
elsif Attribute.Name = Name_Separate_Run_Path_Options then
declare
pragma Unsuppress (All_Checks);
begin
Data.Config.Separate_Run_Path_Options :=
Boolean'Value (Get_Name_String
(Attribute.Value.Value));
exception
when Constraint_Error =>
Error_Msg
(Project,
In_Tree,
"invalid value """ &
Get_Name_String (Attribute.Value.Value) &
""" for Separate_Run_Path_Options",
Attribute.Value.Location);
end;
elsif Attribute.Name = Name_Library_Support then
declare
pragma Unsuppress (All_Checks);

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
-- Copyright (C) 2001-2009, Free Software Foundation, Inc. --
-- --
-- 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- --
@ -1004,6 +1004,10 @@ package Prj is
-- The option to use when linking to specify the path where to look for
-- libraries.
Separate_Run_Path_Options : Boolean := False;
-- True if each directory needs to be specified in a separate run path
-- option.
Executable_Suffix : Name_Id := No_Name;
-- The suffix of executables, when specified in the configuration or in
-- package Builder of the main project. When this is not specified, the
@ -1111,6 +1115,7 @@ package Prj is
Default_Project_Config : constant Project_Configuration :=
(Target => No_Name,
Run_Path_Option => No_Name_List,
Separate_Run_Path_Options => False,
Executable_Suffix => No_Name,
Linker => No_Path,
Map_File_Option => No_Name,

View File

@ -134,8 +134,8 @@ package body Sem_Aggr is
-- The algorithm of Resolve_Record_Aggregate proceeds as follows:
--
-- 1. Make sure that the record type against which the record aggregate
-- has to be resolved is not abstract. Furthermore if the type is
-- a null aggregate make sure the input aggregate N is also null.
-- has to be resolved is not abstract. Furthermore if the type is a
-- null aggregate make sure the input aggregate N is also null.
--
-- 2. Verify that the structure of the aggregate is that of a record
-- aggregate. Specifically, look for component associations and ensure
@ -143,31 +143,29 @@ package body Sem_Aggr is
-- node. Also make sure that if present, the N_Others_Choice occurs
-- last and by itself.
--
-- 3. If Typ contains discriminants, the values for each discriminant
-- is looked for. If the record type Typ has variants, we check
-- that the expressions corresponding to each discriminant ruling
-- the (possibly nested) variant parts of Typ, are static. This
-- allows us to determine the variant parts to which the rest of
-- the aggregate must conform. The names of discriminants with their
-- values are saved in a new association list, New_Assoc_List which
-- is later augmented with the names and values of the remaining
-- components in the record type.
-- 3. If Typ contains discriminants, the values for each discriminant is
-- looked for. If the record type Typ has variants, we check that the
-- expressions corresponding to each discriminant ruling the (possibly
-- nested) variant parts of Typ, are static. This allows us to determine
-- the variant parts to which the rest of the aggregate must conform.
-- The names of discriminants with their values are saved in a new
-- association list, New_Assoc_List which is later augmented with the
-- names and values of the remaining components in the record type.
--
-- During this phase we also make sure that every discriminant is
-- assigned exactly one value. Note that when several values
-- for a given discriminant are found, semantic processing continues
-- looking for further errors. In this case it's the first
-- discriminant value found which we will be recorded.
-- assigned exactly one value. Note that when several values for a given
-- discriminant are found, semantic processing continues looking for
-- further errors. In this case it's the first discriminant value found
-- which we will be recorded.
--
-- IMPORTANT NOTE: For derived tagged types this procedure expects
-- First_Discriminant and Next_Discriminant to give the correct list
-- of discriminants, in the correct order.
--
-- 4. After all the discriminant values have been gathered, we can
-- set the Etype of the record aggregate. If Typ contains no
-- discriminants this is straightforward: the Etype of N is just
-- Typ, otherwise a new implicit constrained subtype of Typ is
-- built to be the Etype of N.
-- 4. After all the discriminant values have been gathered, we can set the
-- Etype of the record aggregate. If Typ contains no discriminants this
-- is straightforward: the Etype of N is just Typ, otherwise a new
-- implicit constrained subtype of Typ is built to be the Etype of N.
--
-- 5. Gather the remaining record components according to the discriminant
-- values. This involves recursively traversing the record type
@ -176,41 +174,40 @@ package body Sem_Aggr is
-- derived tagged types since we need to retrieve the record structure
-- of all the ancestors of Typ.
--
-- 6. After gathering the record components we look for their values
-- in the record aggregate and emit appropriate error messages
-- should we not find such values or should they be duplicated.
-- 6. After gathering the record components we look for their values in the
-- record aggregate and emit appropriate error messages should we not
-- find such values or should they be duplicated.
--
-- 7. We then make sure no illegal component names appear in the
-- record aggregate and make sure that the type of the record
-- components appearing in a same choice list is the same.
-- Finally we ensure that the others choice, if present, is
-- used to provide the value of at least a record component.
-- 7. We then make sure no illegal component names appear in the record
-- aggregate and make sure that the type of the record components
-- appearing in a same choice list is the same. Finally we ensure that
-- the others choice, if present, is used to provide the value of at
-- least a record component.
--
-- 8. The original aggregate node is replaced with the new named
-- aggregate built in steps 3 through 6, as explained earlier.
-- 8. The original aggregate node is replaced with the new named aggregate
-- built in steps 3 through 6, as explained earlier.
--
-- Given the complexity of record aggregate resolution, the primary
-- goal of this routine is clarity and simplicity rather than execution
-- and storage efficiency. If there are only positional components in the
-- aggregate the running time is linear. If there are associations
-- the running time is still linear as long as the order of the
-- associations is not too far off the order of the components in the
-- record type. If this is not the case the running time is at worst
-- quadratic in the size of the association list.
-- Given the complexity of record aggregate resolution, the primary goal of
-- this routine is clarity and simplicity rather than execution and storage
-- efficiency. If there are only positional components in the aggregate the
-- running time is linear. If there are associations the running time is
-- still linear as long as the order of the associations is not too far off
-- the order of the components in the record type. If this is not the case
-- the running time is at worst quadratic in the size of the association
-- list.
procedure Check_Misspelled_Component
(Elements : Elist_Id;
Component : Node_Id);
-- Give possible misspelling diagnostic if Component is likely to be
-- a misspelling of one of the components of the Assoc_List.
-- This is called by Resolve_Aggr_Expr after producing
-- an invalid component error message.
-- Give possible misspelling diagnostic if Component is likely to be a
-- misspelling of one of the components of the Assoc_List. This is called
-- by Resolve_Aggr_Expr after producing an invalid component error message.
procedure Check_Static_Discriminated_Subtype (T : Entity_Id; V : Node_Id);
-- An optimization: determine whether a discriminated subtype has a
-- static constraint, and contains array components whose length is also
-- static, either because they are constrained by the discriminant, or
-- because the original component bounds are static.
-- An optimization: determine whether a discriminated subtype has a static
-- constraint, and contains array components whose length is also static,
-- either because they are constrained by the discriminant, or because the
-- original component bounds are static.
-----------------------------------------------------
-- Subprograms used for ARRAY AGGREGATE Processing --

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- --
-- 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- --
@ -57,12 +57,12 @@ package body Sem_Type is
-- The following data structures establish a mapping between nodes and
-- their interpretations. An overloaded node has an entry in Interp_Map,
-- which in turn contains a pointer into the All_Interp array. The
-- interpretations of a given node are contiguous in All_Interp. Each
-- set of interpretations is terminated with the marker No_Interp.
-- In order to speed up the retrieval of the interpretations of an
-- overloaded node, the Interp_Map table is accessed by means of a simple
-- hashing scheme, and the entries in Interp_Map are chained. The heads
-- of clash lists are stored in array Headers.
-- interpretations of a given node are contiguous in All_Interp. Each set
-- of interpretations is terminated with the marker No_Interp. In order to
-- speed up the retrieval of the interpretations of an overloaded node, the
-- Interp_Map table is accessed by means of a simple hashing scheme, and
-- the entries in Interp_Map are chained. The heads of clash lists are
-- stored in array Headers.
-- Headers Interp_Map All_Interp
@ -132,16 +132,15 @@ package body Sem_Type is
-- Operator Overloading --
--------------------------
-- The visibility of operators is handled differently from that of
-- other entities. We do not introduce explicit versions of primitive
-- operators for each type definition. As a result, there is only one
-- entity corresponding to predefined addition on all numeric types, etc.
-- The back-end resolves predefined operators according to their type.
-- The visibility of primitive operations then reduces to the visibility
-- of the resulting type: (a + b) is a legal interpretation of some
-- primitive operator + if the type of the result (which must also be
-- the type of a and b) is directly visible (i.e. either immediately
-- visible or use-visible.)
-- The visibility of operators is handled differently from that of other
-- entities. We do not introduce explicit versions of primitive operators
-- for each type definition. As a result, there is only one entity
-- corresponding to predefined addition on all numeric types, etc. The
-- back-end resolves predefined operators according to their type. The
-- visibility of primitive operations then reduces to the visibility of the
-- resulting type: (a + b) is a legal interpretation of some primitive
-- operator + if the type of the result (which must also be the type of a
-- and b) is directly visible (either immediately visible or use-visible).
-- User-defined operators are treated like other functions, but the
-- visibility of these user-defined operations must be special-cased

View File

@ -6,7 +6,7 @@
-- --
-- T e m p l a t e --
-- --
-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- --
-- 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- --
@ -1116,6 +1116,7 @@ package Snames is
Name_Roots : constant Name_Id := N + $; -- GPR
Name_Required_Switches : constant Name_Id := N + $;
Name_Run_Path_Option : constant Name_Id := N + $;
Name_Separate_Run_Path_Options : constant Name_Id := N + $;
Name_Shared_Library_Minimum_Switches : constant Name_Id := N + $;
Name_Shared_Library_Prefix : constant Name_Id := N + $;
Name_Shared_Library_Suffix : constant Name_Id := N + $;