mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
use PointerToRefcount in == 1 comparison
This commit is contained in:
parent
b2d1354373
commit
94a8d07fe7
1 changed files with 3 additions and 7 deletions
|
@ -10,7 +10,7 @@ use crate::llvm::convert::{
|
||||||
};
|
};
|
||||||
use crate::llvm::refcounting::{
|
use crate::llvm::refcounting::{
|
||||||
decrement_refcount_layout, increment_refcount_layout, list_get_refcount_ptr,
|
decrement_refcount_layout, increment_refcount_layout, list_get_refcount_ptr,
|
||||||
refcount_is_one_comparison,
|
refcount_is_one_comparison, PointerToRefcount,
|
||||||
};
|
};
|
||||||
use bumpalo::collections::Vec;
|
use bumpalo::collections::Vec;
|
||||||
use bumpalo::Bump;
|
use bumpalo::Bump;
|
||||||
|
@ -2654,12 +2654,8 @@ where
|
||||||
|
|
||||||
let ret_type = basic_type_from_layout(env.arena, ctx, list_layout, env.ptr_bytes);
|
let ret_type = basic_type_from_layout(env.arena, ctx, list_layout, env.ptr_bytes);
|
||||||
|
|
||||||
let refcount_ptr = list_get_refcount_ptr(env, list_layout, original_wrapper);
|
let refcount_ptr = PointerToRefcount::from_list_wrapper(env, original_wrapper);
|
||||||
|
let refcount = refcount_ptr.get_refcount(env);
|
||||||
let refcount = env
|
|
||||||
.builder
|
|
||||||
.build_load(refcount_ptr, "get_refcount")
|
|
||||||
.into_int_value();
|
|
||||||
|
|
||||||
let comparison = refcount_is_one_comparison(env, refcount);
|
let comparison = refcount_is_one_comparison(env, refcount);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue