Commit 2bb2f5e5 authored by Vitja Makarov's avatar Vitja Makarov

DefNode: Use specialized signature insted of generic PyObject

parent 1e94a834
......@@ -3948,9 +3948,6 @@ class InlinedDefNodeCallNode(CallNode):
func_type = self.function.def_node
for arg, proto_arg in zip(self.args, func_type.args):
if arg.type.is_pyobject:
if proto_arg.hdr_type:
arg_code.append(arg.result_as(proto_arg.hdr_type))
else:
arg_code.append(arg.result_as(proto_arg.type))
else:
arg_code.append(arg.result())
......
......@@ -2989,10 +2989,6 @@ class DefNode(FuncDefNode):
arg.entry.is_arg = 1
arg.entry.used = 1
arg.entry.is_self_arg = arg.is_self_arg
if arg.hdr_type:
if arg.is_self_arg or arg.is_type_arg or \
(arg.type.is_extension_type and not arg.hdr_type.is_extension_type):
arg.entry.is_declared_generic = 1
self.declare_python_arg(env, self.star_arg)
self.declare_python_arg(env, self.starstar_arg)
......@@ -3068,9 +3064,6 @@ class DefNode(FuncDefNode):
cname = entry.original_cname
else:
cname = entry.cname
if arg.is_self_arg or arg.is_type_arg or entry.is_declared_generic:
decl = "PyObject *%s" % cname
else:
decl = entry.type.declaration_code(cname)
if entry.cf_used:
return decl
......@@ -3157,6 +3150,9 @@ class DefNodeWrapper(FuncDefNode):
if self.signature.has_dummy_arg:
args.append(Naming.self_cname)
for arg in self.args:
if arg.hdr_type:
args.append(arg.type.cast_code(arg.entry.cname))
else:
args.append(arg.entry.cname)
if self.star_arg:
args.append(self.star_arg.entry.cname)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment