[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
This commit is contained in:
Arnaud Charlet 2019-07-03 08:13:55 +00:00 committed by Pierre-Marie de Rodat
parent 44f83ca4f4
commit 81c10c3f91
2 changed files with 16 additions and 4 deletions

View File

@ -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

View File

@ -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;