[pypy-commit] pypy reflex-support: remove now superfluous return type handling and executors' name data members
wlav
noreply at buildbot.pypy.org
Thu Mar 15 17:15:50 CET 2012
Author: Wim Lavrijsen <WLavrijsen at lbl.gov>
Branch: reflex-support
Changeset: r53677:0fdb7d8c70a2
Date: 2012-03-15 07:20 -0700
http://bitbucket.org/pypy/pypy/changeset/0fdb7d8c70a2/
Log: remove now superfluous return type handling and executors' name data
members
diff --git a/pypy/module/cppyy/executor.py b/pypy/module/cppyy/executor.py
--- a/pypy/module/cppyy/executor.py
+++ b/pypy/module/cppyy/executor.py
@@ -15,11 +15,11 @@
_immutable_ = True
libffitype = NULL
- def __init__(self, space, name, cpptype):
- self.name = name
+ def __init__(self, space, cpptype):
+ pass
def execute(self, space, cppmethod, cppthis, num_args, args):
- raise TypeError('return type not available or supported ("%s")' % self.name)
+ raise TypeError('return type not available or supported')
def execute_libffi(self, space, libffifunc, argchain):
from pypy.module.cppyy.interp_cppyy import FastCallNotPossible
@@ -240,8 +240,8 @@
_immutable_ = True
libffitype = libffi.types.pointer
- def __init__(self, space, name, cpptype):
- FunctionExecutor.__init__(self, space, name, cpptype)
+ def __init__(self, space, cpptype):
+ FunctionExecutor.__init__(self, space, cpptype)
self.cpptype = cpptype
def execute(self, space, cppmethod, cppthis, num_args, args):
@@ -309,7 +309,7 @@
# 1) full, qualified match
try:
- return _executors[name](space, "", None)
+ return _executors[name](space, None)
except KeyError:
pass
@@ -318,7 +318,7 @@
# 1a) clean lookup
try:
- return _executors[clean_name+compound](space, "", None)
+ return _executors[clean_name+compound](space, None)
except KeyError:
pass
@@ -326,7 +326,7 @@
if compound and compound[len(compound)-1] == "&":
# TODO: this does not actually work with Reflex (?)
try:
- return _executors[clean_name](space, "", None)
+ return _executors[clean_name](space, None)
except KeyError:
pass
@@ -338,19 +338,19 @@
from pypy.module.cppyy.interp_cppyy import W_CPPType
cpptype = space.interp_w(W_CPPType, cpptype, can_be_None=False)
if compound == "":
- return InstanceExecutor(space, clean_name, cpptype)
+ return InstanceExecutor(space, cpptype)
elif compound == "*" or compound == "&":
- return InstancePtrExecutor(space, clean_name, cpptype)
+ return InstancePtrExecutor(space, cpptype)
elif compound == "**" or compound == "*&":
- return InstancePtrPtrExecutor(space, clean_name, cpptype)
+ return InstancePtrPtrExecutor(space, cpptype)
elif capi.c_is_enum(clean_name):
- return UnsignedIntExecutor(space, "", None)
+ return UnsignedIntExecutor(space, None)
# 4) additional special cases
# ... none for now
# currently used until proper lazy instantiation available in interp_cppyy
- return FunctionExecutor(space, "", None)
+ return FunctionExecutor(space, None)
# raise TypeError("no clue what %s is" % name)
diff --git a/pypy/module/cppyy/interp_cppyy.py b/pypy/module/cppyy/interp_cppyy.py
--- a/pypy/module/cppyy/interp_cppyy.py
+++ b/pypy/module/cppyy/interp_cppyy.py
@@ -254,9 +254,6 @@
def is_static(self):
return self.space.wrap(isinstance(self.functions[0], CPPFunction))
- def get_returntype(self):
- return self.space.wrap(self.functions[0].executor.name)
-
@jit.unroll_safe
def call(self, w_cppinstance, args_w):
cppinstance = self.space.interp_w(W_CPPInstance, w_cppinstance, can_be_None=True)
@@ -286,7 +283,6 @@
W_CPPOverload.typedef = TypeDef(
'CPPOverload',
is_static = interp2app(W_CPPOverload.is_static, unwrap_spec=['self']),
- get_returntype = interp2app(W_CPPOverload.get_returntype, unwrap_spec=['self']),
call = interp2app(W_CPPOverload.call, unwrap_spec=['self', W_Root, 'args_w']),
)
More information about the pypy-commit
mailing list