oppc/code: check for symbol presense in pseudocode
authorDmitry Selyutin <ghostmansd@gmail.com>
Tue, 16 Jan 2024 19:09:45 +0000 (22:09 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Tue, 16 Jan 2024 19:10:08 +0000 (22:10 +0300)
src/openpower/oppc/pc_code.py

index bf15f57f2e24f747e7946985dc4df0b97ab83177..7e143c3bdbad682490c213d5bbefe4da1eeed235 100644 (file)
@@ -640,7 +640,8 @@ class CodeVisitor(pc_util.Visitor):
                 if decl in ("TRAP",):
                     self[node].emit(stmt=f"{decl}();")
                 else:
-                    self.__decls.add(decl)
+                    if node in self.__pseudocode:
+                        self.__decls.add(decl)
                     self[node].emit(stmt=f"&{decl}")
 
     @pc_util.Hook(Instruction)