Make is_type_lock_free follow what each target lowers without library calls, and reject atomics on types which are not lock-free

This commit is contained in:
gingerBill committed 2026-10-07 21:58:32 +01:00
1 parent ad685e1144
commit 711f08a641
5 files changed
+90 -21

No files matched your search

-14
View File
@@ -6600,20 +6600,6 @@ gb_internal bool is_type_normal_pointer(Type *ptr, Type **elem) {
return false;
}
gb_internal bool is_type_valid_atomic_type(Type *elem) {
elem = core_type(elem);
if (is_type_internally_pointer_like(elem)) {
return true;
}
if (elem->kind == Type_BitSet) {
elem = bit_set_to_int(elem);
}
if (elem->kind != Type_Basic) {
return false;
}
return (elem->Basic.flags & (BasicFlag_Boolean|BasicFlag_OrderedNumeric)) != 0;
}
gb_internal bool check_identifier_exists(Scope *s, Ast *node, bool nested = false, Scope **out_scope = nullptr) {
switch (node->kind) {
case_ast_node(i, Ident, node);