summaryrefslogtreecommitdiff
path: root/giscanner/introspectablepass.py
diff options
context:
space:
mode:
authorTorsten Schönfeld <kaffeetisch@gmx.de>2011-08-13 12:45:14 +0200
committerTorsten Schönfeld <kaffeetisch@gmx.de>2011-08-13 15:00:00 +0200
commitd84b7babf5adb637342492d13ab127d43317c8be (patch)
tree2bfaf7ffcf5207d9f101a1e56e0e6cac35c11711 /giscanner/introspectablepass.py
parentc47a10f867da52695a5c5b5bf7e0a22dddc0b085 (diff)
downloadgobject-introspection-d84b7babf5adb637342492d13ab127d43317c8be.tar.gz
scanner: add a moved_to property to backcompat functions
Use it to remove backcompat copies of functions that non introspectable anyway. https://bugzilla.gnome.org/show_bug.cgi?id=572408
Diffstat (limited to 'giscanner/introspectablepass.py')
-rw-r--r--giscanner/introspectablepass.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/giscanner/introspectablepass.py b/giscanner/introspectablepass.py
index 36d70b20..ebb1dedc 100644
--- a/giscanner/introspectablepass.py
+++ b/giscanner/introspectablepass.py
@@ -37,6 +37,7 @@ class IntrospectablePass(object):
self._namespace.walk(self._introspectable_callable_analysis)
self._namespace.walk(self._introspectable_callable_analysis)
self._namespace.walk(self._introspectable_pass3)
+ self._namespace.walk(self._remove_non_reachable_backcompat_copies)
def _parameter_warning(self, parent, param, text, position=None):
# Suppress VFunctions and Callbacks warnings for now
@@ -221,3 +222,12 @@ class IntrospectablePass(object):
for sig in obj.signals:
self._introspectable_callable_analysis(sig, [obj])
return True
+
+ def _remove_non_reachable_backcompat_copies(self, obj, stack):
+ if obj.skip:
+ return False
+ if (isinstance(obj, ast.Function)
+ and not obj.introspectable
+ and obj.moved_to is not None):
+ self._namespace.remove(obj)
+ return True