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