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.

Backports commit cd50a2564560986e865ff64fa73b59d2564076f0 from qemu
This commit is contained in:
Eric Blake 2018-02-25 20:05:13 -05:00 committed by Lioncash
parent 8ccfff95fe
commit febeea5f4b
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -1006,6 +1006,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):