]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Tweak Is_Predefined_File_Name
authorRonan Desplanques <desplanques@adacore.com>
Thu, 16 Oct 2025 08:07:04 +0000 (10:07 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 3 Nov 2025 14:15:17 +0000 (15:15 +0100)
This patch extends the set of names recognized by
Is_Predefined_File_Name so that names that start with "a-" and are longer
than 12 characters are considered predefined.

This is motivated by the need to make gprname work with the in-tree
a-strunb__shared.ads file that uses GNAT syntax extensions but whose name
wasn't considered predefined before this patch.

gcc/ada/ChangeLog:

* fname.adb (Is_Predefined_File_Name): Tweak.

gcc/ada/fname.adb

index 6022d3b2ba8dea72285d1652a9d551fe1c5edb95..c914c55f8266ea5bd4911b17666d53b88690028f 100644 (file)
@@ -134,19 +134,6 @@ package body Fname is
       Renamings_Included : Boolean := True) return Boolean
    is
    begin
-      --  Definitely false if longer than 12 characters (8.3), except for the
-      --  Interfaces packages and also the implementation units of the 128-bit
-      --  types under System.
-
-      if Fname'Length > 12
-        and then Fname (Fname'First .. Fname'First + 1) /= "i-"
-        and then Fname (Fname'First .. Fname'First + 1) /= "s-"
-        and then not Has_Prefix (Fname, "system-")
-        and then not Has_Prefix (Fname, "interfac__")
-      then
-         return False;
-      end if;
-
       if not Has_Internal_Extension (Fname) then
          return False;
       end if;