-- Flag Is_Inlined_Always is True by default, and reversed to False for
-- those subprograms which could be inlined in GNATprove mode (because
- -- Body_To_Inline is non-Empty) but should not be inlined.
+ -- Body_To_Inline is non-Empty) but should not be inlined. Flag
+ -- Is_Inlined is True by default and reversed to False when inlining
+ -- fails because the subprogram is detected to be recursive.
if GNATprove_Mode then
Set_Is_Inlined_Always (Designator);
+ Set_Is_Inlined (Designator);
end if;
-- Introduce new scope for analysis of the formals and the return type
-- In GNATprove mode, expansion is disabled, but we want to inline some
-- subprograms to facilitate formal verification. Indirect calls through
-- a subprogram type or within a generic cannot be inlined. Inlining is
- -- performed only for calls subject to SPARK_Mode on.
+ -- performed only for calls subject to SPARK_Mode => On.
elsif GNATprove_Mode
and then SPARK_Mode = On
if Nkind (Nam_Decl) = N_Subprogram_Declaration then
Body_Id := Corresponding_Body (Nam_Decl);
- -- Nothing to do if the subprogram is not eligible for inlining in
- -- GNATprove mode, or inlining is disabled with switch -gnatdm
+ -- Nothing to do if the subprogram is not inlined (because it is
+ -- recursive, directly or indirectly), or is not eligible for
+ -- inlining GNATprove mode (because of properties of the
+ -- subprogram itself), or inlining has been disabled with switch
+ -- -gnatdm.
- if not Is_Inlined_Always (Nam_UA)
+ if not Is_Inlined (Nam_UA)
or else not Can_Be_Inlined_In_GNATprove_Mode (Nam_UA, Body_Id)
or else Debug_Flag_M
then