From e9e74c102b7e7181d35f5db1c2927dae07ccdb20 Mon Sep 17 00:00:00 2001 From: Simon Feltman Date: Sat, 28 Dec 2013 03:16:05 -0800 Subject: 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 file changed, 20 deletions(-) diff --git a/giscanner/transformer.py b/giscanner/transformer.py index 3aee5ec6..469723ff 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): -- cgit v1.2.1