unicorn/qemu/scripts
Eric Blake b19cd2bd9a
qapi: Better error messages for duplicated expressions
The previous commit demonstrated that the generator overlooked
duplicate expressions:
- a complex type or command reusing a built-in type name
- redeclaration of a type name, whether by the same or different
metatype
- redeclaration of a command or event
- collision of a type with implicit 'Kind' enum for a union
- collision with an implicit MAX enum constant

Since the c_type() function in the generator treats all names
as being in the same namespace, this patch adds a global array
to track all known names and their source, to prevent collisions
before it can cause further problems. While valid .json files
won't trigger any of these cases, we might as well be nicer to
developers that make a typo while trying to add new QAPI code.

Backports commit 4dc2e6906e1084fdd37bf67385c5dcd2c72ae22b from qemu
2018-02-19 13:56:05 -05:00
..
create_config more cleanup qemu/configure 2017-01-19 14:11:54 +08:00
make_device_config.sh fix file perms 2015-08-28 21:05:38 -07:00
ordereddict.py import 2015-08-21 15:04:50 +08:00
qapi-event.py import 2015-08-21 15:04:50 +08:00
qapi-types.py qapi: Use 'alternate' to replace anonymous union 2018-02-19 13:49:56 -05:00
qapi-visit.py qapi: Use 'alternate' to replace anonymous union 2018-02-19 13:49:56 -05:00
qapi.py qapi: Better error messages for duplicated expressions 2018-02-19 13:56:05 -05:00