diff options
| author | Yawning Angel <yawning@schwanenlied.me> | 2021-10-31 21:37:22 +0000 |
|---|---|---|
| committer | Yawning Angel <yawning@schwanenlied.me> | 2021-10-31 21:37:22 +0000 |
| commit | 796a0c3968243f540e68e584283d862f60bf3f26 (patch) | |
| tree | df9a40bfc381d96410901dfaa33786c7556f361e /src/llvm_backend_utility.cpp | |
| parent | ff36bd3d8589bb9f86b1ce2caef17c1e9cb54b81 (diff) | |
core/intrinsics: Add mem_zero_volatile
Diffstat (limited to 'src/llvm_backend_utility.cpp')
| -rw-r--r-- | src/llvm_backend_utility.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/llvm_backend_utility.cpp b/src/llvm_backend_utility.cpp index b58f07d49..709106bc4 100644 --- a/src/llvm_backend_utility.cpp +++ b/src/llvm_backend_utility.cpp @@ -48,7 +48,7 @@ lbValue lb_correct_endianness(lbProcedure *p, lbValue value) { return value; } -void lb_mem_zero_ptr_internal(lbProcedure *p, LLVMValueRef ptr, LLVMValueRef len, unsigned alignment) { +void lb_mem_zero_ptr_internal(lbProcedure *p, LLVMValueRef ptr, LLVMValueRef len, unsigned alignment, bool is_volatile) { bool is_inlinable = false; i64 const_len = 0; @@ -77,7 +77,7 @@ void lb_mem_zero_ptr_internal(lbProcedure *p, LLVMValueRef ptr, LLVMValueRef len args[0] = LLVMBuildPointerCast(p->builder, ptr, types[0], ""); args[1] = LLVMConstInt(LLVMInt8TypeInContext(p->module->ctx), 0, false); args[2] = LLVMBuildIntCast2(p->builder, len, types[1], /*signed*/false, ""); - args[3] = LLVMConstInt(LLVMInt1TypeInContext(p->module->ctx), 0, false); // is_volatile parameter + args[3] = LLVMConstInt(LLVMInt1TypeInContext(p->module->ctx), is_volatile, false); LLVMBuildCall(p->builder, ip, args, gb_count_of(args), ""); } @@ -93,7 +93,7 @@ void lb_mem_zero_ptr(lbProcedure *p, LLVMValueRef ptr, Type *type, unsigned alig { // 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); + lb_mem_zero_ptr_internal(p, ptr, lb_const_int(p->module, t_int, sz).value, alignment, false); } break; default: |