for c in filter(not_info, components):
if c.implement:
defined_names.add(c.name)
+ if c.unused:
+ set_names.add(c.name)
if c.predicate:
# Predicates are always "set".
pname = c.name + "_p"
called_names.add(m[2])
+printed = False
for elt in sorted(defined_names - set_names):
+ printed = True
print(f"never set: {elt}")
for elt in sorted(defined_names - called_names):
+ printed = True
print(f"never called: {elt}")
+
+if not printed:
+ print("Everything ok!")
# *'. This is used for dumping. The string must live long enough to
# be passed to printf.
#
+# * "unused" - a boolean. If true, the hook is known to be unused, we
+# but agreed to keep it around nevertheless. check-gdbarch.py uses
+# this. This should be used sparingly, if at all.
+#
# Value, Function, and Method share some more parameters. Some of
# these work in conjunction in a somewhat complicated way, so they are
# described in a separate sub-section below.
name="bfloat16_bit",
predefault="2*TARGET_CHAR_BIT",
invalid=False,
+ # Currently unused but we wanted to keep this hook around.
+ unused=True,
)
Value(
name="half_bit",
predefault="2*TARGET_CHAR_BIT",
invalid=False,
+ # Currently unused but we wanted to keep this hook around.
+ unused=True,
)
Value(
name="stap_integer_suffixes",
invalid=False,
printer="pstring_list (gdbarch->stap_integer_suffixes)",
+ # Currently unused but we wanted to keep this hook around.
+ unused=True,
)
Value(
name="stap_register_suffixes",
invalid=False,
printer="pstring_list (gdbarch->stap_register_suffixes)",
+ # Currently unused but we wanted to keep this hook around.
+ unused=True,
)
Value(
name="stap_gdb_register_prefix",
invalid=False,
printer="pstring (gdbarch->stap_gdb_register_prefix)",
+ # Currently unused but we wanted to keep this hook around.
+ unused=True,
)
Value(
name="stap_gdb_register_suffix",
invalid=False,
printer="pstring (gdbarch->stap_gdb_register_suffix)",
+ # Currently unused but we wanted to keep this hook around.
+ unused=True,
)
Method(
params=[],
predefault="default_addressable_memory_unit_size",
invalid=False,
+ # Currently unused but we wanted to keep this hook around.
+ unused=True,
)
Value(
param_checks: Optional[List[str]] = None,
result_checks: Optional[List[str]] = None,
implement: bool = True,
+ unused: bool = False,
):
self.name = name
self.type = type
self.param_checks = param_checks
self.result_checks = result_checks
self.implement = implement
+ self.unused = unused
components.append(self)
postdefault: Optional[str] = None,
invalid: Union[bool, str] = True,
printer: Optional[str] = None,
+ unused: bool = False,
):
super().__init__(
comment=comment,
postdefault=postdefault,
invalid=invalid,
printer=printer,
+ unused=unused,
)
param_checks: Optional[List[str]] = None,
result_checks: Optional[List[str]] = None,
implement: bool = True,
+ unused: bool = False,
):
super().__init__(
comment=comment,
param_checks=param_checks,
result_checks=result_checks,
implement=implement,
+ unused=unused,
)
def ftype(self):