]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Tweak test for predefined main unit
authorRonan Desplanques <desplanques@adacore.com>
Mon, 4 Nov 2024 16:57:15 +0000 (17:57 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 18 Nov 2024 14:06:54 +0000 (15:06 +0100)
This change is part of an effort to reduce usage of
Is_Predefined_Filename.

gcc/ada/ChangeLog:

* frontend.adb (Frontend): tweak test for predefined main unit.

gcc/ada/frontend.adb

index ea0c7b12b4a0942f2818f3095f727a63cf74d79a..bb7a332986c8d6e83537d84b6a27e82d37206af5 100644 (file)
@@ -380,9 +380,7 @@ begin
       --  Disable Initialize_Scalars for runtime files to avoid circular
       --  dependencies.
 
-      if Initialize_Scalars
-        and then Fname.Is_Predefined_File_Name (File_Name (Main_Source_File))
-      then
+      if Initialize_Scalars and then Is_Predefined_Unit (Main_Unit) then
          Initialize_Scalars   := False;
          Init_Or_Norm_Scalars := Normalize_Scalars;
       end if;