diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-05-22 14:42:05 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-05-22 14:42:05 +0200 |
commit | 167b47d9da9a82c0c8f426f1853a961f10322be0 (patch) | |
tree | 35d7ac1037a5211f5a217b67c5f16e70ebeb113c /gcc/ada/prj-nmsc.adb | |
parent | 7ac5a14092e76fe71a3d8660a30079e35d2618f5 (diff) | |
download | gcc-167b47d9da9a82c0c8f426f1853a961f10322be0.zip gcc-167b47d9da9a82c0c8f426f1853a961f10322be0.tar.gz gcc-167b47d9da9a82c0c8f426f1853a961f10322be0.tar.bz2 |
[multiple changes]
2015-05-22 Ed Schonberg <schonberg@adacore.com>
* einfo.ads, einfo.adb (Incomplete_Actuals): New attribute of
package instantiations. Holds the list of actuals in the instance
that are incomplete types, to determine where the corresponding
instance body must be placed.
* sem_ch6.adb (Conforming_Types): An incomplete type used as an
actual in an instance matches an incomplete formal.
* sem_disp.adb (Check_Dispatching_Call): Handle missing case of
explicit dereference.
(Inherited_Subprograms): In the presence of a limited view there
are no subprograms to inherit.
* sem_ch12.adb (Preanalyze_Actuals): Build list of incomplete
actuals of instance, for later placement of instance body and
freeze nodes for actuals.
(Install_Body): In the presence of actuals that incomplete types
from a limited view, the instance body cannot be placed after
the declaration because full views have not been seen yet. Any
use of the non-limited views in the instance body requires
the presence of a regular with_clause in the enclosing unit,
and will fail if this with_clause is missing. We place the
instance body at the beginning of the enclosing body, which is
the unit being compiled, and ensure that freeze nodes for the
full views of the incomplete types appear before the instance.
2015-05-22 Pascal Obry <obry@adacore.com>
* makeutl.ads, prj-conf.adb, prj-nmsc.adb, prj.ads
(In_Place_Option): Removed.
(Relocate_Build_Tree_Option): New constant.
(Root_Dir_Option): New constant.
(Obj_Root_Dir): Removed.
(Build_Tree_Dir): New variable.
(Root_Src_Tree): Removed.
(Root_Dir): New variable.
* prj-conf.adb (Get_Or_Create_Configuration_File): Add check
for improper relocation.
* prj-nmsc.adb (Locate_Directory): Add check for improper
relocation.
From-SVN: r223553
Diffstat (limited to 'gcc/ada/prj-nmsc.adb')
-rw-r--r-- | gcc/ada/prj-nmsc.adb | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index 5d209ec..a34b5a1 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -5589,8 +5589,8 @@ package body Prj.Nmsc is end if; end if; - elsif not No_Sources - and then (Subdirs /= null or else Obj_Root_Dir /= null) + elsif not No_Sources and then + (Subdirs /= null or else Build_Tree_Dir /= null) then Name_Len := 1; Name_Buffer (1) := '.'; @@ -6209,21 +6209,29 @@ package body Prj.Nmsc is -- Check if we have a root-object dir specified, if so relocate all -- artefact directories to it. - if Obj_Root_Dir /= null + if Build_Tree_Dir /= null and then Create /= "" and then not Is_Absolute_Path (Get_Name_String (Name)) then Name_Len := 0; - Add_Str_To_Name_Buffer (Obj_Root_Dir.all); + Add_Str_To_Name_Buffer (Build_Tree_Dir.all); + + if The_Parent_Last - The_Parent'First + 1 < Root_Dir'Length then + Err_Vars.Error_Msg_File_1 := Name; + Error_Or_Warning + (Data.Flags, Error, + "{ cannot relocate deeper than " & Create & " directory", + No_Location, Project); + end if; + Add_Str_To_Name_Buffer (Relative_Path (The_Parent (The_Parent'First .. The_Parent_Last), - Root_Src_Tree.all)); + Root_Dir.all)); Add_Str_To_Name_Buffer (Get_Name_String (Name)); else - if Obj_Root_Dir /= null and then Create /= "" then - + if Build_Tree_Dir /= null and then Create /= "" then -- Issue a warning that we cannot relocate absolute obj dir Err_Vars.Error_Msg_File_1 := Name; |