mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
script/codeconverter/qom_type_info: Deprecate MakeTypeRegisterStatic and MakeTypeRegisterNotStatic
Deprecate MakeTypeRegisterStatic and MakeTypeRegisterNotStatic because type_register() will be deprecated, then only type_register_static() is used. Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Link: https://lore.kernel.org/r/20241029085934.2799066-16-zhao1.liu@intel.com
This commit is contained in:
parent
e5d60d930c
commit
4e40d50558
1 changed files with 0 additions and 20 deletions
|
@ -901,26 +901,6 @@ class TypeRegisterCall(FileMatch):
|
||||||
regexp = S(r'^[ \t]*', NAMED('func_name', 'type_register'),
|
regexp = S(r'^[ \t]*', NAMED('func_name', 'type_register'),
|
||||||
r'\s*\(&\s*', NAMED('name', RE_IDENTIFIER), r'\s*\);[ \t]*\n')
|
r'\s*\(&\s*', NAMED('name', RE_IDENTIFIER), r'\s*\);[ \t]*\n')
|
||||||
|
|
||||||
class MakeTypeRegisterStatic(TypeRegisterCall):
|
|
||||||
"""Make type_register() call static if variable is static const"""
|
|
||||||
def gen_patches(self):
|
|
||||||
var = self.file.find_match(TypeInfoVar, self.name)
|
|
||||||
if var is None:
|
|
||||||
self.warn("can't find TypeInfo var declaration for %s", self.name)
|
|
||||||
return
|
|
||||||
if var.is_static() and var.is_const():
|
|
||||||
yield self.group_match('func_name').make_patch('type_register_static')
|
|
||||||
|
|
||||||
class MakeTypeRegisterNotStatic(TypeRegisterStaticCall):
|
|
||||||
"""Make type_register() call static if variable is static const"""
|
|
||||||
def gen_patches(self):
|
|
||||||
var = self.file.find_match(TypeInfoVar, self.name)
|
|
||||||
if var is None:
|
|
||||||
self.warn("can't find TypeInfo var declaration for %s", self.name)
|
|
||||||
return
|
|
||||||
if not var.is_static() or not var.is_const():
|
|
||||||
yield self.group_match('func_name').make_patch('type_register')
|
|
||||||
|
|
||||||
class TypeInfoMacro(FileMatch):
|
class TypeInfoMacro(FileMatch):
|
||||||
"""TYPE_INFO macro usage"""
|
"""TYPE_INFO macro usage"""
|
||||||
regexp = S(r'^[ \t]*TYPE_INFO\s*\(\s*', NAMED('name', RE_IDENTIFIER), r'\s*\)[ \t]*;?[ \t]*\n')
|
regexp = S(r'^[ \t]*TYPE_INFO\s*\(\s*', NAMED('name', RE_IDENTIFIER), r'\s*\)[ \t]*;?[ \t]*\n')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue