MCPcopy Create free account
hub / github.com/N64Recomp/N64Recomp / emit_branch_condition

Method emit_branch_condition

src/cgenerator.cpp:446–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444}
445
446void N64Recomp::CGenerator::emit_branch_condition(const ConditionalBranchOp& op, const InstructionContext& ctx) const {
447 // Thread local variables to prevent allocations when possible.
448 // TODO these thread locals probably don't actually help right now, so figure out a better way to prevent allocations.
449 thread_local std::string expr_string{};
450 get_binary_expr_string(op.comparison, op.operands, ctx, "", expr_string);
451 fmt::print(output_file, "if ({}) {{\n", expr_string);
452}
453
454void N64Recomp::CGenerator::emit_branch_close() const {
455 fmt::print(output_file, "}}\n");

Callers 1

process_instructionFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected