From 4d9fdf5bd381c21ae68e08e52a0d98729a390cfe Mon Sep 17 00:00:00 2001 From: Colin Davidson Date: Tue, 29 Jul 2025 13:09:05 -0700 Subject: move to checker error, rather than panic --- src/check_builtin.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/check_builtin.cpp') diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp index 66be3c69e..974224ed2 100644 --- a/src/check_builtin.cpp +++ b/src/check_builtin.cpp @@ -4714,6 +4714,14 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As break; case BuiltinProc_read_cycle_counter_frequency: + if (build_context.metrics.arch != TargetArch_arm64) { + error(call, "'%.*s' is only allowed on arm64 targets", LIT(builtin_name)); + return false; + } + operand->mode = Addressing_Value; + operand->type = t_i64; + break; + case BuiltinProc_read_cycle_counter: operand->mode = Addressing_Value; operand->type = t_i64; -- cgit v1.2.3