[pypy-svn] r14462 - pypy/dist/pypy/translator/llvm2

pedronis at codespeak.net pedronis at codespeak.net
Sun Jul 10 03:20:45 CEST 2005


Author: pedronis
Date: Sun Jul 10 03:20:44 2005
New Revision: 14462

Modified:
   pypy/dist/pypy/translator/llvm2/database.py
   pypy/dist/pypy/translator/llvm2/funcnode.py
Log:
fix. Trusting names instead of functions' identity is a bit fragile.



Modified: pypy/dist/pypy/translator/llvm2/database.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/database.py	(original)
+++ pypy/dist/pypy/translator/llvm2/database.py	Sun Jul 10 03:20:44 2005
@@ -89,7 +89,8 @@
         type_ = lltype.typeOf(value)
         node = None
         if isinstance(type_, lltype.FuncType):
-            if ((not hasattr(value, "graph")) or value.graph is None) and value._callable:
+            if value._callable and (not hasattr(value, "graph") or value.graph is None 
+                                    or getattr(value._callable, "suggested_primitive", False)):
                 node = ExternalFuncNode(self, value)
             else:
                 node = FuncNode(self, value)

Modified: pypy/dist/pypy/translator/llvm2/funcnode.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/funcnode.py	(original)
+++ pypy/dist/pypy/translator/llvm2/funcnode.py	Sun Jul 10 03:20:44 2005
@@ -167,7 +167,7 @@
     def __init__(self, db, value):
         self.db = db
         self.value = value
-        self.ref = "%" + value._name
+        self.ref = "%" + value._callable.__name__
 
     def setup(self):
         self._issetup = True



More information about the Pypy-commit mailing list