Skip to content

Commit

Permalink
Merge pull request FEX-Emu#3849 from alyssarosenzweig/ir/drop-parser-2
Browse files Browse the repository at this point in the history
Scripts: drop remnant of IR parser
  • Loading branch information
Sonicadvance1 authored Jul 9, 2024
2 parents 3ef9ea9 + f974696 commit 991c694
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions FEXCore/Scripts/json_ir_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,52 +747,6 @@ def print_ir_allocator_helpers():
output_file.write("#undef IROP_ALLOCATE_HELPERS\n")
output_file.write("#endif\n")

def print_ir_parser_switch_helper():
output_file.write("#ifdef IROP_PARSER_SWITCH_HELPERS\n")
for op in IROps:
if op.Name != "Last" and op.SwitchGen:
output_file.write("\tcase FEXCore::IR::IROps::OP_%s: {\n" % (op.Name.upper()))

for i in range(0, len(op.Arguments)):
arg = op.Arguments[i]
LastArg = len(op.Arguments) - i - 1 == 0

if arg.Temporary:
CType = IRTypesToCXX[arg.Type].CXXName
output_file.write("\t\tauto arg{} = DecodeValue<{}>(Def.Args[{}]);\n".format(i, CType, i))
output_file.write("\t\tif (!CheckPrintErrorArg(Def, arg{}.first, {})) return false;\n".format(i, i))
elif arg.IsSSA:
# SSA value
output_file.write("\t\tauto arg{} = DecodeValue<OrderedNode*>(Def.Args[{}]);\n".format(i, i))
output_file.write("\t\tif (!CheckPrintErrorArg(Def, arg{}.first, {})) return false;\n".format(i, i))
else:
# User defined op that is stored
CType = IRTypesToCXX[arg.Type].CXXName
output_file.write("\t\tauto arg{} = DecodeValue<{}>(Def.Args[{}]);\n".format(i, CType, i))
output_file.write("\t\tif (!CheckPrintErrorArg(Def, arg{}.first, {})) return false;\n".format(i, i))

output_file.write("\t\tDef.Node = _{}(\n".format(op.Name))

for i in range(0, len(op.Arguments)):
arg = op.Arguments[i]
LastArg = len(op.Arguments) - i - 1 == 0
output_file.write("\t\t\targ{}.second".format(i))
if not LastArg:
output_file.write(",\n")
else:
output_file.write("\n")

output_file.write("\t\t);\n")

output_file.write("\t\tSSANameMapper[Def.Definition] = Def.Node;\n")

output_file.write("\t\tbreak;\n")
output_file.write("\t}\n")


output_file.write("#undef IROP_PARSER_SWITCH_HELPERS\n")
output_file.write("#endif\n")

def print_ir_dispatcher_defs():
output_dispatch_file.write("#ifdef IROP_DISPATCH_DEFS\n")
for op in IROps:
Expand Down Expand Up @@ -851,7 +805,6 @@ def print_ir_dispatcher_dispatch():
print_ir_gethasdest()
print_ir_arg_printer()
print_ir_allocator_helpers()
print_ir_parser_switch_helper()

output_file.close()

Expand Down

0 comments on commit 991c694

Please sign in to comment.