[pypy-svn] r13326 - pypy/dist/pypy/annotation

arigo at codespeak.net arigo at codespeak.net
Mon Jun 13 01:28:20 CEST 2005


Author: arigo
Date: Mon Jun 13 01:28:18 2005
New Revision: 13326

Modified:
   pypy/dist/pypy/annotation/bookkeeper.py
   pypy/dist/pypy/annotation/unaryop.py
Log:
- Bug fix.
- Support for constant low-level pointers in the annotator.


Modified: pypy/dist/pypy/annotation/bookkeeper.py
==============================================================================
--- pypy/dist/pypy/annotation/bookkeeper.py	(original)
+++ pypy/dist/pypy/annotation/bookkeeper.py	Mon Jun 13 01:28:18 2005
@@ -15,6 +15,7 @@
 from pypy.interpreter.argument import Arguments, ArgErr
 from pypy.rpython.rarithmetic import r_uint
 from pypy.tool.unionfind import UnionFind
+from pypy.rpython import lltype
 
 from pypy.annotation.specialize import decide_callable
 
@@ -193,6 +194,8 @@
                 self.immutable_cache[id(x)] = result
         elif ishashable(x) and x in BUILTIN_ANALYZERS:
             result = SomeBuiltin(BUILTIN_ANALYZERS[x])
+        elif isinstance(x, lltype._ptr):
+            result = SomePtr(lltype.typeOf(x))
         elif callable(x) or isinstance(x, staticmethod): # XXX
             # maybe 'x' is a method bound to a not-yet-frozen cache?
             # fun fun fun.

Modified: pypy/dist/pypy/annotation/unaryop.py
==============================================================================
--- pypy/dist/pypy/annotation/unaryop.py	(original)
+++ pypy/dist/pypy/annotation/unaryop.py	Mon Jun 13 01:28:18 2005
@@ -445,7 +445,7 @@
                 v_lltype._defl())
 
     def simple_call(p, *args_s):
-        llargs = [annotation_to_lltype(arg_s)._example() for arg_s in args_s]
+        llargs = [annotation_to_lltype(arg_s)._defl() for arg_s in args_s]
         v = p.ll_ptrtype._example()(*llargs)
         return ll_to_annotation(v)
 



More information about the Pypy-commit mailing list