From ad2fd234e7087b2a7bb7e3554736663d3ea5d6be Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Wed, 1 Dec 2021 16:54:43 +0100 Subject: [PATCH] [Ada] Simplify calls to Name_Find with known string parameter gcc/ada/ * gnatls.adb (Gnatls): Use Name_Find function. * targparm.adb (Get_Target_Parameters): Likewise. --- gcc/ada/gnatls.adb | 5 +---- gcc/ada/targparm.adb | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/gcc/ada/gnatls.adb b/gcc/ada/gnatls.adb index b20cda4fdd68..4c69b727aafb 100644 --- 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 index ade05c257952..d5755e1ee083 100644 --- 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"); -- 2.47.2