[pypy-svn] r15577 - pypy/dist/pypy/translator/goal
pedronis at codespeak.net
pedronis at codespeak.net
Wed Aug 3 22:21:20 CEST 2005
Author: pedronis
Date: Wed Aug 3 22:21:19 2005
New Revision: 15577
Modified:
pypy/dist/pypy/translator/goal/query.py
pypy/dist/pypy/translator/goal/translate_pypy.py
Log:
add sanity checking for method defs annotation
Modified: pypy/dist/pypy/translator/goal/query.py
==============================================================================
--- pypy/dist/pypy/translator/goal/query.py (original)
+++ pypy/dist/pypy/translator/goal/query.py Wed Aug 3 22:21:19 2005
@@ -462,6 +462,7 @@
meths.append(attr)
if meths:
withmeths.append((clsdef, meths))
+ lost = 0
for clsdef, meths in withmeths:
cls = clsdef.cls
n = 0
@@ -476,5 +477,6 @@
f = subcls.cls.__dict__.get(name)
if f:
if f not in funcs:
- print name, subcls.cls, cls, subcls.attrs.keys()
-
+ print "Lost method!", name, subcls.cls, cls, subcls.attrs.keys()
+ lost += 0
+ return lost
Modified: pypy/dist/pypy/translator/goal/translate_pypy.py
==============================================================================
--- pypy/dist/pypy/translator/goal/translate_pypy.py (original)
+++ pypy/dist/pypy/translator/goal/translate_pypy.py Wed Aug 3 22:21:19 2005
@@ -80,6 +80,8 @@
# catch TyperError to allow for post-mortem dump
from pypy.rpython.error import TyperError
+from pypy.translator.goal import query
+
# XXX this tries to make compiling faster
from pypy.translator.tool import cbuild
cbuild.enable_fast_compilation()
@@ -107,6 +109,9 @@
print 'Annotating...'
a = t.annotate(inputtypes, policy=PyPyAnnotatorPolicy())
sanity_check_exceptblocks(t)
+ lost = query.sanity_check_methods(t)
+ assert not lost, "lost methods, something gone wrong with the annotation of method defs"
+ print "*** No lost method defs."
worstblocks_topten(a, 3)
find_someobjects(t)
if a: #and not options['-no-s']:
More information about the Pypy-commit
mailing list