Define a C function call op that replaces a function call. This will be automatically generated by matching against the AST. Most arguments are similar to method_op(). Args: name: full name of the function arg_types: positional argument types for which this applies
(
name: str,
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,
priority: int = 1,
experimental: bool = False,
dependencies: list[Dependency] | None = None,
)
| 160 | |
| 161 | |
| 162 | def function_op( |
| 163 | name: str, |
| 164 | arg_types: list[RType], |
| 165 | return_type: RType, |
| 166 | c_function_name: str, |
| 167 | error_kind: int, |
| 168 | var_arg_type: RType | None = None, |
| 169 | truncated_type: RType | None = None, |
| 170 | ordering: list[int] | None = None, |
| 171 | extra_int_constants: list[tuple[int, RType]] | None = None, |
| 172 | steals: StealsDescription = False, |
| 173 | is_borrowed: bool = False, |
| 174 | priority: int = 1, |
| 175 | experimental: bool = False, |
| 176 | dependencies: list[Dependency] | None = None, |
| 177 | ) -> PrimitiveDescription: |
| 178 | """Define a C function call op that replaces a function call. |
| 179 | |
| 180 | This will be automatically generated by matching against the AST. |
| 181 | |
| 182 | Most arguments are similar to method_op(). |
| 183 | |
| 184 | Args: |
| 185 | name: full name of the function |
| 186 | arg_types: positional argument types for which this applies |
| 187 | """ |
| 188 | if extra_int_constants is None: |
| 189 | extra_int_constants = [] |
| 190 | ops = function_ops.setdefault(name, []) |
| 191 | desc = PrimitiveDescription( |
| 192 | name, |
| 193 | arg_types, |
| 194 | return_type, |
| 195 | var_arg_type=var_arg_type, |
| 196 | truncated_type=truncated_type, |
| 197 | c_function_name=c_function_name, |
| 198 | error_kind=error_kind, |
| 199 | steals=steals, |
| 200 | is_borrowed=is_borrowed, |
| 201 | ordering=ordering, |
| 202 | extra_int_constants=extra_int_constants, |
| 203 | priority=priority, |
| 204 | is_pure=False, |
| 205 | experimental=experimental, |
| 206 | dependencies=dependencies, |
| 207 | ) |
| 208 | ops.append(desc) |
| 209 | return desc |
| 210 | |
| 211 | |
| 212 | def binary_op( |
no test coverage detected
searching dependent graphs…