]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: The Library_Unit field was used for all sorts of different purposes, which led...
authorsquirek <squirek@adacore.com>
Mon, 21 Oct 2024 18:21:13 +0000 (18:21 +0000)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 12 Nov 2024 13:00:47 +0000 (14:00 +0100)
This patch further refines the previous work to fix several cases.

gcc/ada/ChangeLog:

* inline.adb (In_Main_Unit_Or_Subunit): Use Other_Comp_Unit instead of
Spec_Or_Body_Lib_Unit.
(Must_Inline): Use Other_Comp_Unit instead of Spec_Or_Body_Lib_Unit.

gcc/ada/inline.adb

index 9fa5642238efb1f3c0f59198e8e6cf12f8742ad5..a133ec7f72b292094335f8e36fc36d2261418a52 100644 (file)
@@ -498,7 +498,7 @@ package body Inline is
          --  package of the subprogram to find more calls to be inlined.
 
          if Comp = Cunit (Main_Unit)
-           or else Comp = Spec_Or_Body_Lib_Unit (Cunit (Main_Unit))
+           or else Comp = Other_Comp_Unit (Cunit (Main_Unit))
          then
             Add_Call (E);
             return Inline_Package;
@@ -4716,7 +4716,7 @@ package body Inline is
       end loop;
 
       return Comp = Cunit (Main_Unit)
-        or else Comp = Spec_Or_Body_Lib_Unit (Cunit (Main_Unit));
+        or else Comp = Other_Comp_Unit (Cunit (Main_Unit));
    end In_Main_Unit_Or_Subunit;
 
    ----------------