aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-11-25 18:46:17 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-11-25 18:46:17 -0500
commit4261fa3c49be715355c9623102bad0bf93d537a3 (patch)
treeba8da3ef0611a547fe67c61ed2d42d4ea67e6d2e /src/ir.cpp
parent659c1bdeeebce7bf32e122be6a728fe727112c56 (diff)
downloadzig-4261fa3c49be715355c9623102bad0bf93d537a3.tar.gz
zig-4261fa3c49be715355c9623102bad0bf93d537a3.zip
move logic to the appropriate layers; add new compile error
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp8
1 files changed, 8 insertions, 0 deletions
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;