[pypy-commit] pypy ClassRepr: Use only the annotator, not the rtyper, in perform_normalizations()

rlamy noreply at buildbot.pypy.org
Tue Oct 14 01:27:47 CEST 2014


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: ClassRepr
Changeset: r73937:f66d6863ef18
Date: 2014-10-14 00:27 +0100
http://bitbucket.org/pypy/pypy/changeset/f66d6863ef18/

Log:	Use only the annotator, not the rtyper, in perform_normalizations()

diff --git a/rpython/rtyper/annlowlevel.py b/rpython/rtyper/annlowlevel.py
--- a/rpython/rtyper/annlowlevel.py
+++ b/rpython/rtyper/annlowlevel.py
@@ -250,7 +250,7 @@
         rtyper = self.rtyper
         translator = rtyper.annotator.translator
         original_graph_count = len(translator.graphs)
-        perform_normalizations(rtyper)
+        perform_normalizations(rtyper.annotator)
         for r in self.delayedreprs:
             r.set_setup_delayed(False)
         rtyper.call_all_setups()
diff --git a/rpython/rtyper/normalizecalls.py b/rpython/rtyper/normalizecalls.py
--- a/rpython/rtyper/normalizecalls.py
+++ b/rpython/rtyper/normalizecalls.py
@@ -216,12 +216,12 @@
 
 # ____________________________________________________________
 
-def merge_classpbc_getattr_into_classdef(rtyper):
+def merge_classpbc_getattr_into_classdef(annotator):
     # code like 'some_class.attr' will record an attribute access in the
     # PBC access set of the family of classes of 'some_class'.  If the classes
     # have corresponding ClassDefs, they are not updated by the annotator.
     # We have to do it now.
-    all_families = rtyper.annotator.bookkeeper.classpbc_attr_families
+    all_families = annotator.bookkeeper.classpbc_attr_families
     for attrname, access_sets in all_families.items():
         for access_set in access_sets.infos():
             descs = access_set.descs
@@ -386,13 +386,13 @@
 
 # ____________________________________________________________
 
-def perform_normalizations(rtyper):
-    create_class_constructors(rtyper.annotator)
-    rtyper.annotator.frozen += 1
+def perform_normalizations(annotator):
+    create_class_constructors(annotator)
+    annotator.frozen += 1
     try:
-        normalize_call_familes(rtyper.annotator)
-        merge_classpbc_getattr_into_classdef(rtyper)
-        assign_inheritance_ids(rtyper.annotator)
+        normalize_call_familes(annotator)
+        merge_classpbc_getattr_into_classdef(annotator)
+        assign_inheritance_ids(annotator)
     finally:
-        rtyper.annotator.frozen -= 1
-    create_instantiate_functions(rtyper.annotator)
+        annotator.frozen -= 1
+    create_instantiate_functions(annotator)
diff --git a/rpython/rtyper/rtyper.py b/rpython/rtyper/rtyper.py
--- a/rpython/rtyper/rtyper.py
+++ b/rpython/rtyper/rtyper.py
@@ -173,7 +173,7 @@
 
         # first make sure that all functions called in a group have exactly
         # the same signature, by hacking their flow graphs if needed
-        perform_normalizations(self)
+        perform_normalizations(self.annotator)
         self.exceptiondata.finish(self)
 
         # new blocks can be created as a result of specialize_block(), so


More information about the pypy-commit mailing list