From 10aea826dae5e3bc306dc74b4aea9df830a3c96c Mon Sep 17 00:00:00 2001 From: Johannes Kanig Date: Wed, 3 Jul 2019 08:16:15 +0000 Subject: [PATCH] [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 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 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/osint.adb | 9 +++++++++ gcc/ada/osint.ads | 3 +++ 3 files changed, 17 insertions(+) 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 + + * 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 * 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 -- ------------------------------------------- -- 2.30.2