diff options
author | Arnaud Charlet <charlet@adacore.com> | 2022-09-27 08:57:00 +0000 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-05-29 10:23:19 +0200 |
commit | 41448347f4464bceed9c09d9f1401c40118b8797 (patch) | |
tree | d0d29ede6aaea2c574a95c34b56c6e72b57af27b | |
parent | bf25f6fc571c0f3b1ca1c70106730104ea91c65a (diff) | |
download | gcc-41448347f4464bceed9c09d9f1401c40118b8797.zip gcc-41448347f4464bceed9c09d9f1401c40118b8797.tar.gz gcc-41448347f4464bceed9c09d9f1401c40118b8797.tar.bz2 |
ada: Refining handling of inlining for CCG
By marking relevant functions inline when -gnatn is used.
gcc/ada/
* sem_ch7.adb: Refine handling of inlining for CCG
-rw-r--r-- | gcc/ada/sem_ch7.adb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index aed09f3..ecb4bbe 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -319,8 +319,9 @@ package body Sem_Ch7 is function Set_Referencer_Of_Non_Subprograms return Boolean is begin -- An inlined subprogram body acts as a referencer - -- unless we generate C code since inlining is then - -- handled by the C compiler. + -- unless we generate C code without -gnatn where we want + -- to favor generating static inline functions as much as + -- possible. -- Note that we test Has_Pragma_Inline here in addition -- to Is_Inlined. We are doing this for a client, since @@ -329,7 +330,9 @@ package body Sem_Ch7 is -- should occur, so we need to catch all cases where the -- subprogram may be inlined by the client. - if (not CCG_Mode or else Has_Pragma_Inline_Always (Decl_Id)) + if (not CCG_Mode + or else Has_Pragma_Inline_Always (Decl_Id) + or else Inline_Active) and then (Is_Inlined (Decl_Id) or else Has_Pragma_Inline (Decl_Id)) then |