public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6247] [Ada] Simplify calls to Name_Find with known string parameter
@ 2022-01-05 11:35 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-01-05 11:35 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:ad2fd234e7087b2a7bb7e3554736663d3ea5d6be

commit r12-6247-gad2fd234e7087b2a7bb7e3554736663d3ea5d6be
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Wed Dec 1 16:54:43 2021 +0100

    [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.

Diff:
---
 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 b20cda4fdd6..4c69b727aaf 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 ade05c25795..d5755e1ee08 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");


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-05 11:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-05 11:35 [gcc r12-6247] [Ada] Simplify calls to Name_Find with known string parameter Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).