@@ -554,7 +554,7 @@ static Value *maybe_bitcast(jl_codectx_t &ctx, Value *V, Type *to) {
554
554
static Value *julia_binding_pvalue (jl_codectx_t &ctx, Value *bv)
555
555
{
556
556
bv = emit_bitcast (ctx, bv, ctx.types ().T_pprjlvalue );
557
- Value *offset = ConstantInt::get (ctx.types ().T_size , offsetof (jl_binding_t , value) / sizeof ( size_t ) );
557
+ Value *offset = ConstantInt::get (ctx.types ().T_size , offsetof (jl_binding_t , value) / ctx. types (). sizeof_ptr );
558
558
return ctx.builder .CreateInBoundsGEP (ctx.types ().T_prjlvalue , bv, offset);
559
559
}
560
560
@@ -1124,7 +1124,7 @@ static Value *emit_datatype_types(jl_codectx_t &ctx, Value *dt)
1124
1124
1125
1125
static Value *emit_datatype_nfields (jl_codectx_t &ctx, Value *dt)
1126
1126
{
1127
- Value *type_svec = emit_bitcast (ctx, emit_datatype_types (ctx, dt), getSizePtrTy ( ctx.builder . getContext () ));
1127
+ Value *type_svec = emit_bitcast (ctx, emit_datatype_types (ctx, dt), ctx.types (). T_size -> getPointerTo ( ));
1128
1128
jl_aliasinfo_t ai = jl_aliasinfo_t::fromTBAA (ctx, ctx.tbaa ().tbaa_const );
1129
1129
return ai.decorateInst (ctx.builder .CreateAlignedLoad (ctx.types ().T_size , type_svec, Align (sizeof (void *))));
1130
1130
}
@@ -2715,7 +2715,7 @@ static Value *emit_arraylen_prim(jl_codectx_t &ctx, const jl_cgval_t &tinfo)
2715
2715
Value *addr = ctx.builder .CreateStructGEP (ctx.types ().T_jlarray ,
2716
2716
emit_bitcast (ctx, decay_derived (ctx, t), ctx.types ().T_pjlarray ),
2717
2717
1 ); // index (not offset) of length field in ctx.types().T_pjlarray
2718
- LoadInst *len = ctx.builder .CreateAlignedLoad (ctx.types ().T_size , addr, Align ( sizeof ( size_t )) );
2718
+ LoadInst *len = ctx.builder .CreateAlignedLoad (ctx.types ().T_size , addr, ctx. types (). alignof_ptr );
2719
2719
len->setOrdering (AtomicOrdering::NotAtomic);
2720
2720
MDBuilder MDB (ctx.builder .getContext ());
2721
2721
auto rng = MDB.createRange (Constant::getNullValue (ctx.types ().T_size ), ConstantInt::get (ctx.types ().T_size , arraytype_maxsize (tinfo.typ )));
@@ -2923,7 +2923,7 @@ static Value *emit_array_nd_index(
2923
2923
// CreateAlloca is OK here since we are on an error branch
2924
2924
Value *tmp = ctx.builder .CreateAlloca (ctx.types ().T_size , ConstantInt::get (ctx.types ().T_size , nidxs));
2925
2925
for (size_t k = 0 ; k < nidxs; k++) {
2926
- ctx.builder .CreateAlignedStore (idxs[k], ctx.builder .CreateInBoundsGEP (ctx.types ().T_size , tmp, ConstantInt::get (ctx.types ().T_size , k)), Align ( sizeof ( size_t )) );
2926
+ ctx.builder .CreateAlignedStore (idxs[k], ctx.builder .CreateInBoundsGEP (ctx.types ().T_size , tmp, ConstantInt::get (ctx.types ().T_size , k)), ctx. types (). alignof_ptr );
2927
2927
}
2928
2928
ctx.builder .CreateCall (prepare_call (jlboundserrorv_func),
2929
2929
{ mark_callee_rooted (ctx, a), tmp, ConstantInt::get (ctx.types ().T_size , nidxs) });
@@ -3040,7 +3040,8 @@ static jl_value_t *static_constant_instance(const llvm::DataLayout &DL, Constant
3040
3040
return obj;
3041
3041
}
3042
3042
3043
- static Value *call_with_attrs (jl_codectx_t &ctx, JuliaFunction *intr, Value *v)
3043
+ template <typename TypeFn_t>
3044
+ static Value *call_with_attrs (jl_codectx_t &ctx, JuliaFunction<TypeFn_t> *intr, Value *v)
3044
3045
{
3045
3046
Function *F = prepare_call (intr);
3046
3047
CallInst *Call = ctx.builder .CreateCall (F, v);
0 commit comments