Create a one-off CallC op that can't be automatically generated from the AST. Most arguments are similar to method_op().
(
arg_types: list[RType],
return_type: RType,
c_function_name: str,
error_kind: int,
var_arg_type: RType | None = None,
truncated_type: RType | None = None,
ordering: list[int] | None = None,
extra_int_constants: list[tuple[int, RType]] | None = None,
steals: StealsDescription = False,
is_borrowed: bool = False,
*,
is_pure: bool = False,
returns_null: bool = False,
)
| 259 | |
| 260 | |
| 261 | def custom_op( |
| 262 | arg_types: list[RType], |
| 263 | return_type: RType, |
| 264 | c_function_name: str, |
| 265 | error_kind: int, |
| 266 | var_arg_type: RType | None = None, |
| 267 | truncated_type: RType | None = None, |
| 268 | ordering: list[int] | None = None, |
| 269 | extra_int_constants: list[tuple[int, RType]] | None = None, |
| 270 | steals: StealsDescription = False, |
| 271 | is_borrowed: bool = False, |
| 272 | *, |
| 273 | is_pure: bool = False, |
| 274 | returns_null: bool = False, |
| 275 | ) -> CFunctionDescription: |
| 276 | """Create a one-off CallC op that can't be automatically generated from the AST. |
| 277 | |
| 278 | Most arguments are similar to method_op(). |
| 279 | """ |
| 280 | if extra_int_constants is None: |
| 281 | extra_int_constants = [] |
| 282 | return CFunctionDescription( |
| 283 | "<custom>", |
| 284 | arg_types, |
| 285 | return_type, |
| 286 | var_arg_type, |
| 287 | truncated_type, |
| 288 | c_function_name, |
| 289 | error_kind, |
| 290 | steals, |
| 291 | is_borrowed, |
| 292 | ordering, |
| 293 | extra_int_constants, |
| 294 | 0, |
| 295 | is_pure=is_pure, |
| 296 | returns_null=returns_null, |
| 297 | dependencies=None, |
| 298 | ) |
| 299 | |
| 300 | |
| 301 | def custom_primitive_op( |
no test coverage detected
searching dependent graphs…