diff options
author | Johannes Kanig <kanig@adacore.com> | 2019-07-03 08:16:15 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-07-03 08:16:15 +0000 |
commit | 10aea826dae5e3bc306dc74b4aea9df830a3c96c (patch) | |
tree | a0561d5b7b16fc1bba8a5edd751da968042983f8 | |
parent | 5460389b1fde0393afeaab5ce338ebe72a517cae (diff) | |
download | gcc-10aea826dae5e3bc306dc74b4aea9df830a3c96c.tar.gz |
[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/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/osint.adb | 9 | ||||
-rw-r--r-- | gcc/ada/osint.ads | 3 |
3 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f06663d9c12..2824f44c2f3 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 40772c3d4b9..d9d72d08bb0 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 048225ec689..dda44e715aa 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 -- ------------------------------------------- |