[pypy-svn] r49047 - pypy/branch/remove-extcompiler-rctypes/pypy/translator/c
cfbolz at codespeak.net
cfbolz at codespeak.net
Sat Nov 24 18:08:55 CET 2007
Author: cfbolz
Date: Sat Nov 24 18:08:55 2007
New Revision: 49047
Modified:
pypy/branch/remove-extcompiler-rctypes/pypy/translator/c/support.py
Log:
delete old commented out code
Modified: pypy/branch/remove-extcompiler-rctypes/pypy/translator/c/support.py
==============================================================================
--- pypy/branch/remove-extcompiler-rctypes/pypy/translator/c/support.py (original)
+++ pypy/branch/remove-extcompiler-rctypes/pypy/translator/c/support.py Sat Nov 24 18:08:55 2007
@@ -137,44 +137,6 @@
return '{%s}' % ', '.join(lines)
-##def gen_assignments(assignments):
-## # Generate a sequence of assignments that is possibly reordered
-## # to avoid clashes -- i.e. do the equivalent of a tuple assignment,
-## # reading all sources first, writing all targets next, but optimized
-
-## allsources = []
-## src2dest = {}
-## types = {}
-## for typename, dest, src in assignments:
-## if src != dest: # ignore 'v=v;'
-## allsources.append(src)
-## src2dest.setdefault(src, []).append(dest)
-## types[dest] = typename
-
-## for starting in allsources:
-## # starting from some starting variable, follow a chain of assignments
-## # 'vn=vn-1; ...; v3=v2; v2=v1; v1=starting;'
-## v = starting
-## srcchain = []
-## while src2dest.get(v):
-## srcchain.append(v)
-## v = src2dest[v].pop(0)
-## if v == starting:
-## break # loop
-## if not srcchain:
-## continue # already done in a previous chain
-## srcchain.reverse() # ['vn-1', ..., 'v2', 'v1', 'starting']
-## code = []
-## for pair in zip([v] + srcchain[:-1], srcchain):
-## code.append('%s = %s;' % pair)
-## if v == starting:
-## # assignment loop 'starting=vn-1; ...; v2=v1; v1=starting;'
-## typename = types[starting]
-## tmpdecl = cdecl(typename, 'tmp')
-## code.insert(0, '{ %s = %s;' % (tmpdecl, starting))
-## code[-1] = '%s = tmp; }' % (srcchain[-2],)
-## yield ' '.join(code)
-
def gen_assignments(assignments):
# Generate a sequence of assignments that is possibly reordered
# to avoid clashes -- i.e. do the equivalent of a tuple assignment,
More information about the Pypy-commit
mailing list