summaryrefslogtreecommitdiff
path: root/gcc/ada/lib-writ.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-06 09:23:52 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-06 09:23:52 +0000
commit84f19dccf5e742d9843e23cbdd9e972b81dd4a9e (patch)
tree4c921244cce9321f7d6378b3cb0d49cdcadc99e8 /gcc/ada/lib-writ.adb
parent945236bd7f7e7043061aa030fe8ae270f5d384f2 (diff)
downloadgcc-84f19dccf5e742d9843e23cbdd9e972b81dd4a9e.tar.gz
2007-04-06 Thomas Quinot <quinot@adacore.com>
* lib-writ.adb (Write_With_Lines): Factor duplicated code between the cases where a given dependency has a body or not. (Write_With_File_Names): New subprogram, common code for the two cases above. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123582 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/lib-writ.adb')
-rw-r--r--gcc/ada/lib-writ.adb56
1 files changed, 30 insertions, 26 deletions
diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb
index 521e0625734..14c62f0f49f 100644
--- a/gcc/ada/lib-writ.adb
+++ b/gcc/ada/lib-writ.adb
@@ -629,6 +629,34 @@ package body Lib.Writ is
Body_Fname : File_Name_Type;
Body_Index : Nat;
+ procedure Write_With_File_Names
+ (Nam : in out File_Name_Type;
+ Idx : Nat);
+ -- Write source file name Nam and ALI file name for unit index Idx.
+ -- Possibly change Nam to lowercase (generating a new file name).
+
+ --------------------------
+ -- Write_With_File_Name --
+ --------------------------
+
+ procedure Write_With_File_Names
+ (Nam : in out File_Name_Type;
+ Idx : Nat)
+ is
+ begin
+ if not File_Names_Case_Sensitive then
+ Get_Name_String (Nam);
+ To_Lower (Name_Buffer (1 .. Name_Len));
+ Nam := Name_Find;
+ end if;
+
+ Write_Info_Name (Nam);
+ Write_Info_Tab (49);
+ Write_Info_Name (Lib_File_Name (Nam, Idx));
+ end Write_With_File_Names;
+
+ -- Start of processing for Write_With_Lines
+
begin
-- Loop to build the with table. A with on the main unit itself
-- is ignored (AARM 10.2(14a)). Such a with-clause can occur if
@@ -705,33 +733,9 @@ package body Lib.Writ is
or else (Ada_Version = Ada_83
and then Full_Source_Name (Body_Fname) /= No_File)
then
- -- Ensure that on platforms where the file names are not
- -- case sensitive, the recorded file name is in lower case.
-
- if not File_Names_Case_Sensitive then
- Get_Name_String (Body_Fname);
- To_Lower (Name_Buffer (1 .. Name_Len));
- Body_Fname := Name_Find;
- end if;
-
- Write_Info_Name (Body_Fname);
- Write_Info_Tab (49);
- Write_Info_Name
- (Lib_File_Name (Body_Fname, Body_Index));
+ Write_With_File_Names (Body_Fname, Body_Index);
else
- -- Ensure that on platforms where the file names are not
- -- case sensitive, the recorded file name is in lower case.
-
- if not File_Names_Case_Sensitive then
- Get_Name_String (Fname);
- To_Lower (Name_Buffer (1 .. Name_Len));
- Fname := Name_Find;
- end if;
-
- Write_Info_Name (Fname);
- Write_Info_Tab (49);
- Write_Info_Name
- (Lib_File_Name (Fname, Munit_Index (Unum)));
+ Write_With_File_Names (Fname, Munit_Index (Unum));
end if;
if Elab_Flags (Unum) then