Author: Armin Rigo <ar...@tunes.org>
Branch: 
Changeset: r77976:8265e76a2734
Date: 2015-06-09 08:18 +0100
http://bitbucket.org/pypy/pypy/changeset/8265e76a2734/

Log:    Remove some very old code that is not useful any more (at least I
        couldn't find a test failing because of that, and translation still
        seems to work).

diff --git a/rpython/translator/c/database.py b/rpython/translator/c/database.py
--- a/rpython/translator/c/database.py
+++ b/rpython/translator/c/database.py
@@ -45,7 +45,6 @@
         self.delayedfunctionptrs = []
         self.completedcontainers = 0
         self.containerstats = {}
-        self.externalfuncs = {}
         self.helper2ptr = {}
 
         # late_initializations is for when the value you want to
diff --git a/rpython/translator/c/extfunc.py b/rpython/translator/c/extfunc.py
--- a/rpython/translator/c/extfunc.py
+++ b/rpython/translator/c/extfunc.py
@@ -62,24 +62,6 @@
                 yield (fname, graph)
 
 
-def predeclare_extfuncs(db, rtyper):
-    modules = {}
-    def module_name(c_name):
-        frags = c_name[3:].split('_')
-        if frags[0] == '':
-            return '_' + frags[1]
-        else:
-            return frags[0]
-
-    for func, funcobj in db.externalfuncs.items():
-        # construct a define LL_NEED_<modname> to make it possible to isolate 
in-development externals and headers
-        modname = module_name(func)
-        if modname not in modules:
-            modules[modname] = True
-            yield 'LL_NEED_%s' % modname.upper(), 1
-        funcptr = funcobj._as_ptr()
-        yield func, funcptr
-
 def predeclare_exception_data(db, rtyper):
     # Exception-related types and constants
     exceptiondata = rtyper.exceptiondata
@@ -112,7 +94,6 @@
     for fn in [predeclare_common_types,
                predeclare_utility_functions,
                predeclare_exception_data,
-               predeclare_extfuncs,
                ]:
         for t in fn(db, rtyper):
             yield t
@@ -122,7 +103,6 @@
     for fn in [predeclare_common_types,
                predeclare_utility_functions,
                predeclare_exception_data,
-               predeclare_extfuncs,
                ]:
         for t in fn(db, rtyper):
             yield t[1]
diff --git a/rpython/translator/c/node.py b/rpython/translator/c/node.py
--- a/rpython/translator/c/node.py
+++ b/rpython/translator/c/node.py
@@ -915,15 +915,8 @@
     return [FunctionCodeGenerator(graph, db)]
 
 def select_function_code_generators(fnobj, db, functionname):
-    # XXX this logic is completely broken nowadays
-    #     _external_name does not mean that this is done oldstyle
     sandbox = db.need_sandboxing(fnobj)
-    if hasattr(fnobj, '_external_name'):
-        if sandbox:
-            return sandbox_stub(fnobj, db)
-        db.externalfuncs[fnobj._external_name] = fnobj
-        return []
-    elif hasattr(fnobj, 'graph'):
+    if hasattr(fnobj, 'graph'):
         if sandbox and sandbox != "if_external":
             # apply the sandbox transformation
             return sandbox_transform(fnobj, db)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to