oppc/code: handle call statements
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 8f1b771e663ca67e889b3102aecec47b14c3650e..9b92caefda26928b989a9d54764b466e2b78e13c 100644 (file)
@@ -184,6 +184,10 @@ class CodeVisitor(pc_util.Visitor):
         yield node
         with self[node]:
             for subnode in node:
+                if isinstance(subnode, pc_ast.Call):
+                    (level, stmt) = self[subnode][-1]
+                    assert stmt[-1] == ")"
+                    self[subnode][-1] = (level, f"{stmt};")
                 for (level, stmt) in self[subnode]:
                     self[node].emit(stmt=stmt, level=level)