aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/osint.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2003-11-14 11:24:47 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2003-11-14 11:24:47 +0100
commit65356e64cf0fc85effb4b77d9e253c7d28bf407c (patch)
tree704f7caa7117a84574764938ed1020c5cdb1d890 /gcc/ada/osint.adb
parentf2b7f367d58c9da38eee0599a97ef3527d82e96b (diff)
downloadgcc-65356e64cf0fc85effb4b77d9e253c7d28bf407c.zip
gcc-65356e64cf0fc85effb4b77d9e253c7d28bf407c.tar.gz
gcc-65356e64cf0fc85effb4b77d9e253c7d28bf407c.tar.bz2
[multiple changes]
2003-11-13 Vincent Celier <celier@gnat.com> * 5bml-tgt.adb (Build_Dynamic_Library): Use Osint.Include_Dir_Default_Prefix instead of Sdefault.Include_Dir_Default_Name. * gnatlbr.adb: Update Copyright notice (Gnatlbr): : Use Osint.Include_Dir_Default_Prefix instead of Sdefault.Include_Dir_Default_Name and Osint.Object_Dir_Default_Prefix instead of Sdefault.Object_Dir_Default_Name * gnatlink.adb: (Process_Binder_File): Never suppress the option following -Xlinker * mdll-utl.adb: (Gcc): Use Osint.Object_Dir_Default_Prefix instead of Sdefault.Object_Dir_Default_Name. * osint.ads, osint.adb: (Include_Dir_Default_Prefix, Object_Dir_Default_Prefix): New functions Minor reformatting. * vms_conv.ads: Minor reformating Remove GNAT STANDARD and GNAT PSTA * vms_conv.adb: Allow GNAT MAKE to have several files on the command line. (Init_Object_Dirs): Use Osint.Object_Dir_Default_Prefix instead of Sdefault.Object_Dir_Default_Name. Minor Reformating Remove data for GNAT STANDARD * vms_data.ads: Add new compiler qualifier /PRINT_STANDARD (-gnatS) Remove data for GNAT STANDARD Remove options and documentation for -gnatwb/-gnatwB: these warning options no longer exist. 2003-11-13 Ed Falis <falis@gnat.com> * 5zthrini.adb: (Init_RTS): Made visible * 5zthrini.adb: (Register): Removed unnecessary call to taskVarGet that checked whether an ATSD was already set as a task var for the argument thread. * s-thread.adb: Updated comment to reflect that this is a VxWorks version Added context clause for System.Threads.Initialization Added call to System.Threads.Initialization.Init_RTS 2003-11-13 Jerome Guitton <guitton@act-europe.fr> * 5zthrini.adb: (Init_RTS): New procedure, for the initialization of the run-time lib. * s-thread.adb: Remove dependancy on System.Init, so that this file can be used in the AE653 sequential run-time lib. 2003-11-13 Robert Dewar <dewar@gnat.com> * bindgen.adb: Minor reformatting 2003-11-13 Ed Schonberg <schonberg@gnat.com> * checks.adb: (Apply_Discriminant_Check): Do no apply check if target type is derived from source type with no applicable constraint. * lib-writ.adb: (Ensure_System_Dependency): Do not apply the style checks that may have been specified for the main unit. * sem_ch8.adb: (Find_Selected_Component): Further improvement in error message, with RM reference. * sem_res.adb: (Resolve): Handle properly the case of an illegal overloaded protected procedure. 2003-11-13 Javier Miranda <miranda@gnat.com> * exp_aggr.adb: (Has_Default_Init_Comps): New function to check the presence of default initialization in an aggregate. (Build_Record_Aggr_Code): Recursively expand the ancestor in case of extension aggregate of a limited record. In addition, a new formal was added to do not initialize the record controller (if any) during this recursive expansion of ancestors. (Init_Controller): Add support for limited record components. (Expand_Record_Aggregate): In case of default initialized components convert the aggregate into a set of assignments. * par-ch4.adb (P_Aggregate_Or_Paren_Expr): Update the comment describing the new syntax. Nothing else needed to be done because this subprogram delegates part of its work to P_Precord_Or_Array_Component_Association. (P_Record_Or_Array_Component_Association): Give support to the new syntax for default initialization of components. * sem_aggr.adb: (Resolve_Aggregate): Relax the strictness of the frontend in case of limited aggregates. (Resolve_Record_Aggregate): Give support to default initialized components. (Get_Value): In case of default initialized components, duplicate the corresponding default expression (from the record type declaration). In case of default initialization in the *others* choice, do not check that all components have the same type. (Resolve_Extension_Aggregate): Give support to limited extension aggregates. * sem_ch3.adb: (Check_Initialization): Relax the strictness of the front-end in case of aggregate and extension aggregates. This test is now done in Get_Value in a per-component manner. * sem_ch4.adb (Analyze_Allocator): Don't post an error if the expression corresponds to a limited aggregate. This test is now done in Get_Value. * sinfo.ads, sinfo.adb (N_Component_Association): Addition of Box_Present flag. * sprint.adb (Sprint_Node_Actual): Modified to print an mbox if present in an N_Component_Association node 2003-11-13 Thomas Quinot <quinot@act-europe.fr> * sem_ch9.adb (Analyze_Accept_Statement): A procedure hides a type-conformant entry only if they are homographs. 2003-11-13 GNAT Script <nobody@gnat.com> * Make-lang.in: Makefile automatically updated From-SVN: r73596
Diffstat (limited to 'gcc/ada/osint.adb')
-rw-r--r--gcc/ada/osint.adb146
1 files changed, 84 insertions, 62 deletions
diff --git a/gcc/ada/osint.adb b/gcc/ada/osint.adb
index e560850..28f8ed8 100644
--- a/gcc/ada/osint.adb
+++ b/gcc/ada/osint.adb
@@ -41,9 +41,12 @@ with GNAT.HTable;
package body Osint is
Running_Program : Program_Type := Unspecified;
- Program_Set : Boolean := False;
+ -- comment required here ???
- Std_Prefix : String_Ptr;
+ Program_Set : Boolean := False;
+ -- comment required here ???
+
+ Std_Prefix : String_Ptr;
-- Standard prefix, computed dynamically the first time Relocate_Path
-- is called, and cached for subsequent calls.
@@ -66,8 +69,7 @@ package body Osint is
function Append_Suffix_To_File_Name
(Name : Name_Id;
- Suffix : String)
- return Name_Id;
+ Suffix : String) return Name_Id;
-- Appends Suffix to Name and returns the new name.
function OS_Time_To_GNAT_Time (T : OS_Time) return Time_Stamp_Type;
@@ -81,14 +83,14 @@ package body Osint is
-- The executable must be located in a directory called "bin", or
-- under root/lib/gcc-lib/..., or under root/libexec/gcc/... Thus, if
-- the executable is stored in directory "/foo/bar/bin", this routine
- -- returns "/foo/bar/".
- -- Return "" if the location is not recognized as described above.
+ -- returns "/foo/bar/". Return "" if the location is not recognized
+ -- as described above.
function Update_Path (Path : String_Ptr) return String_Ptr;
-- Update the specified path to replace the prefix with the location
-- where GNAT is installed. See the file prefix.c in GCC for details.
- procedure Write_With_Check (A : Address; N : Integer);
+ procedure Write_With_Check (A : Address; N : Integer);
-- Writes N bytes from buffer starting at address A to file whose FD is
-- stored in Output_FD, and whose file name is stored as a File_Name_Type
-- in Output_File_Name. A check is made for disk full, and if this is
@@ -99,8 +101,7 @@ package body Osint is
(N : File_Name_Type;
T : File_Type;
Dir : Natural;
- Name : String)
- return File_Name_Type;
+ Name : String) return File_Name_Type;
-- See if the file N whose name is Name exists in directory Dir. Dir is
-- an index into the Lib_Search_Directories table if T = Library.
-- Otherwise if T = Source, Dir is an index into the
@@ -112,8 +113,7 @@ package body Osint is
function To_Path_String_Access
(Path_Addr : Address;
- Path_Len : Integer)
- return String_Access;
+ Path_Len : Integer) return String_Access;
-- Converts a C String to an Ada String. Are we doing this to avoid
-- withing Interfaces.C.Strings ???
@@ -218,17 +218,15 @@ package body Osint is
Equal => "=");
function Smart_Find_File
- (N : File_Name_Type;
- T : File_Type)
- return File_Name_Type;
+ (N : File_Name_Type;
+ T : File_Type) return File_Name_Type;
-- Exactly like Find_File except that if File_Cache_Enabled is True this
-- routine looks first in the hash table to see if the full name of the
-- file is already available.
function Smart_File_Stamp
- (N : File_Name_Type;
- T : File_Type)
- return Time_Stamp_Type;
+ (N : File_Name_Type;
+ T : File_Type) return Time_Stamp_Type;
-- Takes the same parameter as the routine above (N is a file name
-- without any prefix directory information) and behaves like File_Stamp
-- except that if File_Cache_Enabled is True this routine looks first in
@@ -591,8 +589,7 @@ package body Osint is
function Append_Suffix_To_File_Name
(Name : Name_Id;
- Suffix : String)
- return Name_Id
+ Suffix : String) return Name_Id
is
begin
Get_Name_String (Name);
@@ -785,7 +782,7 @@ package body Osint is
return new String'("");
end Get_Install_Dir;
- -- Beginning of Executable_Prefix
+ -- Start of processing for Executable_Prefix
begin
Osint.Fill_Arg (Exec_Name'Address, 0);
@@ -799,7 +796,7 @@ package body Osint is
end if;
end loop;
- -- If you are here, the user has typed the executable name with no
+ -- If we come here, the user has typed the executable name with no
-- directory prefix.
return Get_Install_Dir (GNAT.OS_Lib.Locate_Exec_On_Path (Exec_Name).all);
@@ -890,9 +887,8 @@ package body Osint is
---------------
function Find_File
- (N : File_Name_Type;
- T : File_Type)
- return File_Name_Type
+ (N : File_Name_Type;
+ T : File_Type) return File_Name_Type
is
begin
Get_Name_String (N);
@@ -1089,8 +1085,7 @@ package body Osint is
-- call to Get_Next_Dir_In_Path_Init, updated by Get_Next_Dir_In_Path.
function Get_Next_Dir_In_Path
- (Search_Path : String_Access)
- return String_Access
+ (Search_Path : String_Access) return String_Access
is
Lower_Bound : Positive := Search_Path_Pos;
Upper_Bound : Positive;
@@ -1143,8 +1138,7 @@ package body Osint is
function Get_RTS_Search_Dir
(Search_Dir : String;
- File_Type : Search_File_Type)
- return String_Ptr
+ File_Type : Search_File_Type) return String_Ptr
is
procedure Get_Current_Dir
(Dir : System.Address;
@@ -1299,6 +1293,28 @@ package body Osint is
end if;
end Get_RTS_Search_Dir;
+ --------------------------------
+ -- Include_Dir_Default_Prefix --
+ --------------------------------
+
+ function Include_Dir_Default_Prefix return String is
+ Include_Dir : String_Access :=
+ String_Access (Update_Path (Include_Dir_Default_Name));
+
+ begin
+ if Include_Dir = null then
+ return "";
+
+ else
+ declare
+ Result : constant String := Include_Dir.all;
+ begin
+ Free (Include_Dir);
+ return Result;
+ end;
+ end if;
+ end Include_Dir_Default_Prefix;
+
----------------
-- Initialize --
----------------
@@ -1409,8 +1425,7 @@ package body Osint is
(N : File_Name_Type;
T : File_Type;
Dir : Natural;
- Name : String)
- return File_Name_Type
+ Name : String) return File_Name_Type
is
Dir_Name : String_Ptr;
@@ -1451,9 +1466,8 @@ package body Osint is
-------------------------------
function Matching_Full_Source_Name
- (N : File_Name_Type;
- T : Time_Stamp_Type)
- return File_Name_Type
+ (N : File_Name_Type;
+ T : Time_Stamp_Type) return File_Name_Type
is
begin
Get_Name_String (N);
@@ -1680,6 +1694,28 @@ package body Osint is
return Number_File_Names;
end Number_Of_Files;
+ -------------------------------
+ -- Object_Dir_Default_Prefix --
+ -------------------------------
+
+ function Object_Dir_Default_Prefix return String is
+ Object_Dir : String_Access :=
+ String_Access (Update_Path (Object_Dir_Default_Name));
+
+ begin
+ if Object_Dir = null then
+ return "";
+
+ else
+ declare
+ Result : constant String := Object_Dir.all;
+ begin
+ Free (Object_Dir);
+ return Result;
+ end;
+ end if;
+ end Object_Dir_Default_Prefix;
+
----------------------
-- Object_File_Name --
----------------------
@@ -1768,8 +1804,7 @@ package body Osint is
function Read_Default_Search_Dirs
(Search_Dir_Prefix : String_Access;
Search_File : String_Access;
- Search_Dir_Default_Name : String_Access)
- return String_Access
+ Search_Dir_Default_Name : String_Access) return String_Access
is
Prefix_Len : constant Integer := Search_Dir_Prefix.all'Length;
Buffer : String (1 .. Prefix_Len + Search_File.all'Length + 1);
@@ -1888,8 +1923,7 @@ package body Osint is
function Read_Library_Info
(Lib_File : File_Name_Type;
- Fatal_Err : Boolean := False)
- return Text_Buffer_Ptr
+ Fatal_Err : Boolean := False) return Text_Buffer_Ptr
is
Lib_FD : File_Descriptor;
-- The file descriptor for the current library file. A negative value
@@ -2201,9 +2235,8 @@ package body Osint is
----------------------
function Smart_File_Stamp
- (N : File_Name_Type;
- T : File_Type)
- return Time_Stamp_Type
+ (N : File_Name_Type;
+ T : File_Type) return Time_Stamp_Type
is
Time_Stamp : Time_Stamp_Type;
@@ -2228,8 +2261,7 @@ package body Osint is
function Smart_Find_File
(N : File_Name_Type;
- T : File_Type)
- return File_Name_Type
+ T : File_Type) return File_Name_Type
is
Full_File_Name : File_Name_Type;
@@ -2320,13 +2352,11 @@ package body Osint is
function To_Canonical_Dir_Spec
(Host_Dir : String;
- Prefix_Style : Boolean)
- return String_Access
+ Prefix_Style : Boolean) return String_Access
is
function To_Canonical_Dir_Spec
(Host_Dir : Address;
- Prefix_Flag : Integer)
- return Address;
+ Prefix_Flag : Integer) return Address;
pragma Import (C, To_Canonical_Dir_Spec, "__gnat_to_canonical_dir_spec");
C_Host_Dir : String (1 .. Host_Dir'Length + 1);
@@ -2362,13 +2392,11 @@ package body Osint is
function To_Canonical_File_List
(Wildcard_Host_File : String;
- Only_Dirs : Boolean)
- return String_Access_List_Access
+ Only_Dirs : Boolean) return String_Access_List_Access
is
function To_Canonical_File_List_Init
(Host_File : Address;
- Only_Dirs : Integer)
- return Integer;
+ Only_Dirs : Integer) return Integer;
pragma Import (C, To_Canonical_File_List_Init,
"__gnat_to_canonical_file_list_init");
@@ -2421,8 +2449,7 @@ package body Osint is
----------------------------
function To_Canonical_File_Spec
- (Host_File : String)
- return String_Access
+ (Host_File : String) return String_Access
is
function To_Canonical_File_Spec (Host_File : Address) return Address;
pragma Import
@@ -2457,8 +2484,7 @@ package body Osint is
----------------------------
function To_Canonical_Path_Spec
- (Host_Path : String)
- return String_Access
+ (Host_Path : String) return String_Access
is
function To_Canonical_Path_Spec (Host_Path : Address) return Address;
pragma Import
@@ -2492,13 +2518,11 @@ package body Osint is
function To_Host_Dir_Spec
(Canonical_Dir : String;
- Prefix_Style : Boolean)
- return String_Access
+ Prefix_Style : Boolean) return String_Access
is
function To_Host_Dir_Spec
(Canonical_Dir : Address;
- Prefix_Flag : Integer)
- return Address;
+ Prefix_Flag : Integer) return Address;
pragma Import (C, To_Host_Dir_Spec, "__gnat_to_host_dir_spec");
C_Canonical_Dir : String (1 .. Canonical_Dir'Length + 1);
@@ -2528,8 +2552,7 @@ package body Osint is
----------------------------
function To_Host_File_Spec
- (Canonical_File : String)
- return String_Access
+ (Canonical_File : String) return String_Access
is
function To_Host_File_Spec (Canonical_File : Address) return Address;
pragma Import (C, To_Host_File_Spec, "__gnat_to_host_file_spec");
@@ -2559,8 +2582,7 @@ package body Osint is
function To_Path_String_Access
(Path_Addr : Address;
- Path_Len : Integer)
- return String_Access
+ Path_Len : Integer) return String_Access
is
subtype Path_String is String (1 .. Path_Len);
type Path_String_Access is access Path_String;