diff options
author | Markus Armbruster | 2018-02-26 23:29:21 +0100 |
---|---|---|
committer | Eric Blake | 2018-03-02 20:14:10 +0100 |
commit | cdb6610ae4283720037bae2af1f78bd40eb5fe71 (patch) | |
tree | a32a7d2a3575d8438f3e88eccd6832ff55fdad0a /.gitignore | |
parent | qapi: Make code-generating visitors use QAPIGen more (diff) | |
download | qemu-cdb6610ae4283720037bae2af1f78bd40eb5fe71.tar.gz qemu-cdb6610ae4283720037bae2af1f78bd40eb5fe71.tar.xz qemu-cdb6610ae4283720037bae2af1f78bd40eb5fe71.zip |
qapi/types qapi/visit: Generate built-in stuff into separate files
Linking code from multiple separate QAPI schemata into the same
program is possible, but involves some weirdness around built-in
types:
* We generate code for built-in types into .c only with option
--builtins. The user is responsible for generating code for exactly
one QAPI schema per program with --builtins.
* We generate code for built-in types into .h regardless of
--builtins, but guarded by #ifndef QAPI_VISIT_BUILTIN. Because all
copies of this code are exactly the same, including any combination
of these headers works.
Replace this contraption by something more conventional: generate code
for built-in types into their very own files: qapi-builtin-types.c,
qapi-builtin-visit.c, qapi-builtin-types.h, qapi-builtin-visit.h, but
only with --builtins. Obey --output-dir, but ignore --prefix for
them.
Make qapi-types.h include qapi-builtin-types.h. With multiple
schemata you now have multiple qapi-types.[ch], but only one
qapi-builtin-types.[ch]. Same for qapi-visit.[ch] and
qapi-builtin-visit.[ch].
Bonus: if all you need is built-in stuff, you can include a much
smaller header. To be exploited shortly.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180211093607.27351-21-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
[eblake: fix octal constant for python 3]
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to '.gitignore')
-rw-r--r-- | .gitignore | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore index 7d783e6e66..9477a08b6b 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,8 @@ /qga/qapi-generated /qapi-generated /qapi-gen-timestamp +/qapi-builtin-types.[ch] +/qapi-builtin-visit.[ch] /qapi-types.[ch] /qapi-visit.[ch] /qapi-event.[ch] |