gh-90110: Update the c-analyzer Tool (gh-96058)

This commit is contained in:
Eric Snow 2022-08-17 16:54:59 -06:00 committed by GitHub
parent 5aac85101b
commit 586fc02be5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 87 additions and 8 deletions

View File

@ -385,6 +385,9 @@ def get_parsed_vartype(decl):
elif isinstance(decl, Variable):
storage = decl.storage
typequal, typespec, abstract = decl.vartype
elif isinstance(decl, Signature):
storage = None
typequal, typespec, abstract = decl.returntype
elif isinstance(decl, Function):
storage = decl.storage
typequal, typespec, abstract = decl.signature.returntype
@ -1012,6 +1015,18 @@ class Signature(namedtuple('Signature', 'params returntype inline isforward')):
def returns(self):
return self.returntype
@property
def typequal(self):
return self.returntype.typequal
@property
def typespec(self):
return self.returntype.typespec
@property
def abstract(self):
return self.returntype.abstract
class Function(Declaration):
kind = KIND.FUNCTION
@ -1106,9 +1121,16 @@ class TypeDef(TypeDeclaration):
def _resolve_data(cls, data):
if not data:
raise NotImplementedError(data)
vartype = dict(data)
del vartype['storage']
return VarType(**vartype), None
kwargs = dict(data)
del kwargs['storage']
if 'returntype' in kwargs:
vartype = kwargs['returntype']
del vartype['storage']
kwargs['returntype'] = VarType(**vartype)
datacls = Signature
else:
datacls = VarType
return datacls(**kwargs), None
@classmethod
def _raw_data(self, data):

View File

@ -9,7 +9,11 @@ from ._regexes import (
def log_match(group, m):
from . import _logger
_logger.debug(f'matched <{group}> ({m.group(0)})')
text = m.group(0)
if text.startswith(('(', ')')) or text.endswith(('(', ')')):
_logger.debug(f'matched <{group}> ({text!r})')
else:
_logger.debug(f'matched <{group}> ({text})')
#############################

View File

@ -86,8 +86,6 @@ Objects/unicodetype_db.h
# generated
Python/deepfreeze/*.c
Python/frozen_modules/*.h
Python/opcode_targets.h
Python/stdlib_module_names.h
# @end=conf@
''')
@ -109,9 +107,7 @@ Objects/stringlib/split.h
Modules/_dbmmodule.c
Modules/cjkcodecs/_codecs_*.c
Modules/expat/xmlrole.c
Modules/expat/xmlparse.c
Python/initconfig.c
''')
INCL_DIRS = clean_lines('''
@ -308,8 +304,12 @@ MAX_SIZES = {
_abs('Objects/stringlib/unicode_format.h'): (10_000, 400),
_abs('Objects/typeobject.c'): (20_000, 200),
_abs('Python/compile.c'): (20_000, 500),
_abs('Python/deepfreeze/*.c'): (20_000, 500),
_abs('Python/frozen_modules/*.h'): (20_000, 500),
_abs('Python/pylifecycle.c'): (500_000, 5000),
_abs('Python/pystate.c'): (500_000, 5000),
_abs('Python/opcode_targets.h'): (10_000, 500),
_abs('Python/stdlib_module_names.h'): (5_000, 500),
}

View File

@ -307,6 +307,58 @@ Objects/object.c - _PyLineIterator -
Objects/object.c - _PyPositionsIterator -
Python/importdl.h - _PyImport_DynLoadFiletab -
Modules/expat/xmlrole.c - prolog0 -
Modules/expat/xmlrole.c - prolog1 -
Modules/expat/xmlrole.c - prolog2 -
Modules/expat/xmlrole.c - doctype0 -
Modules/expat/xmlrole.c - doctype1 -
Modules/expat/xmlrole.c - doctype2 -
Modules/expat/xmlrole.c - doctype3 -
Modules/expat/xmlrole.c - doctype4 -
Modules/expat/xmlrole.c - doctype5 -
Modules/expat/xmlrole.c - internalSubset -
Modules/expat/xmlrole.c - entity0 -
Modules/expat/xmlrole.c - entity1 -
Modules/expat/xmlrole.c - entity2 -
Modules/expat/xmlrole.c - entity3 -
Modules/expat/xmlrole.c - entity4 -
Modules/expat/xmlrole.c - entity5 -
Modules/expat/xmlrole.c - entity6 -
Modules/expat/xmlrole.c - entity7 -
Modules/expat/xmlrole.c - entity8 -
Modules/expat/xmlrole.c - entity9 -
Modules/expat/xmlrole.c - entity10 -
Modules/expat/xmlrole.c - notation0 -
Modules/expat/xmlrole.c - notation1 -
Modules/expat/xmlrole.c - notation2 -
Modules/expat/xmlrole.c - notation3 -
Modules/expat/xmlrole.c - notation4 -
Modules/expat/xmlrole.c - attlist0 -
Modules/expat/xmlrole.c - attlist1 -
Modules/expat/xmlrole.c - attlist2 -
Modules/expat/xmlrole.c - attlist3 -
Modules/expat/xmlrole.c - attlist4 -
Modules/expat/xmlrole.c - attlist5 -
Modules/expat/xmlrole.c - attlist6 -
Modules/expat/xmlrole.c - attlist7 -
Modules/expat/xmlrole.c - attlist8 -
Modules/expat/xmlrole.c - attlist9 -
Modules/expat/xmlrole.c - element0 -
Modules/expat/xmlrole.c - element1 -
Modules/expat/xmlrole.c - element2 -
Modules/expat/xmlrole.c - element3 -
Modules/expat/xmlrole.c - element4 -
Modules/expat/xmlrole.c - element5 -
Modules/expat/xmlrole.c - element6 -
Modules/expat/xmlrole.c - element7 -
Modules/expat/xmlrole.c - externalSubset0 -
Modules/expat/xmlrole.c - externalSubset1 -
Modules/expat/xmlrole.c - condSect0 -
Modules/expat/xmlrole.c - condSect1 -
Modules/expat/xmlrole.c - condSect2 -
Modules/expat/xmlrole.c - declClose -
Modules/expat/xmlrole.c - error -
##################################
# test code
@ -1933,4 +1985,5 @@ Python/specialize.c - adaptive_opcodes -
Python/specialize.c - cache_requirements -
Python/specialize.c - compare_masks -
Python/specialize.c - _PyOpcode_Adaptive -
Python/stdlib_module_names.h - _Py_stdlib_module_names -
Python/sysmodule.c - whatstrings -

Can't render this file because it has a wrong number of fields in line 4.