It is impossible to call is_implicit on an enum type from the visitor, because the QAPISchemaEnumType has already been exploded into its constituent fields. The Rust backend is also not modular (yet?) so it is not possible to filter out the builtin module; add a way to query for implicit type names without having the object itself.
Signed-off-by: Paolo Bonzini <[email protected]> --- scripts/qapi/schema.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py index 7bb9fb712cf..3459b8038e5 100644 --- a/scripts/qapi/schema.py +++ b/scripts/qapi/schema.py @@ -1255,6 +1255,17 @@ def _def_builtin_type( # schema. self._make_array_type(name, None) + def is_predefined(self, name: str) -> bool: + # See QAPISchema._def_predefineds() + entity = self._entity_dict[name] + if isinstance(entity, QAPISchemaBuiltinType): + return True + if entity is self.the_empty_object_type: + return True + if name == 'QType': + return True + return False + def _def_predefineds(self) -> None: for t in [('str', 'string', 'char' + POINTER_SUFFIX), ('number', 'number', 'double'), -- 2.54.0
