mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
LLVM backend: set small string flag on empty string
This commit is contained in:
parent
a481e34f31
commit
c5d0a42c20
2 changed files with 94 additions and 112 deletions
|
@ -432,12 +432,3 @@ pub fn str_equal<'a, 'ctx, 'env>(
|
|||
bitcode::STR_EQUAL,
|
||||
)
|
||||
}
|
||||
|
||||
// TODO investigate: does this cause problems when the layout is known? this value is now not refcounted!
|
||||
pub fn empty_str<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> BasicValueEnum<'ctx> {
|
||||
let struct_type = super::convert::zig_str_type(env);
|
||||
|
||||
// The pointer should be null (aka zero) and the length should be zero,
|
||||
// so the whole struct should be a const_zero
|
||||
BasicValueEnum::StructValue(struct_type.const_zero())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue