Commit 98f57e4c by Arnaud Charlet Committed by Pierre-Marie de Rodat

[Ada] Vxlink: minor reformatting

2018-09-26  Arnaud Charlet  <charlet@adacore.com>

gcc/ada

	* vxlink.adb: Minor reformatting.

From-SVN: r264600
parent e5d16323
2018-09-26 Arnaud Charlet <charlet@adacore.com>
* vxlink.adb: Minor reformatting.
2018-09-26 Gary Dismukes <dismukes@adacore.com> 2018-09-26 Gary Dismukes <dismukes@adacore.com>
* exp_ch9.adb, layout.adb, sem_attr.adb, sem_res.adb: Fix * exp_ch9.adb, layout.adb, sem_attr.adb, sem_res.adb: Fix
......
...@@ -40,8 +40,10 @@ package body VxLink is ...@@ -40,8 +40,10 @@ package body VxLink is
Error_State : Boolean := False; Error_State : Boolean := False;
function Triplet return String; function Triplet return String;
-- ??? missing spec
function Which (Exe : String) return String; function Which (Exe : String) return String;
-- ??? missing spec
------------- -------------
-- Triplet -- -- Triplet --
...@@ -69,8 +71,7 @@ package body VxLink is ...@@ -69,8 +71,7 @@ package body VxLink is
-- Which -- -- Which --
----------- -----------
function Which (Exe : String) return String function Which (Exe : String) return String is
is
Suffix : GNAT.OS_Lib.String_Access := Get_Executable_Suffix; Suffix : GNAT.OS_Lib.String_Access := Get_Executable_Suffix;
Basename : constant String := Exe & Suffix.all; Basename : constant String := Exe & Suffix.all;
Path : GNAT.OS_Lib.String_Access := Getenv ("PATH"); Path : GNAT.OS_Lib.String_Access := Getenv ("PATH");
...@@ -108,8 +109,7 @@ package body VxLink is ...@@ -108,8 +109,7 @@ package body VxLink is
-- Set_Verbose -- -- Set_Verbose --
----------------- -----------------
procedure Set_Verbose (Value : Boolean) procedure Set_Verbose (Value : Boolean) is
is
begin begin
Verbose := Value; Verbose := Value;
end Set_Verbose; end Set_Verbose;
...@@ -118,8 +118,7 @@ package body VxLink is ...@@ -118,8 +118,7 @@ package body VxLink is
-- Is_Verbose -- -- Is_Verbose --
---------------- ----------------
function Is_Verbose return Boolean function Is_Verbose return Boolean is
is
begin begin
return Verbose; return Verbose;
end Is_Verbose; end Is_Verbose;
...@@ -128,8 +127,7 @@ package body VxLink is ...@@ -128,8 +127,7 @@ package body VxLink is
-- Set_Error_State -- -- Set_Error_State --
--------------------- ---------------------
procedure Set_Error_State (Message : String) procedure Set_Error_State (Message : String) is
is
begin begin
Log_Error ("Error: " & Message); Log_Error ("Error: " & Message);
Error_State := True; Error_State := True;
...@@ -140,8 +138,7 @@ package body VxLink is ...@@ -140,8 +138,7 @@ package body VxLink is
-- Is_Error_State -- -- Is_Error_State --
-------------------- --------------------
function Is_Error_State return Boolean function Is_Error_State return Boolean is
is
begin begin
return Error_State; return Error_State;
end Is_Error_State; end Is_Error_State;
...@@ -150,8 +147,7 @@ package body VxLink is ...@@ -150,8 +147,7 @@ package body VxLink is
-- Log_Info -- -- Log_Info --
-------------- --------------
procedure Log_Info (S : String) procedure Log_Info (S : String) is
is
begin begin
if Verbose then if Verbose then
Ada.Text_IO.Put_Line (S); Ada.Text_IO.Put_Line (S);
...@@ -162,8 +158,7 @@ package body VxLink is ...@@ -162,8 +158,7 @@ package body VxLink is
-- Log_Error -- -- Log_Error --
--------------- ---------------
procedure Log_Error (S : String) procedure Log_Error (S : String) is
is
begin begin
Ada.Text_IO.Put_Line (Ada.Text_IO.Standard_Error, S); Ada.Text_IO.Put_Line (Ada.Text_IO.Standard_Error, S);
end Log_Error; end Log_Error;
...@@ -172,8 +167,7 @@ package body VxLink is ...@@ -172,8 +167,7 @@ package body VxLink is
-- Run -- -- Run --
--------- ---------
procedure Run (Arguments : Arguments_List) procedure Run (Arguments : Arguments_List) is
is
Output : constant String := Run (Arguments); Output : constant String := Run (Arguments);
begin begin
if not Is_Error_State then if not Is_Error_State then
...@@ -187,13 +181,12 @@ package body VxLink is ...@@ -187,13 +181,12 @@ package body VxLink is
-- Run -- -- Run --
--------- ---------
function Run (Arguments : Arguments_List) return String function Run (Arguments : Arguments_List) return String is
is
Args : GNAT.OS_Lib.Argument_List_Access := Args : GNAT.OS_Lib.Argument_List_Access :=
new GNAT.OS_Lib.Argument_List new GNAT.OS_Lib.Argument_List
(1 .. Natural (Arguments.Length) - 1); (1 .. Natural (Arguments.Length) - 1);
Base : constant String := Base_Name (Arguments.First_Element); Base : constant String := Base_Name (Arguments.First_Element);
Status : aliased Integer := 0;
Debug_Line : Unbounded_String; Debug_Line : Unbounded_String;
Add_Quotes : Boolean; Add_Quotes : Boolean;
...@@ -234,13 +227,15 @@ package body VxLink is ...@@ -234,13 +227,15 @@ package body VxLink is
end if; end if;
declare declare
Ret : constant String := Status : aliased Integer := 0;
Get_Command_Output Ret : constant String :=
(Command => Arguments.First_Element, Get_Command_Output
Arguments => Args.all, (Command => Arguments.First_Element,
Input => "", Arguments => Args.all,
Status => Status'Access, Input => "",
Err_To_Out => True); Status => Status'Access,
Err_To_Out => True);
begin begin
GNAT.OS_Lib.Free (Args); GNAT.OS_Lib.Free (Args);
...@@ -248,6 +243,7 @@ package body VxLink is ...@@ -248,6 +243,7 @@ package body VxLink is
pragma Annotate (Codepeer, False_Positive, pragma Annotate (Codepeer, False_Positive,
"test always false", "test always false",
"Status modified by Get_Command_Output"); "Status modified by Get_Command_Output");
Ada.Text_IO.Put_Line (Ret); Ada.Text_IO.Put_Line (Ret);
Set_Error_State Set_Error_State
(Base_Name (Arguments.First_Element) & (Base_Name (Arguments.First_Element) &
...@@ -262,8 +258,7 @@ package body VxLink is ...@@ -262,8 +258,7 @@ package body VxLink is
-- Gcc -- -- Gcc --
--------- ---------
function Gcc return String function Gcc return String is
is
begin begin
return Which (Triplet & "gcc"); return Which (Triplet & "gcc");
end Gcc; end Gcc;
...@@ -272,8 +267,7 @@ package body VxLink is ...@@ -272,8 +267,7 @@ package body VxLink is
-- Gxx -- -- Gxx --
--------- ---------
function Gxx return String function Gxx return String is
is
begin begin
return Which (Triplet & "g++"); return Which (Triplet & "g++");
end Gxx; end Gxx;
...@@ -282,8 +276,7 @@ package body VxLink is ...@@ -282,8 +276,7 @@ package body VxLink is
-- Nm -- -- Nm --
-------- --------
function Nm return String function Nm return String is
is
begin begin
return Which (Triplet & "nm"); return Which (Triplet & "nm");
end Nm; end Nm;
......
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