Skip to content

Commit

Permalink
build with llvm trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
carnaval committed Jul 18, 2015
1 parent f211ce2 commit 328a752
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/ccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ Value *llvm_type_rewrite(Value *v, Type *from_type, Type *target_type,
}

// simple integer and float widening & conversion cases
if (from_type->isPrimitiveType() && target_type->getPrimitiveSizeInBits() == from_type->getPrimitiveSizeInBits()) {
if (from_type->getPrimitiveSizeInBits() > 0 && target_type->getPrimitiveSizeInBits() == from_type->getPrimitiveSizeInBits()) {
return builder.CreateBitCast(v, target_type);
}
if (target_type->isFloatingPointTy() && from_type->isFloatingPointTy()) {
Expand Down
2 changes: 1 addition & 1 deletion src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ static jl_cgval_t emit_getfield_knownidx(const jl_cgval_t &strct, unsigned idx,
# ifdef LLVM37
Value *addr = builder.CreateConstInBoundsGEP2_32(
cast<PointerType>(strct.V->getType()->getScalarType())->getElementType(),
strct, 0, idx);
strct.V, 0, idx);
# else
Value *addr = builder.CreateConstInBoundsGEP2_32(strct.V, 0, idx);
# endif
Expand Down
10 changes: 5 additions & 5 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ static void jl_setup_module(Module *m, bool add)
#endif
#ifdef LLVM37
if (jl_ExecutionEngine) {
m->setDataLayout(jl_ExecutionEngine->getDataLayout()->getStringRepresentation());
m->setDataLayout(jl_ExecutionEngine->getDataLayout().getStringRepresentation());
m->setTargetTriple(jl_TargetMachine->getTargetTriple().str());
}
#elif LLVM36
Expand Down Expand Up @@ -2009,8 +2009,8 @@ static Value *emit_bits_compare(const jl_cgval_t &arg1, const jl_cgval_t &arg2,
for(unsigned i=0; i < l; i++) {
jl_value_t *fldty = jl_svecref(types, i);
Value *subAns, *fld1, *fld2;
fld1 = builder.CreateConstGEP2_32(varg1, 0, i);
fld2 = builder.CreateConstGEP2_32(varg2, 0, i);
fld1 = builder.CreateConstGEP2_32(LLVM37_param(at) varg1, 0, i);
fld2 = builder.CreateConstGEP2_32(LLVM37_param(at) varg2, 0, i);
if (type_is_ghost(fld1->getType()))
continue;
subAns = emit_bits_compare(mark_julia_slot(fld1, fldty), mark_julia_slot(fld2, fldty), ctx);
Expand Down Expand Up @@ -5738,8 +5738,8 @@ extern "C" void jl_init_codegen(void)
mbuilder = new MDBuilder(getGlobalContext());

#ifdef LLVM37
m->setDataLayout(jl_ExecutionEngine->getDataLayout()->getStringRepresentation());
engine_module->setDataLayout(jl_ExecutionEngine->getDataLayout()->getStringRepresentation());
m->setDataLayout(jl_ExecutionEngine->getDataLayout().getStringRepresentation());
engine_module->setDataLayout(jl_ExecutionEngine->getDataLayout().getStringRepresentation());
m->setTargetTriple(jl_TargetMachine->getTargetTriple().str());
engine_module->setTargetTriple(jl_TargetMachine->getTargetTriple().str());
#elif LLVM36
Expand Down

0 comments on commit 328a752

Please sign in to comment.