diff mbox series

[Ada] Simplify calls to Name_Find with known string parameter

Message ID 20220105113351.GA2715810@adacore.com
State New
Headers show
Series [Ada] Simplify calls to Name_Find with known string parameter | expand

Commit Message

Pierre-Marie de Rodat Jan. 5, 2022, 11:33 a.m. UTC
Code cleanup; semantics is unaffected.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* gnatls.adb (Gnatls): Use Name_Find function.
	* targparm.adb (Get_Target_Parameters): Likewise.
diff mbox series

Patch

diff --git a/gcc/ada/gnatls.adb b/gcc/ada/gnatls.adb
--- a/gcc/ada/gnatls.adb
+++ b/gcc/ada/gnatls.adb
@@ -2092,10 +2092,7 @@  begin
          Hi   : Source_Ptr;
 
       begin
-         Name_Buffer (1 .. 10) := "system.ads";
-         Name_Len := 10;
-
-         Read_Source_File (Name_Find, 0, Hi, Text, FD);
+         Read_Source_File (Name_Find ("system.ads"), 0, Hi, Text, FD);
 
          if Null_Source_Buffer_Ptr (Text) then
             No_Runtime := True;


diff --git a/gcc/ada/targparm.adb b/gcc/ada/targparm.adb
--- a/gcc/ada/targparm.adb
+++ b/gcc/ada/targparm.adb
@@ -157,10 +157,7 @@  package body Targparm is
          return;
       end if;
 
-      Name_Buffer (1 .. 10) := "system.ads";
-      Name_Len := 10;
-
-      Read_Source_File (Name_Find, 0, Hi, Text, FD);
+      Read_Source_File (Name_Find ("system.ads"), 0, Hi, Text, FD);
 
       if Null_Source_Buffer_Ptr (Text) then
          Write_Line ("fatal error, run-time library not installed correctly");