mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
bpo-36876: Small adjustments to the C-analyzer tool. (GH-23045)
This is a little bit of clean-up, small fixes, and additional helpers prior to building an updated & accurate list of globals to eliminate.
This commit is contained in:
parent
b9ee4af4c6
commit
4fe72090de
16 changed files with 632 additions and 217 deletions
|
|
@ -7,7 +7,11 @@ from c_parser.info import (
|
|||
HighlevelParsedItem,
|
||||
Declaration,
|
||||
TypeDeclaration,
|
||||
)
|
||||
from c_parser.match import (
|
||||
is_type_decl,
|
||||
)
|
||||
from .match import (
|
||||
is_process_global,
|
||||
)
|
||||
|
||||
|
|
@ -16,44 +20,6 @@ IGNORED = _misc.Labeled('IGNORED')
|
|||
UNKNOWN = _misc.Labeled('UNKNOWN')
|
||||
|
||||
|
||||
# XXX Use known.tsv for these?
|
||||
SYSTEM_TYPES = {
|
||||
'int8_t',
|
||||
'uint8_t',
|
||||
'int16_t',
|
||||
'uint16_t',
|
||||
'int32_t',
|
||||
'uint32_t',
|
||||
'int64_t',
|
||||
'uint64_t',
|
||||
'size_t',
|
||||
'ssize_t',
|
||||
'intptr_t',
|
||||
'uintptr_t',
|
||||
'wchar_t',
|
||||
'',
|
||||
# OS-specific
|
||||
'pthread_cond_t',
|
||||
'pthread_mutex_t',
|
||||
'pthread_key_t',
|
||||
'atomic_int',
|
||||
'atomic_uintptr_t',
|
||||
'',
|
||||
# lib-specific
|
||||
'WINDOW', # curses
|
||||
'XML_LChar',
|
||||
'XML_Size',
|
||||
'XML_Parser',
|
||||
'enum XML_Error',
|
||||
'enum XML_Status',
|
||||
'',
|
||||
}
|
||||
|
||||
|
||||
def is_system_type(typespec):
|
||||
return typespec in SYSTEM_TYPES
|
||||
|
||||
|
||||
class SystemType(TypeDeclaration):
|
||||
|
||||
def __init__(self, name):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue