From 4b556b5a06902d8e355033f6f92916254ee8af76 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Tue, 16 Jan 2024 22:09:45 +0300 Subject: [PATCH] oppc/pseudocode: allow to check whether node is present --- src/openpower/oppc/pc_pseudocode.py | 3 +++ 1 file changed, 3 insertions(+) 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] -- 2.30.2