Merge branch 'noinline-noreturn' into 'main'

Updated supported procedure modifiers: noinline, noreturn

See merge request freepascal.org/lazarus/lazarus!72
This commit is contained in:
Juha Manninen 2022-02-24 12:43:06 +00:00
commit 0cec6db9e6
5 changed files with 12 additions and 2 deletions

View File

@ -265,6 +265,8 @@ type
psEnumerator, psEnumerator,
psVarargs, psVarargs,
psVectorCall, psVectorCall,
psNoReturn,
psNoInline,
psEdgedBracket psEdgedBracket
); );
TAllProcedureSpecifiers = set of TProcedureSpecifier; TAllProcedureSpecifiers = set of TProcedureSpecifier;
@ -277,6 +279,7 @@ const
'FAR', 'NEAR', 'FINAL', 'STATIC', 'MWPASCAL', 'NOSTACKFRAME', 'FAR', 'NEAR', 'FINAL', 'STATIC', 'MWPASCAL', 'NOSTACKFRAME',
'DEPRECATED', 'DISPID', 'PLATFORM', 'SAFECALL', 'UNIMPLEMENTED', 'DEPRECATED', 'DISPID', 'PLATFORM', 'SAFECALL', 'UNIMPLEMENTED',
'EXPERIMENTAL', 'LIBRARY', 'ENUMERATOR', 'VARARGS', 'VECTORCALL', 'EXPERIMENTAL', 'LIBRARY', 'ENUMERATOR', 'VARARGS', 'VECTORCALL',
'NORETURN', 'NOINLINE',
'[' '['
); );

View File

@ -879,6 +879,7 @@ begin
Add('MS_ABI_CDECL' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('MS_ABI_CDECL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('EXTDECL' ,{$ifdef FPC}@{$endif}AllwaysTrue); // often used for macros Add('EXTDECL' ,{$ifdef FPC}@{$endif}AllwaysTrue); // often used for macros
ADD('MWPASCAL' ,{$ifdef FPC}@{$endif}AllwaysTrue); ADD('MWPASCAL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('NOINLINE' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('NOSTACKFRAME' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('NOSTACKFRAME' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('NORETURN' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('NORETURN' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('DEPRECATED' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('DEPRECATED' ,{$ifdef FPC}@{$endif}AllwaysTrue);
@ -934,6 +935,7 @@ begin
Add('LOCAL' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('LOCAL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
ADD('MWPASCAL' ,{$ifdef FPC}@{$endif}AllwaysTrue); ADD('MWPASCAL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('NEAR' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('NEAR' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('NOINLINE' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('NORETURN' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('NORETURN' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('NOSTACKFRAME' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('NOSTACKFRAME' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('OLDFPCCALL' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('OLDFPCCALL' ,{$ifdef FPC}@{$endif}AllwaysTrue);

View File

@ -1345,7 +1345,7 @@ function TPascalParserTool.KeyWordFuncClassMethod: boolean;
proc specifiers without parameters: proc specifiers without parameters:
stdcall, virtual, abstract, dynamic, overload, override, cdecl, inline, stdcall, virtual, abstract, dynamic, overload, override, cdecl, inline,
rtlproc, noreturn rtlproc, noinline, noreturn
proc specifiers with parameters: proc specifiers with parameters:
message <id or number> message <id or number>

View File

@ -413,6 +413,8 @@ type
po_auto_raised_visibility, po_auto_raised_visibility,
{ procedure is far (x86 only) } { procedure is far (x86 only) }
po_far, po_far,
{ Procedure can't be inlined }
po_noinline,
{ the procedure never returns, this information is usefull for dfa } { the procedure never returns, this information is usefull for dfa }
po_noreturn po_noreturn
); );
@ -545,6 +547,8 @@ const
'auto_raised_visibility', 'auto_raised_visibility',
{ procedure is far (x86 only) } { procedure is far (x86 only) }
'far', 'far',
{ Procedure can't be inlined }
'noinline',
{ the procedure never returns, this information is usefull for dfa } { the procedure never returns, this information is usefull for dfa }
'noreturn' 'noreturn'
); );

View File

@ -1833,7 +1833,8 @@ end;
function TSynPasSyn.Func92: TtkTokenKind; function TSynPasSyn.Func92: TtkTokenKind;
begin begin
if D4syntax and KeyComp('overload') then Result := tkKey else if D4syntax and KeyComp('overload') then Result := tkKey else
if KeyComp('Inherited') then Result := tkKey else Result := tkIdentifier; if KeyComp('NoInline') then Result := tkKey else
if KeyComp('Inherited') then Result := tkKey else Result := tkIdentifier;
end; end;
function TSynPasSyn.Func94: TtkTokenKind; function TSynPasSyn.Func94: TtkTokenKind;