diff options
author | Arnaud Charlet <charlet@adacore.com> | 2019-07-03 08:13:55 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-07-03 08:13:55 +0000 |
commit | 81c10c3f91cb42ecf1b32de800f09282bed31553 (patch) | |
tree | 8a58efe603506f002f8bec1df681837c332f0a3a /gcc/ada | |
parent | 44f83ca4f452061f7e8c7c4dabd5235af1295a8a (diff) | |
download | gcc-81c10c3f91cb42ecf1b32de800f09282bed31553.zip gcc-81c10c3f91cb42ecf1b32de800f09282bed31553.tar.gz gcc-81c10c3f91cb42ecf1b32de800f09282bed31553.tar.bz2 |
[Ada] Do not consider inlined subprograms when generating C code
2019-07-03 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* sem_ch7.adb (Has_Referencer): Do not consider inlined
subprograms when generating C code, which allows us to generate
static inline subprograms.
From-SVN: r272964
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ada/sem_ch7.adb | 14 |
2 files changed, 16 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 879b776..d1b11ce 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2019-07-03 Arnaud Charlet <charlet@adacore.com> + + * sem_ch7.adb (Has_Referencer): Do not consider inlined + subprograms when generating C code, which allows us to generate + static inline subprograms. + 2019-07-03 Justin Squirek <squirek@adacore.com> * sem_ch6.adb (Check_Conformance): Add expression checking for diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index 2ed2746..a1b98f0 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -389,6 +389,8 @@ package body Sem_Ch7 is end if; -- An inlined subprogram body acts as a referencer + -- unless we generate C code since inlining is then + -- handled by the C compiler. -- Note that we test Has_Pragma_Inline here in addition -- to Is_Inlined. We are doing this for a client, since @@ -397,8 +399,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 Is_Inlined (Decl_Id) - or else Has_Pragma_Inline (Decl_Id) + if not Generate_C_Code + and then (Is_Inlined (Decl_Id) + or else Has_Pragma_Inline (Decl_Id)) then Has_Referencer_Of_Non_Subprograms := True; @@ -415,9 +418,12 @@ package body Sem_Ch7 is Decl_Id := Defining_Entity (Decl); -- An inlined subprogram body acts as a referencer + -- unless we generate C code since inlining is then + -- handled by the C compiler. - if Is_Inlined (Decl_Id) - or else Has_Pragma_Inline (Decl_Id) + if not Generate_C_Code + and then (Is_Inlined (Decl_Id) + or else Has_Pragma_Inline (Decl_Id)) then Has_Referencer_Of_Non_Subprograms := True; |