aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_general.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-04-20 12:18:13 +0100
committergingerBill <bill@gingerbill.org>2023-04-20 12:18:13 +0100
commit685f7d0feae7b7bbfee5b24f6e6dc6751366d36e (patch)
tree782c0fd8133e9227d53ad72189d200a62598b05b /src/llvm_backend_general.cpp
parentf5d9ca64f95ab47b6c2809275755ebca260c9448 (diff)
Rename `word_size` to `ptr_size` internally to make it clearer
Diffstat (limited to 'src/llvm_backend_general.cpp')
-rw-r--r--src/llvm_backend_general.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/llvm_backend_general.cpp b/src/llvm_backend_general.cpp
index 5108e7c39..3d38416e0 100644
--- a/src/llvm_backend_general.cpp
+++ b/src/llvm_backend_general.cpp
@@ -1626,7 +1626,7 @@ gb_internal LLVMTypeRef lb_type_internal(lbModule *m, Type *type) {
GB_ASSERT(type != t_invalid);
- bool bigger_int = build_context.word_size != build_context.int_size;
+ bool bigger_int = build_context.ptr_size != build_context.int_size;
switch (type->kind) {
case Type_Basic:
@@ -1765,7 +1765,7 @@ gb_internal LLVMTypeRef lb_type_internal(lbModule *m, Type *type) {
case Basic_int: return LLVMIntTypeInContext(ctx, 8*cast(unsigned)build_context.int_size);
case Basic_uint: return LLVMIntTypeInContext(ctx, 8*cast(unsigned)build_context.int_size);
- case Basic_uintptr: return LLVMIntTypeInContext(ctx, 8*cast(unsigned)build_context.word_size);
+ case Basic_uintptr: return LLVMIntTypeInContext(ctx, 8*cast(unsigned)build_context.ptr_size);
case Basic_rawptr: return LLVMPointerType(LLVMInt8TypeInContext(ctx), 0);
case Basic_string:
@@ -1800,7 +1800,7 @@ gb_internal LLVMTypeRef lb_type_internal(lbModule *m, Type *type) {
return type;
}
- case Basic_typeid: return LLVMIntTypeInContext(m->ctx, 8*cast(unsigned)build_context.word_size);
+ case Basic_typeid: return LLVMIntTypeInContext(m->ctx, 8*cast(unsigned)build_context.ptr_size);
// Endian Specific Types
case Basic_i16le: return LLVMInt16TypeInContext(ctx);
@@ -1927,7 +1927,7 @@ gb_internal LLVMTypeRef lb_type_internal(lbModule *m, Type *type) {
if (bigger_int) {
LLVMTypeRef fields[3] = {
LLVMPointerType(lb_type(m, type->Slice.elem), 0), // data
- lb_type_padding_filler(m, build_context.word_size, build_context.word_size), // padding
+ lb_type_padding_filler(m, build_context.ptr_size, build_context.ptr_size), // padding
lb_type(m, t_int), // len
};
return LLVMStructTypeInContext(ctx, fields, gb_count_of(fields), false);
@@ -1946,7 +1946,7 @@ gb_internal LLVMTypeRef lb_type_internal(lbModule *m, Type *type) {
if (bigger_int) {
LLVMTypeRef fields[5] = {
LLVMPointerType(lb_type(m, type->DynamicArray.elem), 0), // data
- lb_type_padding_filler(m, build_context.word_size, build_context.word_size), // padding
+ lb_type_padding_filler(m, build_context.ptr_size, build_context.ptr_size), // padding
lb_type(m, t_int), // len
lb_type(m, t_int), // cap
lb_type(m, t_allocator), // allocator
@@ -2173,7 +2173,7 @@ gb_internal LLVMTypeRef lb_type_internal(lbModule *m, Type *type) {
LLVMTypeRef *fields = gb_alloc_array(permanent_allocator(), LLVMTypeRef, field_count);
fields[0] = LLVMPointerType(lb_type(m, type->Pointer.elem), 0);
if (bigger_int) {
- fields[1] = lb_type_padding_filler(m, build_context.word_size, build_context.word_size);
+ fields[1] = lb_type_padding_filler(m, build_context.ptr_size, build_context.ptr_size);
fields[2] = LLVMIntTypeInContext(ctx, 8*cast(unsigned)build_context.int_size);
} else {
fields[1] = LLVMIntTypeInContext(ctx, 8*cast(unsigned)build_context.int_size);