# Write out a delegation function.
def write_delegator(f: TextIO, name: str, return_type: str, argtypes: List[str]):
+ print("", file=f)
names = write_function_header(
f, False, "target_ops::" + name, return_type, argtypes
)
print("this->beneath ()->" + name + " (", file=f, end="")
print(", ".join(names), file=f, end="")
print(");", file=f)
- print("}\n", file=f)
+ print("}", file=f)
# Write out a default function.
return_type: str,
argtypes: List[str],
):
+ print("", file=f)
name = "dummy_target::" + name
names = write_function_header(f, False, name, return_type, argtypes)
if style == "FUNC":
pass
else:
raise RuntimeError("unrecognized style: " + style)
- print("}\n", file=f)
+ print("}", file=f)
def munge_type(typename: str):
def write_debugmethod(
f: TextIO, content: str, name: str, return_type: str, argtypes: List[str]
):
+ print("", file=f)
debugname = "debug_target::" + name
names = write_function_header(f, False, debugname, return_type, argtypes)
if return_type != "void":
if return_type != "void":
print(" return result;", file=f)
- print("}\n", file=f)
+ print("}", file=f)
def print_class(
delegators: List[str],
entries: Dict[str, Entry],
):
+ print("", file=f)
print("struct " + class_name + " : public target_ops", file=f)
print("{", file=f)
print(" const target_info &info () const override;", file=f)
entry = entries[name]
write_declaration(f, name, entry.return_type, entry.argtypes)
- print("};\n", file=f)
+ print("};", file=f)
delegators: List[str] = []