MCPcopy Index your code
hub / github.com/python/mypy / generate_function_declaration

Function generate_function_declaration

mypyc/codegen/emitmodule.py:555–570  ·  view source on GitHub ↗
(fn: FuncIR, emitter: Emitter)

Source from the content-addressed store, hash-verified

553
554
555def generate_function_declaration(fn: FuncIR, emitter: Emitter) -> None:
556 emitter.context.declarations[emitter.native_function_name(fn.decl)] = HeaderDeclaration(
557 f"{native_function_header(fn.decl, emitter)};", needs_export=True
558 )
559 if fn.name != TOP_LEVEL_NAME and not fn.internal:
560 # needs_export=True so Python-wrapper (CPyPy_) symbols are reachable from
561 # other groups via the export table — needed for cross-group inherited
562 # __init__ / __new__ slot dispatch under `separate=True`.
563 if is_fastcall_supported(fn, emitter.capi_version):
564 emitter.context.declarations[PREFIX + fn.cname(emitter.names)] = HeaderDeclaration(
565 f"{wrapper_function_header(fn, emitter.names)};", needs_export=True
566 )
567 else:
568 emitter.context.declarations[PREFIX + fn.cname(emitter.names)] = HeaderDeclaration(
569 f"{legacy_wrapper_function_header(fn, emitter.names)};", needs_export=True
570 )
571
572
573def pointerize(decl: str, name: str) -> str:

Callers 1

Calls 7

HeaderDeclarationClass · 0.90
native_function_headerFunction · 0.90
wrapper_function_headerFunction · 0.90
is_fastcall_supportedFunction · 0.85
native_function_nameMethod · 0.80
cnameMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…