diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2021-09-13 18:23:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-13 18:23:58 +0100 |
| commit | 4e4ac460e53272140fa5af3a2e005d9091ba8654 (patch) | |
| tree | 15d6dd8f98f9b47b4efd0d9b906299054d6424de /src/check_type.cpp | |
| parent | e9b9d15de7bc08bdf2891586589e215832c9a3cc (diff) | |
| parent | 526a42c6caac9bc39b9217e58c297d084c3d694a (diff) | |
Merge pull request #1164 from odin-lang/llvm-explicit-padding
LLVM Struct Types with Explicit Padding
Diffstat (limited to 'src/check_type.cpp')
| -rw-r--r-- | src/check_type.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp index b80d6c05e..00a4c4ab2 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -215,13 +215,7 @@ bool check_custom_align(CheckerContext *ctx, Ast *node, i64 *align_) { error(node, "#align must be a power of 2, got %lld", align); return false; } - - // NOTE(bill): Success!!! - i64 custom_align = gb_clamp(align, 1, build_context.max_align); - if (custom_align < align) { - warning(node, "Custom alignment has been clamped to %lld from %lld", align, custom_align); - } - *align_ = custom_align; + *align_ = align; return true; } } @@ -2317,7 +2311,7 @@ Type *make_soa_struct_internal(CheckerContext *ctx, Ast *array_typ_expr, Ast *el } else { field_type = alloc_type_pointer(old_field->type); } - Entity *new_field = alloc_entity_field(scope, old_field->token, field_type, false, old_field->Variable.field_src_index); + Entity *new_field = alloc_entity_field(scope, old_field->token, field_type, false, old_field->Variable.field_index); soa_struct->Struct.fields[i] = new_field; add_entity(ctx, scope, nullptr, new_field); add_entity_use(ctx, nullptr, new_field); |