(fn: FuncIR, emitter: Emitter)
| 553 | |
| 554 | |
| 555 | def 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 | |
| 573 | def pointerize(decl: str, name: str) -> str: |
no test coverage detected
searching dependent graphs…