Skip to content

Commit

Permalink
fix align
Browse files Browse the repository at this point in the history
  • Loading branch information
carnaval committed May 20, 2016
1 parent 71f75ce commit 04bba52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1354,16 +1354,16 @@ static Value *init_bits_value(Value *newv, Value *jt, Value *v, MDNode *tbaa)
return newv;
}
static Value *as_value(Type *t, const jl_cgval_t&);
static Value *init_bits_cgval(Value *newv, const jl_cgval_t& v, MDNode *tbaa, Type *t)
static Value *init_bits_cgval(Value *newv, const jl_cgval_t& v, MDNode *tbaa, Type *t, jl_codectx_t *ctx)
{
Value *jt = literal_pointer_val(v.typ);
if (v.ispointer()) {
init_tag(newv, jt);
builder.CreateMemCpy(newv, v.V, jl_datatype_size(v.typ), sizeof(void*));
builder.CreateMemCpy(newv, data_pointer(v,ctx,PointerType::get(t,0)), jl_datatype_size(v.typ), sizeof(void*));
return newv;
}
else {
return init_bits_value(newv, jt, as_value(t,v), tbaa);
return init_bits_value(newv, jt, v.V, tbaa);
}
}

Expand Down Expand Up @@ -1530,7 +1530,7 @@ static Value *boxed(const jl_cgval_t &vinfo, jl_codectx_t *ctx, bool gcrooted)
return literal_pointer_val(jb->instance);
}
else {
box = init_bits_cgval(emit_allocobj(jl_datatype_size(jt)), vinfo, jb->mutabl ? tbaa_mutab : tbaa_immut, t);
box = init_bits_cgval(emit_allocobj(jl_datatype_size(jt)), vinfo, jb->mutabl ? tbaa_mutab : tbaa_immut, t, ctx);
}

if (gcrooted) {
Expand Down
4 changes: 3 additions & 1 deletion src/intrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,9 @@ static Value *emit_unbox(Type *to, const jl_cgval_t &x, jl_value_t *jt, Value *d
alignment = 0;
}
if (dest) {
builder.CreateMemCpy(dest, p, jl_datatype_size(jt), alignment);
// callers using the dest argument only use it for a stack slot for now
alignment = 0;
builder.CreateMemCpy(dest, p, jl_datatype_size(jt), alignment, false, x.tbaa);
return NULL;
}
else {
Expand Down

0 comments on commit 04bba52

Please sign in to comment.