@@ -157,15 +157,15 @@ static DIType julia_type_to_di(jl_value_t *jt, DIBuilder *dbuilder, bool isboxed
157157 llvm::DIType *t = dbuilder->createBasicType (
158158 jl_symbol_name (jdt->name ->name ),
159159 SizeInBits,
160- 8 * jdt-> layout -> alignment ,
160+ 8 * jl_datatype_align ( jdt) ,
161161 llvm::dwarf::DW_ATE_unsigned);
162162 jdt->ditype = t;
163163 return t;
164164#else
165165 DIType t = dbuilder->createBasicType (
166166 jl_symbol_name (jdt->name ->name ),
167167 SizeInBits,
168- 8 * jdt-> layout -> alignment ,
168+ 8 * jl_datatype_align ( jdt) ,
169169 llvm::dwarf::DW_ATE_unsigned);
170170 MDNode *M = t;
171171 jdt->ditype = M;
@@ -189,7 +189,7 @@ static DIType julia_type_to_di(jl_value_t *jt, DIBuilder *dbuilder, bool isboxed
189189 NULL , // File
190190 0 , // LineNumber
191191 jl_datatype_nbits (jdt), // SizeInBits
192- 8 * jdt-> layout -> alignment , // AlignInBits
192+ 8 * jl_datatype_align ( jdt) , // AlignInBits
193193 DIFlagZero, // Flags
194194 NULL , // DerivedFrom
195195 DINodeArray (), // Elements
@@ -523,7 +523,7 @@ static Type *julia_struct_to_llvm(jl_value_t *jt, jl_unionall_t *ua, bool *isbox
523523 *jl_ExecutionEngine->getDataLayout ();
524524#endif
525525 unsigned llvm_alignment = DL.getABITypeAlignment ((Type*)jst->struct_decl );
526- unsigned julia_alignment = jst-> layout -> alignment ;
526+ unsigned julia_alignment = jl_datatype_align ( jst) ;
527527 // Check that the alignment adheres to the heap alignment.
528528 assert (julia_alignment <= JL_SMALL_BYTE_ALIGNMENT);
529529 // TODO: Fix alignment calculation in LLVM, as well as in the GC and the struct declaration
@@ -1169,7 +1169,7 @@ static Value *emit_bounds_check(const jl_cgval_t &ainfo, jl_value_t *ty, Value *
11691169// It is currently unused, but might be used in the future for a more precise answer.
11701170static unsigned julia_alignment (Value* /* ptr*/ , jl_value_t *jltype, unsigned alignment)
11711171{
1172- if (!alignment && (( jl_datatype_t *) jltype)-> layout -> alignment > MAX_ALIGN) {
1172+ if (!alignment && jl_datatype_align ( jltype) > MAX_ALIGN) {
11731173 // Type's natural alignment exceeds strictest alignment promised in heap, so return the heap alignment.
11741174 return MAX_ALIGN;
11751175 }
0 commit comments