aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi-types.py
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-10-16 17:13:05 +0100
committerPeter Maydell <peter.maydell@linaro.org>2015-10-16 17:13:05 +0100
commit61f7901bb8a7f2f2503b5b025c4c33dbeac9cf5b (patch)
tree7547525c2c608dab7c3639028fc80c3ffa8cb715 /scripts/qapi-types.py
parente95bdb4341c36ee158ff9dda4ade3f94405c69ce (diff)
parent99df5289d8c7ebf373c3570d8fba3f3a73360281 (diff)
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2015-10-15' into staging
QAPI patches # gpg: Signature made Thu 15 Oct 2015 07:40:46 BST using RSA key ID EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" * remotes/armbru/tags/pull-qapi-2015-10-15: qapi: Track location that created an implicit type qapi: Create simple union type member earlier qapi: Lazy creation of array types qapi: Don't use info as witness of implicit object type qapi: Drop redundant args-member-array test qapi: Drop redundant flat-union-reverse-define test qapi: Drop redundant returns-int test qapi: Move empty-enum to compile-time test qapi: Drop redundant alternate-good test qapi: Prepare for errors during check() qapi: Use predicate callback to determine visit filtering qapi: Fix regression with '-netdev help' Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/qapi-types.py')
-rw-r--r--scripts/qapi-types.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index d405f8d670..4fe618ef3c 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -233,6 +233,11 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
self.decl = self._btin + self.decl
self._btin = None
+ def visit_needed(self, entity):
+ # Visit everything except implicit objects
+ return not (entity.is_implicit() and
+ isinstance(entity, QAPISchemaObjectType))
+
def _gen_type_cleanup(self, name):
self.decl += gen_type_cleanup_decl(name)
self.defn += gen_type_cleanup(name)
@@ -254,14 +259,13 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
self._gen_type_cleanup(name)
def visit_object_type(self, name, info, base, members, variants):
- if info:
- self._fwdecl += gen_fwd_object_or_array(name)
- if variants:
- assert not members # not implemented
- self.decl += gen_union(name, base, variants)
- else:
- self.decl += gen_struct(name, base, members)
- self._gen_type_cleanup(name)
+ self._fwdecl += gen_fwd_object_or_array(name)
+ if variants:
+ assert not members # not implemented
+ self.decl += gen_union(name, base, variants)
+ else:
+ self.decl += gen_struct(name, base, members)
+ self._gen_type_cleanup(name)
def visit_alternate_type(self, name, info, variants):
self._fwdecl += gen_fwd_object_or_array(name)