Correct weak handling

This commit is contained in:
gingerBill
2022-03-31 00:58:01 +01:00
parent ed6bf28004
commit 6636376a81
+2 -1
View File
@@ -1738,7 +1738,7 @@ lbValue lb_build_builtin_proc(lbProcedure *p, Ast *expr, TypeAndValue const &tv,
} }
// TODO(bill): Figure out how to make it weak // TODO(bill): Figure out how to make it weak
LLVMBool single_threaded = weak; LLVMBool single_threaded = false;
LLVMValueRef value = LLVMBuildAtomicCmpXchg( LLVMValueRef value = LLVMBuildAtomicCmpXchg(
p->builder, address.value, p->builder, address.value,
@@ -1747,6 +1747,7 @@ lbValue lb_build_builtin_proc(lbProcedure *p, Ast *expr, TypeAndValue const &tv,
failure_ordering, failure_ordering,
single_threaded single_threaded
); );
LLVMSetWeak(value, weak);
if (tv.type->kind == Type_Tuple) { if (tv.type->kind == Type_Tuple) {
Type *fix_typed = alloc_type_tuple(); Type *fix_typed = alloc_type_tuple();