summaryrefslogtreecommitdiff
path: root/gcc/ada/lib-writ.adb
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2018-05-29 09:28:59 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-05-29 09:28:59 +0000
commit9f4b346b0b604183a7b2285df61961ebb4a4c582 (patch)
tree9b90ec6496d0506cb5101ef9cbff8c45513b3a5c /gcc/ada/lib-writ.adb
parent0c46b4263c49f008485b25eafffbe685c3c9031f (diff)
downloadgcc-9f4b346b0b604183a7b2285df61961ebb4a4c582.tar.gz
[Ada] Preliminary work to avoid full pathnames in ALI files
Normally, ALI files refer to source files using simple names. This allows files to be moved around without disturbing things (causing extra recompilations, etc). However, for configuration files, the full pathname is stored. This patch preparates the code base to store the simple name in this case. 2018-05-29 Bob Duff <duff@adacore.com> gcc/ada/ * lib-writ.adb (Write_ALI): Cleanup: avoid use of global var; call new To_Lower function. * libgnat/s-casuti.ads, libgnat/s-casuti.adb (To_Upper, To_Lower, To_Mixed): New functions. * osint.adb: Cleanup: use Is_Directory_Separator, which correctly allows both '\' and '/' on Windows. From-SVN: r260860
Diffstat (limited to 'gcc/ada/lib-writ.adb')
-rw-r--r--gcc/ada/lib-writ.adb18
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb
index b861bad6a99..9896a832554 100644
--- a/gcc/ada/lib-writ.adb
+++ b/gcc/ada/lib-writ.adb
@@ -1539,15 +1539,21 @@ package body Lib.Writ is
-- Normal case of a unit entry with a source index
if Sind > No_Source_File then
- Fname := File_Name (Sind);
+ -- We never want directory information in ALI files
+ -- ???But back out this change temporarily until
+ -- gprbuild is fixed.
- -- Ensure that on platforms where the file names are not case
- -- sensitive, the recorded file name is in lower case.
+ if False then
+ Fname := Strip_Directory (File_Name (Sind));
+ else
+ Fname := File_Name (Sind);
+ end if;
+
+ -- 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;
+ Fname := Name_Find (To_Lower (Get_Name_String (Fname)));
end if;
Write_Info_Name_May_Be_Quoted (Fname);