aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/inline.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/inline.adb')
-rw-r--r--gcc/ada/inline.adb16
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb
index d85e086..5f5a4a0 100644
--- a/gcc/ada/inline.adb
+++ b/gcc/ada/inline.adb
@@ -428,13 +428,17 @@ package body Inline is
-- Start of processing for Add_Inlined_Subprogram
begin
- -- Insert the current subprogram in the list of inlined subprograms, if
- -- it can actually be inlined by the back-end, and if its unit is known
- -- to be inlined, or is an instance whose body will be analyzed anyway.
-
- if (Is_Inlined (Pack) or else Is_Generic_Instance (Pack))
+ -- If the subprogram is to be inlined, and if its unit is known to be
+ -- inlined or is an instance whose body will be analyzed anyway or the
+ -- subprogram has been generated by the compiler, and if it is declared
+ -- at the library level not in the main unit, and if it can be inlined
+ -- by the back-end, then insert it in the list of inlined subprograms.
+
+ if Is_Inlined (E)
+ and then (Is_Inlined (Pack)
+ or else Is_Generic_Instance (Pack)
+ or else Is_Internal (E))
and then not Scope_In_Main_Unit (E)
- and then Is_Inlined (E)
and then not Is_Nested (E)
and then not Has_Initialized_Type (E)
then