[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v9 03/17] qapi: Special case c_name() for empty type
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PATCH v9 03/17] qapi: Special case c_name() for empty type |
Date: |
Wed, 13 Jul 2016 21:50:14 -0600 |
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 <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
---
v9: new patch
---
scripts/qapi.py | 1 +
1 file changed, 1 insertion(+)
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):
--
2.5.5
- [Qemu-devel] [PATCH for-2.7 v9 00/17] qapi netdev_add introspection (post-introspection cleanups subset F), Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 03/17] qapi: Special case c_name() for empty type,
Eric Blake <=
- [Qemu-devel] [PATCH v9 02/17] qapi: Require all branches of flat union enum to be covered, Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 05/17] qapi: Add type.is_empty() helper, Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 07/17] qapi-event: Simplify visit of non-implicit data, Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 04/17] qapi: Hide tag_name data member of variants, Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 06/17] qapi: Drop useless gen_err_check(), Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 08/17] qapi: Plumb in 'boxed' to qapi generator lower levels, Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 01/17] net: use Netdev instead of NetClientOptions in client init, Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 09/17] qapi: Implement boxed types for commands/events, Eric Blake, 2016/07/13