src/arch/cc/eqasm_backend_cc.cc
// handle kernel conditionality at end of kernel
// based on cc_light_eqasm_compiler.h::get_epilogue
handle kernel conditionality at end of kernel
based on cc_light_eqasm_compiler.h::get_epilogue
handle kernel conditionality at end of kernel based on cc_light_eqasm_compiler . h :: get_epilogue
void eqasm_backend_cc::codegen_kernel_epilogue(ql::quantum_kernel &k)
{
    switch(k.type) {
        case kernel_type_t::FOR_END:
        {
            std::string label = kernelLabel(k);
            codegen.for_end(label);
            break;
        }
        case kernel_type_t::DO_WHILE_END:
        {
            auto op0 = k.br_condition.operands[0]->id;
            auto op1 = k.br_condition.operands[1]->id;
            auto opName = k.br_condition.operation_name;
            std::string label = kernelLabel(k);
            codegen.do_while_end(label, op0, opName, op1);
            break;
        }
        case kernel_type_t::IF_END:
        case kernel_type_t::ELSE_END:
            break;
        case kernel_type_t::STATIC:
        case kernel_type_t::IF_START:
        case kernel_type_t::ELSE_START:
        case kernel_type_t::FOR_START:
        case kernel_type_t::DO_WHILE_START:
            break;
        default:
            FATAL("inconsistency detected: unhandled kernel type");
            break;
    }
}
void eqasm_backend_cc :: codegen_kernel_epilogue ( ql :: quantum_kernel & k ) { switch ( k . type ) { case kernel_type_t :: FOR_END : { std :: string label = kernelLabel ( k ) ; codegen . for_end ( label ) ; break ; } case kernel_type_t :: DO_WHILE_END : { auto op0 = k . br_condition . operands [ 0 ] -> id ; auto op1 = k . br_condition . operands [ 1 ] -> id ; auto opName = k . br_condition . operation_name ; std :: string label = kernelLabel ( k ) ; codegen . do_while_end ( label , op0 , opName , op1 ) ; break ; } case kernel_type_t :: IF_END : case kernel_type_t :: ELSE_END : break ; case kernel_type_t :: STATIC : case kernel_type_t :: IF_START : case kernel_type_t :: ELSE_START : case kernel_type_t :: FOR_START : case kernel_type_t :: DO_WHILE_START : break ; default : FATAL ( " " ) ; break ; } }
handle kernel conditionality at end of kernel
based on cc_light_eqasm_compiler.h::get_epilogue
handle kernel conditionality at end of kernel based on cc_light_eqasm_compiler . h :: get_epilogue
// do nothing // do nothing