[gobject-introspection] scanner: Remove typedef namespace cache



commit e9e74c102b7e7181d35f5db1c2927dae07ccdb20
Author: Simon Feltman <sfeltman src gnome org>
Date:   Sat Dec 28 03:16:05 2013 -0800

    scanner: Remove typedef namespace cache
    
    Remove the caching of typedefs in Transformer._typedef_ns. This is no longer
    used due to the added _tag_ns cache which store tags rather than typedefs.
    Remove adding of callback typdefs to the typedef_ns since these were not
    being used anyhow.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=581525

 giscanner/transformer.py |   20 --------------------
 1 files changed, 0 insertions(+), 20 deletions(-)
---
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index 3aee5ec..469723f 100644
--- a/giscanner/transformer.py
+++ b/giscanner/transformer.py
@@ -109,25 +109,6 @@ class Transformer(object):
                     node.tag_name not in self._tag_ns:
                 self._tag_ns[node.tag_name] = node
 
-        # Now look through the namespace for things like
-        # typedef struct _Foo Foo;
-        # where we've never seen the struct _Foo.  Just create
-        # an empty structure for these as "disguised"
-        # If we do have a class/interface, merge fields
-        for typedef, compound in self._typedefs_ns.iteritems():
-            ns_compound = self._namespace.get(compound.name)
-            if not ns_compound:
-                ns_compound = self._namespace.get('_' + compound.name)
-            if (not ns_compound and isinstance(compound, (ast.Record, ast.Union))
-            and len(compound.fields) == 0):
-                disguised = ast.Record(compound.name, typedef, disguised=True)
-                self._namespace.append(disguised)
-            elif not ns_compound:
-                self._namespace.append(compound)
-            elif isinstance(ns_compound, (ast.Record, ast.Union)) and len(ns_compound.fields) == 0:
-                ns_compound.fields = compound.fields
-        self._typedefs_ns = None
-
         # Run through the tag namespace looking for structs that have not been
         # promoted into the main namespace. In this case we simply promote them
         # with their struct tag.
@@ -854,7 +835,6 @@ raise ValueError."""
         callback = self._create_callback(symbol)
         if not callback:
             return None
-        self._typedefs_ns[callback.name] = callback
         return callback
 
     def _parse_fields(self, symbol, compound):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]