From 4261fa3c49be715355c9623102bad0bf93d537a3 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 25 Nov 2019 18:46:17 -0500 Subject: move logic to the appropriate layers; add new compile error --- src/ir.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index f4bcfb6330..7e867f1c93 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -17095,6 +17095,14 @@ static IrInstruction *analyze_casted_new_stack(IrAnalyze *ira, IrInstructionCall if (call_instruction->new_stack == nullptr) return nullptr; + if (!call_instruction->is_async_call_builtin && + arch_stack_pointer_register_name(ira->codegen->zig_target->arch) == nullptr) + { + ir_add_error(ira, &call_instruction->base, + buf_sprintf("target arch '%s' does not support @newStackCall", + target_arch_name(ira->codegen->zig_target->arch))); + } + IrInstruction *new_stack = call_instruction->new_stack->child; if (type_is_invalid(new_stack->value->type)) return ira->codegen->invalid_instruction; -- cgit v1.2.3