diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-02-17 14:59:28 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-02-17 14:59:28 +0100 |
commit | 0df7e2d0ec74c326a74a62a352528b6fa1e73449 (patch) | |
tree | 893b14bf61354dd5157543d3b881c13dcb3103b2 | |
parent | 260359e35de7fcc0d7746cdc3983857fba1b9f7a (diff) | |
download | gcc-0df7e2d0ec74c326a74a62a352528b6fa1e73449.zip gcc-0df7e2d0ec74c326a74a62a352528b6fa1e73449.tar.gz gcc-0df7e2d0ec74c326a74a62a352528b6fa1e73449.tar.bz2 |
[multiple changes]
2012-02-17 Yannick Moy <moy@adacore.com>
* gnat_ugn.texi: Fix typos.
2012-02-17 Pascal Obry <obry@adacore.com>
* prj-nmsc.adb: prj-nmsc.adb (Check_Aggregated): Check that an
aggregate is not Externally_Built.
2012-02-17 Ed Schonberg <schonberg@adacore.com>
* sem_aggr.adb (Resolve_Record_Aggregate): If a composite
component has a box association, copy the default value using
the current scope as the scope of internal types, to prevent
scoping anomalies in gigi.
From-SVN: r184337
-rw-r--r-- | gcc/ada/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/ada/gnat_ugn.texi | 16 | ||||
-rw-r--r-- | gcc/ada/prj-nmsc.adb | 63 | ||||
-rw-r--r-- | gcc/ada/sem_aggr.adb | 8 |
4 files changed, 89 insertions, 14 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f500453..5f1aae8 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,19 @@ +2012-02-17 Yannick Moy <moy@adacore.com> + + * gnat_ugn.texi: Fix typos. + +2012-02-17 Pascal Obry <obry@adacore.com> + + * prj-nmsc.adb: prj-nmsc.adb (Check_Aggregated): Check that an + aggregate is not Externally_Built. + +2012-02-17 Ed Schonberg <schonberg@adacore.com> + + * sem_aggr.adb (Resolve_Record_Aggregate): If a composite + component has a box association, copy the default value using + the current scope as the scope of internal types, to prevent + scoping anomalies in gigi. + 2012-02-17 Robert Dewar <dewar@adacore.com> * sem_dim.adb, sem_dim.ads, s-tasren.adb, prj.adb, prj.ads, freeze.adb, diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 6a28dbf..c9951b7 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -18009,9 +18009,11 @@ switch or by the corresponding attribute in the project file. @item filename is the name of the source file containing the library unit package declaration -for which a test package will be created. The file name may given with a path. +for which a test package will be created. The file name may be given with a +path. -@item @samp{@var{gcc_switches}} is a list of switches for +@item @samp{@var{gcc_switches}} +is a list of switches for @command{gcc}. These switches will be passed on to all compiler invocations made by @command{gnatstub} to generate a set of ASIS trees. Here you can provide @option{^-I^/INCLUDE_DIRS=^} switches to form the source search path, @@ -18027,7 +18029,7 @@ is an optional sequence of switches as described in the next section. @command{gnattest} results can be found in two different places. @itemize @bullet -@item automatic harness +@item automatic harness: the harness code, which is located either in the harness-dir as specified on the command line or in the project file. All of this code is generated completely automatically and can be destroyed and regenerated at will. It is not @@ -18044,7 +18046,7 @@ test_runner Note that you might need to specify the necessary values of scenario variables when you are not using the AUnit defaults. -@item actual unit test stubs +@item actual unit test stubs: a test stub for each visible subprogram is created in a separate file, if it doesn't exist already. By default, those separate test files are located in a "tests" directory that is created in the directory containing the source file @@ -18053,10 +18055,10 @@ source, option @option{--separate-root} can be used. For example, if a source file my_unit.ads in directory src contains a visible subprogram Proc, then the corresponding unit test will be found in file src/tests/my_unit-tests-proc_<code>.adb. <code> is a signature encoding used to -differentiate test names in cases of overloading. +differentiate test names in case of overloading. -Note that if the project already has both my_unit.ads and my_unit-tests.ads this -will cause name a conflict with generated test package. +Note that if the project already has both my_unit.ads and my_unit-tests.ads, +this will cause a name conflict with the generated test package. @end itemize @node Switches for gnattest diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index 5d2499d..2b65c15 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -8172,6 +8172,14 @@ package body Prj.Nmsc is -- Check the aggregate project attributes, reject any not supported -- attributes. + procedure Check_Aggregated + (Project : Project_Id; + Data : in out Tree_Processing_Data); + -- Check aggregated projets which should not be externally built. + -- What is Data??? if same as outer Data, why passed??? + -- What exact check is performed here??? Seems a bad idea to have + -- two procedures with such close names ??? + --------------------- -- Check_Aggregate -- --------------------- @@ -8180,7 +8188,6 @@ package body Prj.Nmsc is (Project : Project_Id; Data : in out Tree_Processing_Data) is - procedure Check_Not_Defined (Name : Name_Id); -- Report an error if Var is defined @@ -8203,6 +8210,8 @@ package body Prj.Nmsc is end if; end Check_Not_Defined; + -- Start of processing for Check_Aggregate + begin Check_Not_Defined (Snames.Name_Library_Dir); Check_Not_Defined (Snames.Name_Library_Interface); @@ -8216,6 +8225,43 @@ package body Prj.Nmsc is Check_Not_Defined (Snames.Name_Library_Version); end Check_Aggregate; + ---------------------- + -- Check_Aggregated -- + ---------------------- + + procedure Check_Aggregated + (Project : Project_Id; + Data : in out Tree_Processing_Data) + is + L : Aggregated_Project_List; + + begin + -- Check that aggregated projects are not externally built + + L := Project.Aggregated_Projects; + while L /= null loop + declare + Var : constant Prj.Variable_Value := + Prj.Util.Value_Of + (Snames.Name_Externally_Built, + L.Project.Decl.Attributes, + Data.Tree.Shared); + begin + if not Var.Default then + Error_Msg_Name_1 := L.Project.Display_Name; + Error_Msg + (Data.Flags, + "cannot aggregate externally build library %%", + Var.Location, Project); + end if; + end; + + L := L.Next; + end loop; + end Check_Aggregated; + + -- Local Variables + Shared : constant Shared_Project_Tree_Data_Access := Data.Tree.Shared; Prj_Data : Project_Processing_Data; @@ -8231,9 +8277,11 @@ package body Prj.Nmsc is case Project.Qualifier is when Aggregate => - null; + Check_Aggregated (Project, Data); when Aggregate_Library => + Check_Aggregated (Project, Data); + if Project.Object_Directory = No_Path_Information then Project.Object_Directory := Project.Directory; end if; @@ -8251,10 +8299,9 @@ package body Prj.Nmsc is end if; end case; - -- Check configuration. This must be done even for gnatmake (even - -- though no user configuration file was provided) since the default - -- config we generate indicates whether libraries are supported for - -- instance. + -- Check configuration. Must be done for gnatmake (even though no + -- user configuration file was provided) since the default config we + -- generate indicates whether libraries are supported for instance. Check_Configuration (Project, Data); @@ -8318,6 +8365,9 @@ package body Prj.Nmsc is procedure Check_All_Projects is new For_Every_Project_Imported_Context (Tree_Processing_Data, Recursive_Check); + -- Comment required??? + + -- Local Variables Data : Tree_Processing_Data; @@ -8342,6 +8392,7 @@ package body Prj.Nmsc is List := Tree.Projects; while List /= null loop Proj := List.Project; + Exte := Proj; while Exte.Extended_By /= No_Project loop Exte := Exte.Extended_By; diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 77a831e..1b7822c 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -3896,7 +3896,12 @@ package body Sem_Aggr is begin -- If there is a default expression for the aggregate, copy - -- it into a new association. + -- it into a new association. This copy must modify the scopes + -- of internal types that may be attached to the expression + -- (e.g. index subtypes of arrays) because in general the type + -- declaration and the aggregate appear in different scopes, + -- and the backend requires the scope of the type to match the + -- point at which it is elaborated. -- If the component has an initialization procedure (IP) we -- pass the component to the expander, which will generate @@ -3916,6 +3921,7 @@ package body Sem_Aggr is then Expr := New_Copy_Tree (Expression (Parent (Component)), + New_Scope => Current_Scope, New_Sloc => Sloc (N)); Add_Association |