[pypy-svn] r29909 - pypy/dist/pypy/translator/c
arigo at codespeak.net
arigo at codespeak.net
Sun Jul 9 19:00:52 CEST 2006
Author: arigo
Date: Sun Jul 9 19:00:51 2006
New Revision: 29909
Modified:
pypy/dist/pypy/translator/c/database.py
pypy/dist/pypy/translator/c/funcgen.py
Log:
Very very minor fix.
Modified: pypy/dist/pypy/translator/c/database.py
==============================================================================
--- pypy/dist/pypy/translator/c/database.py (original)
+++ pypy/dist/pypy/translator/c/database.py Sun Jul 9 19:00:51 2006
@@ -21,6 +21,7 @@
class LowLevelDatabase(object):
stacklesstransformer = None
+ gctransformer = None
def __init__(self, translator=None, standalone=False, gcpolicy=None, thread_enabled=False):
self.translator = translator
@@ -69,7 +70,8 @@
else:
self.exctransformer = ExceptionTransformer(translator)
self.gcpolicy = gcpolicy(self, thread_enabled)
- self.gctransformer = gcpolicy.transformerclass(translator)
+ if translator is not None:
+ self.gctransformer = gcpolicy.transformerclass(translator)
self.completed = False
def gettypedefnode(self, T, varlength=1):
@@ -271,10 +273,12 @@
# steps with calls to the next 'finish' function from the following
# list:
finish_callbacks = []
- finish_callbacks.append(self.gctransformer.finish_helpers)
+ if self.gctransformer:
+ finish_callbacks.append(self.gctransformer.finish_helpers)
if self.stacklesstransformer:
finish_callbacks.append(self.stacklesstransformer.finish)
- finish_callbacks.append(self.gctransformer.finish_tables)
+ if self.gctransformer:
+ finish_callbacks.append(self.gctransformer.finish_tables)
def add_dependencies(newdependencies):
for value in newdependencies:
Modified: pypy/dist/pypy/translator/c/funcgen.py
==============================================================================
--- pypy/dist/pypy/translator/c/funcgen.py (original)
+++ pypy/dist/pypy/translator/c/funcgen.py Sun Jul 9 19:00:51 2006
@@ -49,7 +49,8 @@
if self.db.exctransformer:
self.db.exctransformer.create_exception_handling(self.graph)
# apply the gc transformation
- self.db.gctransformer.transform_graph(self.graph)
+ if self.db.gctransformer:
+ self.db.gctransformer.transform_graph(self.graph)
#self.graph.show()
self.collect_var_and_types()
@@ -104,7 +105,7 @@
def patch_graph(self, copy_graph):
graph = self.graph
- if self.db.gctransformer.inline:
+ if self.db.gctransformer and self.db.gctransformer.inline:
if copy_graph:
graph = copygraph(graph, shallow=True)
self.db.gctransformer.inline_helpers(graph)
More information about the Pypy-commit
mailing list