oppc/code: silence unused insn
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 4a396e21d41e7ed951a5eb3cc4d0c86aa181ea8b..8f1b771e663ca67e889b3102aecec47b14c3650e 100644 (file)
@@ -54,6 +54,8 @@ class CodeVisitor(pc_util.Visitor):
             self.__code[self.__header].emit(stmt=f"struct oppc_value {var};")
         for var in filter(lambda var: var not in operands, sorted(self.__vars)):
             self.__code[self.__header].emit(stmt=f"struct oppc_value {var};")
+        if not operands:
+            self.__code[self.__header].emit("(void)insn;")
         self.__code[self.__header].emit()
 
         for operand in insn.dynamic_operands: