Commit 377e4514 authored by Stefan Behnel's avatar Stefan Behnel

cleanup, avoid allocating a Python string for the self argument

parent 74e4ce90
...@@ -1356,9 +1356,6 @@ class DefNode(FuncDefNode): ...@@ -1356,9 +1356,6 @@ class DefNode(FuncDefNode):
if name_declarator.cname: if name_declarator.cname:
error(self.pos, error(self.pos,
"Python function argument cannot have C name specification") "Python function argument cannot have C name specification")
arg.name_entry = env.get_string_const(
arg.name, identifier = True)
env.add_py_string(arg.name_entry, identifier = True)
arg.type = type.as_argument_type() arg.type = type.as_argument_type()
arg.hdr_type = None arg.hdr_type = None
arg.needs_conversion = 0 arg.needs_conversion = 0
...@@ -1490,6 +1487,10 @@ class DefNode(FuncDefNode): ...@@ -1490,6 +1487,10 @@ class DefNode(FuncDefNode):
arg.entry = self.declare_argument(env, arg) arg.entry = self.declare_argument(env, arg)
arg.entry.used = 1 arg.entry.used = 1
arg.entry.is_self_arg = arg.is_self_arg arg.entry.is_self_arg = arg.is_self_arg
if not arg.is_self_arg:
arg.name_entry = env.get_string_const(
arg.name, identifier = True)
env.add_py_string(arg.name_entry, identifier = True)
if arg.hdr_type: if arg.hdr_type:
if arg.is_self_arg or \ if arg.is_self_arg or \
(arg.type.is_extension_type and not arg.hdr_type.is_extension_type): (arg.type.is_extension_type and not arg.hdr_type.is_extension_type):
......
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