summaryrefslogtreecommitdiffstats
path: root/scripts/qapi/visit.py
diff options
context:
space:
mode:
authorMarkus Armbruster2019-11-20 19:25:51 +0100
committerMarkus Armbruster2020-01-14 11:01:58 +0100
commit3bef3aaec91815b75a78a4c12ca92ac3cec53faf (patch)
tree2fbba98041b5c3649d7e71f63300bc94c377cb0a /scripts/qapi/visit.py
parentqapi: Fix code generation for empty modules (diff)
downloadqemu-3bef3aaec91815b75a78a4c12ca92ac3cec53faf.tar.gz
qemu-3bef3aaec91815b75a78a4c12ca92ac3cec53faf.tar.xz
qemu-3bef3aaec91815b75a78a4c12ca92ac3cec53faf.zip
qapi: Simplify QAPISchemaModularCVisitor
Since the previous commit, QAPISchemaVisitor.visit_module() is called just once. Simplify QAPISchemaModularCVisitor accordingly. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20191120182551.23795-7-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'scripts/qapi/visit.py')
-rw-r--r--scripts/qapi/visit.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py
index c72f2bc5c0..4efce62b0c 100644
--- a/scripts/qapi/visit.py
+++ b/scripts/qapi/visit.py
@@ -285,8 +285,9 @@ class QAPISchemaGenVisitVisitor(QAPISchemaModularCVisitor):
def __init__(self, prefix):
QAPISchemaModularCVisitor.__init__(
self, prefix, 'qapi-visit', ' * Schema-defined QAPI visitors',
- __doc__)
- self._add_system_module(None, ' * Built-in QAPI visitors')
+ ' * Built-in QAPI visitors', __doc__)
+
+ def _begin_system_module(self, name):
self._genc.preamble_add(mcgen('''
#include "qemu/osdep.h"
#include "qapi/error.h"
@@ -296,8 +297,7 @@ class QAPISchemaGenVisitVisitor(QAPISchemaModularCVisitor):
#include "qapi/visitor.h"
#include "qapi/qapi-builtin-types.h"
-''',
- prefix=prefix))
+'''))
def _begin_user_module(self, name):
types = self._module_basename('qapi-types', name)