Commit 10aea826 by Johannes Kanig Committed by Pierre-Marie de Rodat

[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
parent 5460389b
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> 2019-07-03 Ed Schonberg <schonberg@adacore.com>
* inline.adb (Process_Formals_In_Aspects): New procedure within * inline.adb (Process_Formals_In_Aspects): New procedure within
......
...@@ -1422,6 +1422,15 @@ package body Osint is ...@@ -1422,6 +1422,15 @@ package body Osint is
return Name_Find; return Name_Find;
end Get_Directory; 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 -- -- Get_Next_Dir_In_Path --
-------------------------- --------------------------
......
...@@ -511,6 +511,9 @@ package Osint is ...@@ -511,6 +511,9 @@ package Osint is
procedure Dump_Command_Line_Source_File_Names; procedure Dump_Command_Line_Source_File_Names;
-- Prints out the names of all source files on the command-line -- 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 -- -- Representation of Library Information --
------------------------------------------- -------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment