diff --git a/lib/core/SymbolUtils.py b/lib/core/SymbolUtils.py index 8437833..e72be44 100644 --- a/lib/core/SymbolUtils.py +++ b/lib/core/SymbolUtils.py @@ -2712,6 +2712,33 @@ def IsPtrSubscriptNode(node: ast.AST, symtable: object | None = None, return IsCPtrMarkerNode(value, symtable, TCAliasMap) +_GENERIC_ARG_INT_NAMES: frozenset[str] = frozenset({ + 'CInt', 'CChar', 'CShort', 'CLong', 'CLongLong', + 'CUnsigned', 'CUnsignedChar', 'CUnsignedInt', 'CUnsignedShort', + 'CUnsignedLong', 'CUnsignedLongLong', 'CSignedChar', 'CBool', + 'CInt8T', 'CInt16T', 'CInt32T', 'CInt64T', + 'CUInt8T', 'CUInt16T', 'CUInt32T', 'CUInt64T', + 'CIntFast8T', 'CIntFast16T', 'CIntFast32T', 'CIntFast64T', + 'CUIntFast8T', 'CUIntFast16T', 'CUIntFast32T', 'CUIntFast64T', + 'CIntLeast8T', 'CIntLeast16T', 'CIntLeast32T', 'CIntLeast64T', + 'CUIntLeast8T', 'CUIntLeast16T', 'CUIntLeast32T', 'CUIntLeast64T', + 'CSizeT', 'CIntPtrT', 'CUIntPtrT', 'CPtrDiffT', + 'int8', 'int16', 'int32', 'int64', + 'uint8', 'uint16', 'uint32', 'uint64', + 'intfast8', 'intfast16', 'intfast32', 'intfast64', + 'uintfast8', 'uintfast16', 'uintfast32', 'uintfast64', + 'intleast8', 'intleast16', 'intleast32', 'intleast64', + 'uintleast8', 'uintleast16', 'uintleast32', 'uintleast64', + 'sizet', 'size_t', 'uchar', 'short', 'ushort', 'uint', + 'long', 'ulong', 'longlong', 'ulonglong', 'ptrdifft', +}) + +_GENERIC_ARG_FLOAT_NAMES: frozenset[str] = frozenset({ + 'CFloat', 'CDouble', 'CFloat8T', 'CFloat16T', + 'CFloat32T', 'CFloat64T', 'CFloat128T', +}) + + def NormalizeGenericArgName(NameId: str) -> str: """ast.Name 泛型实参 → 定义端 type_arg(HandlesExprCall._resolve_generic_slice_type 的 ast.Name 分支,逐分支同构):