[pypy-svn] r7486 - in pypy/trunk/src/pypy/translator: . tool/pygame
mgedmin at codespeak.net
mgedmin at codespeak.net
Sat Nov 20 10:29:30 CET 2004
Author: mgedmin
Date: Sat Nov 20 10:29:30 2004
New Revision: 7486
Modified:
pypy/trunk/src/pypy/translator/annrpython.py
pypy/trunk/src/pypy/translator/tool/pygame/flowviewer.py
Log:
Highlight blocked functions in red.
Modified: pypy/trunk/src/pypy/translator/annrpython.py
==============================================================================
--- pypy/trunk/src/pypy/translator/annrpython.py (original)
+++ pypy/trunk/src/pypy/translator/annrpython.py Sat Nov 20 10:29:30 2004
@@ -27,6 +27,7 @@
self.why_not_annotated = {} # {block: (exc_type, exc_value, traceback)}
# records the location of BlockedInference
# exceptions that blocked some blocks.
+ self.blocked_functions = {} # set of functions that have blocked blocks
self.notify = {} # {block: {factory-to-invalidate-when-done}}
self.bindingshistory = {}# map Variables to lists of SomeValues
self.binding_caused_by = {} # map Variables to Factories
@@ -121,6 +122,8 @@
if False in self.annotated.values():
for block in self.annotated:
if self.annotated[block] is False:
+ fn = self.why_not_annotated[block][1].break_at[0]
+ self.blocked_functions[fn] = True
import traceback
print '-+' * 30
print 'BLOCKED block at:',
Modified: pypy/trunk/src/pypy/translator/tool/pygame/flowviewer.py
==============================================================================
--- pypy/trunk/src/pypy/translator/tool/pygame/flowviewer.py (original)
+++ pypy/trunk/src/pypy/translator/tool/pygame/flowviewer.py Sat Nov 20 10:29:30 2004
@@ -157,9 +157,13 @@
self.name_by_object = {}
dotgen = DotGen('translator')
dotgen.emit('mclimit=15.0')
-
+
# show the call graph
functions = translator.functions
+ if translator.annotator:
+ blocked_functions = translator.annotator.blocked_functions
+ else:
+ blocked_functions = {}
highlight_functions = getattr(translator, 'highlight_functions', {}) # XXX
dotgen.emit_node('entry', fillcolor="green", shape="octagon",
label="Translator\\nEntry Point")
@@ -169,7 +173,9 @@
if class_ is not None:
name = '%s.%s' % (class_.__name__, name)
data = self.labelof(func, name)
- if func in highlight_functions:
+ if func in blocked_functions:
+ kw = {'fillcolor': 'red'}
+ elif func in highlight_functions:
kw = {'fillcolor': '#ffcccc'}
else:
kw = {}
More information about the Pypy-commit
mailing list