IR: implement breakpoint builtin

This commit is contained in:
Andrew Kelley
2016-12-13 01:48:40 -05:00
parent 76a849b1f2
commit a6d2bdf605
4 changed files with 44 additions and 6 deletions

View File

@@ -812,6 +812,10 @@ static void ir_print_member_count(IrPrint *irp, IrInstructionMemberCount *instru
fprintf(irp->f, ")");
}
static void ir_print_breakpoint(IrPrint *irp, IrInstructionBreakpoint *instruction) {
fprintf(irp->f, "@breakpoint()");
}
static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) {
ir_print_prefix(irp, instruction);
switch (instruction->id) {
@@ -1009,6 +1013,9 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) {
case IrInstructionIdMemberCount:
ir_print_member_count(irp, (IrInstructionMemberCount *)instruction);
break;
case IrInstructionIdBreakpoint:
ir_print_breakpoint(irp, (IrInstructionBreakpoint *)instruction);
break;
}
fprintf(irp->f, "\n");
}