aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-07-13 21:50:14 -0600
committerMarkus Armbruster <armbru@redhat.com>2016-07-19 13:21:08 +0200
commitcd50a2564560986e865ff64fa73b59d2564076f0 (patch)
treee2e43efe9482f495760aff3b968fc69a817ddb0c /scripts
parentd0b182392d0281ef780e3effcb82677a004f1f97 (diff)
downloadqemu-cd50a2564560986e865ff64fa73b59d2564076f0.zip
qemu-cd50a2564560986e865ff64fa73b59d2564076f0.tar.gz
qemu-cd50a2564560986e865ff64fa73b59d2564076f0.tar.bz2
qapi: Special case c_name() for empty type
Commit 7ce106a rendered QAPISchemaObjectType.c_name() redundant, since it now does nothing more than delegate to its superclass. However, rather than deleting it, we can restore part of the assertion that was removed in that commit, to prove that we never emit the empty type directly in generated code, but rather special-case it as a built-in that makes other aspects of code generation easier to reason about. Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1468468228-27827-4-git-send-email-eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qapi.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/qapi.py b/scripts/qapi.py
index 0635bbb..68ee319 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -1000,6 +1000,7 @@ class QAPISchemaObjectType(QAPISchemaType):
return self.name.startswith('q_')
def c_name(self):
+ assert self.name != 'q_empty'
return QAPISchemaType.c_name(self)
def c_type(self):