diff options
author | Markus Armbruster | 2019-02-14 16:22:36 +0100 |
---|---|---|
committer | Markus Armbruster | 2019-02-18 14:44:04 +0100 |
commit | dcac64711ea906e844ae60a5927e5580f7252c1e (patch) | |
tree | c301702ab4cff7e031d6c8638a7fd9d1a031a57d /scripts/qapi/events.py | |
parent | qapi: Fix up documentation for recent commit a95291007b2 (diff) | |
download | qemu-dcac64711ea906e844ae60a5927e5580f7252c1e.tar.gz qemu-dcac64711ea906e844ae60a5927e5580f7252c1e.tar.xz qemu-dcac64711ea906e844ae60a5927e5580f7252c1e.zip |
qapi: Clean up modular built-in code generation a bit
We neglect to call .visit_module() for the special module we use for
built-ins. Harmless, but clean it up anyway. The
tests/qapi-schema/*.out now show the built-in module as 'module None'.
Subclasses of QAPISchemaModularCVisitor need to ._add_module() this
special module to enable code generation for built-ins. When this
hasn't been done, QAPISchemaModularCVisitor.visit_module() does
nothing for the special module. That looks like built-ins could
accidentally be generated into the wrong module when a subclass
neglects to call ._add_module(). Can't happen, because built-ins are
all visited before any other module. But that's non-obvious. Switch
off code generation explicitly.
Rename QAPISchemaModularCVisitor._begin_module() to
._begin_user_module().
New QAPISchemaModularCVisitor._is_builtin_module(), for clarity.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20190214152251.2073-4-armbru@redhat.com>
Diffstat (limited to 'scripts/qapi/events.py')
-rw-r--r-- | scripts/qapi/events.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py index d86a2d2b3e..6f39cf8196 100644 --- a/scripts/qapi/events.py +++ b/scripts/qapi/events.py @@ -142,7 +142,7 @@ class QAPISchemaGenEventVisitor(QAPISchemaModularCVisitor): self._event_enum_members = [] self._event_emit_name = c_name(prefix + 'qapi_event_emit') - def _begin_module(self, name): + def _begin_user_module(self, name): types = self._module_basename('qapi-types', name) visit = self._module_basename('qapi-visit', name) self._genc.add(mcgen(''' |