matchcompiler.py: declare matchcompiled functions as `inline` (#4536)

This commit is contained in:
Oliver Stöneberg 2022-10-06 07:58:48 +02:00 committed by GitHub
parent cb095835e0
commit 6634cb95a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -206,7 +206,7 @@ class MatchCompiler:
arg2 = ', const int varid'
ret = '// pattern: ' + pattern + '\n'
ret += 'static bool match' + \
ret += 'static inline bool match' + \
str(nr) + '(' + tokenType + '* tok' + arg2 + ') {\n'
returnStatement = 'return false;\n'
@ -290,7 +290,7 @@ class MatchCompiler:
more_args += ', int varid'
ret = '// pattern: ' + pattern + '\n'
ret += 'template<class T> static T * findmatch' + \
ret += 'template<class T> static inline T * findmatch' + \
str(findmatchnr) + '(T * start_tok' + more_args + ') {\n'
ret += ' for (; start_tok' + endCondition + \
'; start_tok = start_tok->next()) {\n'
@ -373,7 +373,7 @@ class MatchCompiler:
if varId:
more_args = ', const int varid'
ret = 'static bool match_verify' + \
ret = 'static inline bool match_verify' + \
str(verifyNumber) + '(const Token *tok' + more_args + ') {\n'
origMatchName = 'Match'
@ -509,7 +509,7 @@ class MatchCompiler:
if varId:
more_args += ', const int varid'
ret = 'template < class T > static T * findmatch_verify' + \
ret = 'template < class T > static inline T * findmatch_verify' + \
str(verifyNumber) + '(T * tok' + more_args + ') {\n'
origFindMatchName = 'findmatch'