aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Kanig <kanig@adacore.com>2019-07-03 08:16:15 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-07-03 08:16:15 +0000
commit10aea826dae5e3bc306dc74b4aea9df830a3c96c (patch)
treea0561d5b7b16fc1bba8a5edd751da968042983f8
parent5460389b1fde0393afeaab5ce338ebe72a517cae (diff)
downloadgcc-10aea826dae5e3bc306dc74b4aea9df830a3c96c.zip
gcc-10aea826dae5e3bc306dc74b4aea9df830a3c96c.tar.gz
gcc-10aea826dae5e3bc306dc74b4aea9df830a3c96c.tar.bz2
[Ada] New routine to access file on command line
This patch adds a new routine to query the first file argument of the commandline without moving to the next file. This is needed in SPARK. There is no impact on compilation. 2019-07-03 Johannes Kanig <kanig@adacore.com> gcc/ada/ * osint.ads, osint.adb (Get_First_Main_File_Name): New routine to access the first file provided on the command line. From-SVN: r272984
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/osint.adb9
-rw-r--r--gcc/ada/osint.ads3
3 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index f06663d..2824f44 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2019-07-03 Johannes Kanig <kanig@adacore.com>
+
+ * osint.ads, osint.adb (Get_First_Main_File_Name): New routine
+ to access the first file provided on the command line.
+
2019-07-03 Ed Schonberg <schonberg@adacore.com>
* inline.adb (Process_Formals_In_Aspects): New procedure within
diff --git a/gcc/ada/osint.adb b/gcc/ada/osint.adb
index 40772c3..d9d72d0 100644
--- a/gcc/ada/osint.adb
+++ b/gcc/ada/osint.adb
@@ -1422,6 +1422,15 @@ package body Osint is
return Name_Find;
end Get_Directory;
+ ------------------------------
+ -- Get_First_Main_File_Name --
+ ------------------------------
+
+ function Get_First_Main_File_Name return String is
+ begin
+ return File_Names (1).all;
+ end Get_First_Main_File_Name;
+
--------------------------
-- Get_Next_Dir_In_Path --
--------------------------
diff --git a/gcc/ada/osint.ads b/gcc/ada/osint.ads
index 048225e..dda44e7 100644
--- a/gcc/ada/osint.ads
+++ b/gcc/ada/osint.ads
@@ -511,6 +511,9 @@ package Osint is
procedure Dump_Command_Line_Source_File_Names;
-- Prints out the names of all source files on the command-line
+ function Get_First_Main_File_Name return String;
+ -- Return the file name of the first main file
+
-------------------------------------------
-- Representation of Library Information --
-------------------------------------------