mirror of
https://github.com/yuzu-mirror/unicorn.git
synced 2026-04-05 06:25:33 +00:00
qapi: Make code-generating visitors use QAPIGen more
The use of QAPIGen is rather shallow so far: most of the output accumulation is not converted. Take the next step: convert output accumulation in the code-generating visitor classes. Helper functions outside these classes are not converted. Backports commit 71b3f0459c460c9e16a47372ccddbfa6e2c7aadf from qemu
This commit is contained in:
parent
58246ea9d9
commit
b882e705dc
4 changed files with 102 additions and 122 deletions
|
|
@ -2054,3 +2054,14 @@ class QAPIGenDoc(QAPIGen):
|
|||
return (QAPIGen._top(self, fname)
|
||||
+ '@c AUTOMATICALLY GENERATED, DO NOT MODIFY\n\n')
|
||||
|
||||
class QAPISchemaMonolithicCVisitor(QAPISchemaVisitor):
|
||||
|
||||
def __init__(self, prefix, what, blurb, pydoc):
|
||||
self._prefix = prefix
|
||||
self._what = what
|
||||
self._genc = QAPIGenC(blurb, pydoc)
|
||||
self._genh = QAPIGenH(blurb, pydoc)
|
||||
|
||||
def write(self, output_dir):
|
||||
self._genc.write(output_dir, self._prefix + self._what + '.c')
|
||||
self._genh.write(output_dir, self._prefix + self._what + '.h')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue