(
builder: IRBuilder, fitem: FuncDef, callable_class_decl: FuncDecl, dispatch_name: str
)
| 1074 | |
| 1075 | |
| 1076 | def generate_dispatch_glue_native_function( |
| 1077 | builder: IRBuilder, fitem: FuncDef, callable_class_decl: FuncDecl, dispatch_name: str |
| 1078 | ) -> FuncIR: |
| 1079 | line = fitem.line |
| 1080 | builder.enter() |
| 1081 | # We store the callable class in the globals dict for this function |
| 1082 | callable_class = builder.load_global_str(dispatch_name, line) |
| 1083 | decl = builder.mapper.func_to_decl[fitem] |
| 1084 | arg_info = get_args(builder, decl.sig.args, line) |
| 1085 | args = [callable_class] + arg_info.args |
| 1086 | arg_kinds = [ArgKind.ARG_POS] + arg_info.arg_kinds |
| 1087 | arg_names = arg_info.arg_names |
| 1088 | arg_names.insert(0, "self") |
| 1089 | ret_val = builder.builder.call(callable_class_decl, args, arg_kinds, arg_names, line) |
| 1090 | builder.add(Return(ret_val)) |
| 1091 | arg_regs, _, blocks, _, fn_info = builder.leave() |
| 1092 | return FuncIR(decl, arg_regs, blocks) |
| 1093 | |
| 1094 | |
| 1095 | def generate_singledispatch_callable_class_ctor(builder: IRBuilder) -> None: |
no test coverage detected
searching dependent graphs…