oppc/code: generalize casts
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 13b6fc65997a596938209e645fbb73594467c746..50a6444603d6fa16a9d8c77c12e00a3779f3ac81 100644 (file)
@@ -116,7 +116,7 @@ class CodeVisitor(pc_util.Visitor):
 
     def fixup_ternary(self, node):
         self[node].clear()
-        test = self.call(name="oppc_bool", code=[
+        test = self.call(name="oppc_cast_bool", code=[
             self[node.test],
         ])
         self[node].emit(stmt="(")
@@ -528,7 +528,7 @@ class CodeVisitor(pc_util.Visitor):
     @pc_util.Hook(pc_ast.IfExpr)
     def IfExpr(self, node):
         yield node
-        test = self.call(name="oppc_bool", code=[
+        test = self.call(name="oppc_cast_bool", code=[
             self[node.test],
         ])
         self[node].emit(stmt="if (")
@@ -547,7 +547,7 @@ class CodeVisitor(pc_util.Visitor):
     @pc_util.Hook(pc_ast.SwitchExpr)
     def SwitchExpr(self, node):
         yield node
-        subject = self.call(name="oppc_int64", code=[
+        subject = self.call(name="oppc_cast_int64", code=[
             self[node.subject],
         ])
         self[node].emit(stmt="switch (")