diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-11-30 11:59:41 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-11-30 11:59:41 +0100 |
commit | c9df623a129fb2423546ec5ab3208b846be83d93 (patch) | |
tree | ae963440f1ba67f2811fa3dcc4a41d01b5bdf34e /gcc/ada/prj.adb | |
parent | a8fc928da333e8deb08fe0b2f8396acc63040694 (diff) | |
download | gcc-c9df623a129fb2423546ec5ab3208b846be83d93.zip gcc-c9df623a129fb2423546ec5ab3208b846be83d93.tar.gz gcc-c9df623a129fb2423546ec5ab3208b846be83d93.tar.bz2 |
[multiple changes]
2009-11-30 Thomas Quinot <quinot@adacore.com>
* osint.adb: Minor reformatting
2009-11-30 Vincent Celier <celier@adacore.com>
* makeutl.ads, makeutl.adb (Base_Name_Index_For): New function to get
the base name of a main without the extension, with an eventual source
index.
(Mains.Get_Index): New procedure to set the source index of a main
(Mains.Get_Index): New function to get the source index of a main
* prj-attr.adb: New attributes Config_Body_File_Name_Index,
Config_Spec_File_Name_Index, Multi_Unit_Object_Separator and
Multi_Unit_Switches.
* prj-nmsc.adb (Process_Compiler): Takle into account new attributes
Config_Body_File_Name_Index, Config_Spec_File_Name_Index,
Multi_Unit_Object_Separator and Multi_Unit_Switches.
Allow only one character for Multi_Unit_Object_Separator.
* prj-proc.adb (Process_Declarative_Items): Take into account the
source indexes in indexes of associative array attribute declarations.
* prj.adb (Object_Name): New function to get the object file name for
units in multi-unit sources.
* prj.ads (Language_Config): New components Multi_Unit_Switches,
Multi_Unit_Object_Separator Config_Body_Index and Config_Spec_Index.
(Object_Name): New function to get the object file name for units in
multi-unit sources.
* snames.ads-tmpl: New standard names Config_Body_File_Name_Index,
Config_Spec_File_Name_Index, Multi_Unit_Object_Separator and
Multi_Unit_Switches.
From-SVN: r154782
Diffstat (limited to 'gcc/ada/prj.adb')
-rw-r--r-- | gcc/ada/prj.adb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/ada/prj.adb b/gcc/ada/prj.adb index 70a5737..ff484f5 100644 --- a/gcc/ada/prj.adb +++ b/gcc/ada/prj.adb @@ -679,6 +679,39 @@ package body Prj is end if; end Object_Name; + function Object_Name + (Source_File_Name : File_Name_Type; + Source_Index : Int; + Index_Separator : Character; + Object_File_Suffix : Name_Id := No_Name) return File_Name_Type + is + Index_Img : constant String := Source_Index'Img; + Last : Natural; + begin + Get_Name_String (Source_File_Name); + Last := Name_Len; + + while Last > 1 and then Name_Buffer (Last) /= '.' loop + Last := Last - 1; + end loop; + + if Last > 1 then + Name_Len := Last - 1; + end if; + + Add_Char_To_Name_Buffer (Index_Separator); + Add_Str_To_Name_Buffer (Index_Img (2 .. Index_Img'Last)); + + if Object_File_Suffix = No_Name then + Add_Str_To_Name_Buffer (Object_Suffix); + + else + Add_Str_To_Name_Buffer (Get_Name_String (Object_File_Suffix)); + end if; + + return Name_Find; + end Object_Name; + ---------------------- -- Record_Temp_File -- ---------------------- |