mirror of
https://github.com/yuzu-emu/unicorn
synced 2024-11-24 06:18:08 +00:00
qapi/events: generate event enum in main module
The event generator produces an enum, and put it in the last visited module. It fits better in the main module, since it's the set of all visited events, from all modules. Backports commit f030ffd39d6c1ea8fff281be5e4b19c819d7ce10 from qemu
This commit is contained in:
parent
e973b88d32
commit
6069bb69a7
1 changed files with 3 additions and 2 deletions
|
@ -180,8 +180,9 @@ class QAPISchemaGenEventVisitor(QAPISchemaModularCVisitor):
|
|||
types=types))
|
||||
|
||||
def visit_end(self):
|
||||
self._genh.add(gen_enum(self._enum_name, self._event_names))
|
||||
self._genc.add(gen_enum_lookup(self._enum_name, self._event_names))
|
||||
(genc, genh) = self._module[self._main_module]
|
||||
genh.add(gen_enum(self._enum_name, self._event_names))
|
||||
genc.add(gen_enum_lookup(self._enum_name, self._event_names))
|
||||
|
||||
def visit_event(self, name, info, arg_type, boxed):
|
||||
self._genh.add(gen_event_send_decl(name, arg_type, boxed))
|
||||
|
|
Loading…
Reference in a new issue