From: Dmitry Selyutin Date: Tue, 16 Jan 2024 19:09:45 +0000 (+0300) Subject: oppc/pseudocode: allow to check whether node is present X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4b556b5a06902d8e355033f6f92916254ee8af76;p=openpower-isa.git oppc/pseudocode: allow to check whether node is present --- diff --git a/src/openpower/oppc/pc_pseudocode.py b/src/openpower/oppc/pc_pseudocode.py index 074d4c0d..6804eb26 100644 --- a/src/openpower/oppc/pc_pseudocode.py +++ b/src/openpower/oppc/pc_pseudocode.py @@ -14,6 +14,9 @@ class PseudocodeVisitor(pc_util.Visitor): def __iter__(self): yield from self.__code[self.__root] + def __contains__(self, node): + return (node in self.__code) + def __getitem__(self, node): return self.__code[node]