mbox series

[0/9] qapi: untie 'if' conditions from C preprocessor

Message ID 20201015165255.1573897-1-marcandre.lureau@redhat.com
Headers show
Series qapi: untie 'if' conditions from C preprocessor | expand

Message

Marc-André Lureau Oct. 15, 2020, 4:52 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>


Hi,

This series makes the 'if' conditions less liberal, by formalizing a simple
expression tree based on bare boolean logic of configure option identifiers.

(this will allow to express conditions in Rust in my QAPI-Rust PoC series, but
it is worth a standalone post)

This is based on John Snow QAPI cleanup branch:
https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt6

thanks

Marc-André Lureau (9):
  qapi: replace List[str] by IfCond
  qapi: move gen_if/gen_endif to IfCond
  qapi: start building an 'if' predicate tree
  qapi: introduce IfPredicateList and IfAny
  qapi: add IfNot
  qapi: normalize 'if' condition to IfPredicate
  qapi: convert 'if' C expressions to literal form
  qapi: make 'if' condition strings simple identifiers
  docs: update the documentation about schema configuration

 docs/devel/qapi-code-gen.txt                  |  32 ++---
 docs/sphinx/qapidoc.py                        |   6 +-
 qapi/block-core.json                          |  16 +--
 qapi/char.json                                |   8 +-
 qapi/machine-target.json                      |  28 +++--
 qapi/migration.json                           |  10 +-
 qapi/misc-target.json                         |  35 ++++--
 qapi/ui.json                                  |  48 ++++----
 scripts/qapi/commands.py                      |   4 +-
 scripts/qapi/common.py                        | 113 +++++++++++++++---
 scripts/qapi/events.py                        |   4 +-
 scripts/qapi/expr.py                          |  55 +++++----
 scripts/qapi/gen.py                           |  15 ++-
 scripts/qapi/introspect.py                    |  27 ++---
 scripts/qapi/schema.py                        |  91 +++++++-------
 scripts/qapi/types.py                         |  33 +++--
 scripts/qapi/visit.py                         |  23 ++--
 .../alternate-branch-if-invalid.err           |   2 +-
 tests/qapi-schema/bad-if-empty.err            |   2 +-
 tests/qapi-schema/bad-if-list.err             |   2 +-
 tests/qapi-schema/bad-if.err                  |   3 +-
 tests/qapi-schema/bad-if.json                 |   2 +-
 tests/qapi-schema/doc-good.json               |   6 +-
 tests/qapi-schema/doc-good.out                |  12 +-
 tests/qapi-schema/enum-if-invalid.err         |   3 +-
 tests/qapi-schema/features-if-invalid.err     |   2 +-
 tests/qapi-schema/features-missing-name.json  |   2 +-
 tests/qapi-schema/qapi-schema-test.json       |  55 +++++----
 tests/qapi-schema/qapi-schema-test.out        |  63 +++++-----
 .../qapi-schema/struct-member-if-invalid.err  |   2 +-
 tests/qapi-schema/union-branch-if-invalid.err |   2 +-
 tests/test-qmp-cmds.c                         |   1 +
 32 files changed, 423 insertions(+), 284 deletions(-)

-- 
2.28.0