From: Dmitry Selyutin Date: Wed, 13 Sep 2023 17:04:03 +0000 (+0300) Subject: insndb/core: refactor operands traversal X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=451d0665a4689173c470ac1e2395c1741f6919c6;p=openpower-isa.git insndb/core: refactor operands traversal --- diff --git a/src/openpower/insndb/core.py b/src/openpower/insndb/core.py index 29fec725..d2b44715 100644 --- a/src/openpower/insndb/core.py +++ b/src/openpower/insndb/core.py @@ -3764,18 +3764,10 @@ class Walker(mdis.walker.Walker): @mdis.dispatcher.Hook(Record) def dispatch_record(self, node): - self.__record = node for field in _dataclasses.fields(node): key = field.name value = getattr(node, key) yield (value, node, key, mdis.walker.AttributePath) yield (node.opcodes, node, "opcodes", mdis.walker.AttributePath) - - @mdis.dispatcher.Hook(Operands) - def dispatch_operands(self, node): - def hook(cls_kwargs): - (cls, kwargs) = cls_kwargs - return cls(record=self.__record, **kwargs) - - yield from self(tuple(map(hook, node))) + yield (node.operands, node, "operands", mdis.walker.AttributePath)