diff --git a/src/ccall.cpp b/src/ccall.cpp index 4e2453c672b2e..5ff0e2bd3e260 100644 --- a/src/ccall.cpp +++ b/src/ccall.cpp @@ -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()) { diff --git a/src/cgutils.cpp b/src/cgutils.cpp index 41a99a0694670..070e0c0c80fdb 100644 --- a/src/cgutils.cpp +++ b/src/cgutils.cpp @@ -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(strct.V->getType()->getScalarType())->getElementType(), - strct, 0, idx); + strct.V, 0, idx); # else Value *addr = builder.CreateConstInBoundsGEP2_32(strct.V, 0, idx); # endif diff --git a/src/codegen.cpp b/src/codegen.cpp index 4c41be843af68..e20d399ce4402 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -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 @@ -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); @@ -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