From b2da69f13041de45d5a31c891b2b3bfc62598659 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sun, 14 Jan 2024 23:25:11 +0300 Subject: [PATCH] oppc/code: support TRAP --- src/openpower/oppc/pc_code.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/openpower/oppc/pc_code.py b/src/openpower/oppc/pc_code.py index 293a7d64..97810acf 100644 --- a/src/openpower/oppc/pc_code.py +++ b/src/openpower/oppc/pc_code.py @@ -630,9 +630,13 @@ class CodeVisitor(pc_util.Visitor): def Symbol(self, node): yield node with self.pseudocode(node=node): - if str(node) not in ("fallthrough",): - self.__decls.add(str(node)) - self[node].emit(stmt=f"&{str(node)}") + decl = str(node) + if decl not in ("fallthrough",): + if decl in ("TRAP",): + self[node].emit(stmt=f"{decl}();") + else: + self.__decls.add(decl) + self[node].emit(stmt=f"&{decl}") @pc_util.Hook(Instruction) def Instruction(self, node): -- 2.30.2