@@ -76,10 +76,7 @@ class LoadAddressDescription(NamedTuple):
7676# Primitive ops for top level function call (such as 'builtins.list')
7777function_ops : dict [str , list [PrimitiveDescription ]] = {}
7878
79- # Legacy CallC ops for top level function call (such as 'builtins.list')
80- legacy_function_ops : dict [str , list [CFunctionDescription ]] = {}
81-
82- # CallC op for binary ops
79+ # Primitive ops for binary operations
8380binary_ops : dict [str , list [PrimitiveDescription ]] = {}
8481
8582# CallC op for unary ops
@@ -151,54 +148,6 @@ def method_op(
151148 return desc
152149
153150
154- def legacy_function_op (
155- name : str ,
156- arg_types : list [RType ],
157- return_type : RType ,
158- c_function_name : str ,
159- error_kind : int ,
160- var_arg_type : RType | None = None ,
161- truncated_type : RType | None = None ,
162- ordering : list [int ] | None = None ,
163- extra_int_constants : list [tuple [int , RType ]] | None = None ,
164- steals : StealsDescription = False ,
165- is_borrowed : bool = False ,
166- priority : int = 1 ,
167- ) -> CFunctionDescription :
168- """Define a C function call op that replaces a function call.
169-
170- NOTE: Use function_op instead for new use cases.
171-
172- This will be automatically generated by matching against the AST.
173-
174- Most arguments are similar to method_op().
175-
176- Args:
177- name: full name of the function
178- arg_types: positional argument types for which this applies
179- """
180- if extra_int_constants is None :
181- extra_int_constants = []
182- ops = legacy_function_ops .setdefault (name , [])
183- desc = CFunctionDescription (
184- name ,
185- arg_types ,
186- return_type ,
187- var_arg_type ,
188- truncated_type ,
189- c_function_name ,
190- error_kind ,
191- steals ,
192- is_borrowed ,
193- ordering ,
194- extra_int_constants ,
195- priority ,
196- is_pure = False ,
197- )
198- ops .append (desc )
199- return desc
200-
201-
202151def function_op (
203152 name : str ,
204153 arg_types : list [RType ],
0 commit comments