another workaround for llvm coroutines

this one doesn't work either
This commit is contained in:
Andrew Kelley
2018-02-28 04:01:22 -05:00
parent d243453862
commit 026aebf2ea
6 changed files with 222 additions and 51 deletions

View File

@@ -1096,6 +1096,14 @@ static void ir_print_coro_save(IrPrint *irp, IrInstructionCoroSave *instruction)
fprintf(irp->f, ")");
}
static void ir_print_coro_alloc_helper(IrPrint *irp, IrInstructionCoroAllocHelper *instruction) {
fprintf(irp->f, "@coroAllocHelper(");
ir_print_other_instruction(irp, instruction->alloc_fn);
fprintf(irp->f, ",");
ir_print_other_instruction(irp, instruction->coro_size);
fprintf(irp->f, ")");
}
static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) {
ir_print_prefix(irp, instruction);
switch (instruction->id) {
@@ -1452,6 +1460,9 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) {
case IrInstructionIdCoroSave:
ir_print_coro_save(irp, (IrInstructionCoroSave *)instruction);
break;
case IrInstructionIdCoroAllocHelper:
ir_print_coro_alloc_helper(irp, (IrInstructionCoroAllocHelper *)instruction);
break;
}
fprintf(irp->f, "\n");
}