fix alignment of consts

This commit is contained in:
Andrew Kelley
2019-06-03 19:11:41 -04:00
parent eb8a132d23
commit b6108eed52
4 changed files with 15 additions and 11 deletions

View File

@@ -6599,7 +6599,8 @@ static void render_const_val_global(CodeGen *g, ConstExprValue *const_val, const
LLVMSetLinkage(global_value, LLVMInternalLinkage);
LLVMSetGlobalConstant(global_value, true);
LLVMSetUnnamedAddr(global_value, true);
LLVMSetAlignment(global_value, get_abi_alignment(g, const_val->type));
LLVMSetAlignment(global_value, (const_val->global_refs->align == 0) ?
get_abi_alignment(g, const_val->type) : const_val->global_refs->align);
const_val->global_refs->llvm_global = global_value;
}