aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_utility.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-04-24 14:46:34 +0100
committergingerBill <bill@gingerbill.org>2024-04-24 14:46:34 +0100
commitc330e5b5c1b512e1b0ca7181941057e5f2e085e4 (patch)
treef7e351bf4bbee729ff2fbe68258114a726151335 /src/llvm_backend_utility.cpp
parentec5a84a5379236a2413b8f3115509629879f5b53 (diff)
Improve codegen for `bit_field` compound literals with an integer backing
Diffstat (limited to 'src/llvm_backend_utility.cpp')
-rw-r--r--src/llvm_backend_utility.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/llvm_backend_utility.cpp b/src/llvm_backend_utility.cpp
index 2dd7fbc38..c01ab0692 100644
--- a/src/llvm_backend_utility.cpp
+++ b/src/llvm_backend_utility.cpp
@@ -97,15 +97,12 @@ gb_internal void lb_mem_zero_ptr(lbProcedure *p, LLVMValueRef ptr, Type *type, u
LLVMTypeRef llvm_type = lb_type(p->module, type);
LLVMTypeKind kind = LLVMGetTypeKind(llvm_type);
-
+ i64 sz = type_size_of(type);
switch (kind) {
case LLVMStructTypeKind:
case LLVMArrayTypeKind:
- {
- // NOTE(bill): Enforce zeroing through memset to make sure padding is zeroed too
- i32 sz = cast(i32)type_size_of(type);
- lb_mem_zero_ptr_internal(p, ptr, lb_const_int(p->module, t_int, sz).value, alignment, false);
- }
+ // NOTE(bill): Enforce zeroing through memset to make sure padding is zeroed too
+ lb_mem_zero_ptr_internal(p, ptr, lb_const_int(p->module, t_int, sz).value, alignment, false);
break;
default:
LLVMBuildStore(p->builder, LLVMConstNull(lb_type(p->module, type)), ptr);