+ new pio_inline_forbidden flag to indicate that while parsing the

implementation the compiler determined the routine must never be
    inlined
   o difference with po_noinline: can also be set in the implementation
   o difference with pio_inline_not_possible: it indicates that e.g.
     LLVM must not inline the routine either

git-svn-id: trunk@44065 -
This commit is contained in:
Jonas Maebe 2020-01-29 22:21:17 +00:00
parent b625afe800
commit 254b85c352
4 changed files with 10 additions and 3 deletions

View File

@ -1010,7 +1010,8 @@ implementation
writer.AsmWrite(' returns_twice');
if po_inline in pd.procoptions then
writer.AsmWrite(' inlinehint');
if po_noinline in pd.procoptions then
if (po_noinline in pd.procoptions) or
(pio_inline_forbidden in pd.implprocoptions) then
writer.AsmWrite(' noinline');
{ ensure that functions that happen to have the same name as a
standard C library function, but which are implemented in Pascal,

View File

@ -211,6 +211,9 @@ implementation
if pi_uses_get_frame in current_procinfo.flags then
begin
_no_inline('get_frame');
{ for LLVM: it can inline things that FPC can't, but it mustn't
inline this one }
include(current_procinfo.procdef.implprocoptions,pio_inline_forbidden);
exit;
end;

View File

@ -442,7 +442,9 @@ type
{ a stub/thunk }
pio_thunk,
{ compiled with fastmath enabled }
pio_fastmath
pio_fastmath,
{ inline is forbidden (calls get_frame) }
pio_inline_forbidden
);
timplprocoptions = set of timplprocoption;

View File

@ -3218,7 +3218,8 @@ const
(mask:pio_inline_not_possible; str:'InlineNotPossible'),
(mask:pio_nested_access; str:'NestedAccess'),
(mask:pio_thunk; str:'Thunk'),
(mask:pio_fastmath; str:'FastMath')
(mask:pio_fastmath; str:'FastMath'),
(mask:pio_inline_forbidden; str:'InlineForbidden')
);
var
i: timplprocoption;