mirror of
https://github.com/odin-lang/Odin.git
synced 2026-10-13 03:27:44 -04:00
Add @(align=N) for variables, raising the alignment of globals, locals, @(static) and @(thread_local) variables to at least N
This commit is contained in:
1 parent
30f80e1079
commit
5ff7268cab
8 files changed
+35
-5
No files matched your search
@@ -2421,7 +2421,7 @@ gb_internal void lb_create_global_variable(lbModule *m, lbGlobalVariable *var) {
|
||||
LLVM_SET_INTERNAL_WEAK_LINKAGE(g.value);
|
||||
}
|
||||
lb_set_linkage_from_entity_flags(m, g.value, e->flags);
|
||||
LLVMSetAlignment(g.value, cast(u32)type_align_of(e->type));
|
||||
LLVMSetAlignment(g.value, cast(u32)gb_max(type_align_of(e->type), e->Variable.custom_align));
|
||||
|
||||
if (e->Variable.link_section.len > 0) {
|
||||
LLVMSetSection(g.value, alloc_cstring(permanent_allocator(), e->Variable.link_section));
|
||||
|
||||
Reference in new issue
Block a user