diff --git a/ctx.cpp b/ctx.cpp index bd9e9a5b..c15a866e 100644 --- a/ctx.cpp +++ b/ctx.cpp @@ -1667,7 +1667,13 @@ FunctionEmitContext::AddDebugPos(llvm::Value *value, const SourcePos *pos, // the standard library or the like; don't add debug positions // for those functions inst->setDebugLoc(llvm::DebugLoc::get(p.first_line, p.first_column, - scope ? scope : GetDIScope())); + scope ? +#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6) + *scope +#else // LLVM 3.7++ + scope +#endif + : GetDIScope())); } } diff --git a/type.cpp b/type.cpp index b84b94b9..5ca1da88 100644 --- a/type.cpp +++ b/type.cpp @@ -1276,10 +1276,11 @@ llvm::MDType *PointerType::GetDIType(llvm::MDScope *scope) const { case Variability::Varying: { // emit them as an array of pointers #if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6) + llvm::DIType eltType = #else //LLVM 3.7++ llvm::MDDerivedType *eltType = - m->diBuilder->createPointerType(diTargetType, bitsSize, ptrAlignBits); #endif + m->diBuilder->createPointerType(diTargetType, bitsSize, ptrAlignBits); return lCreateDIArray(eltType, g->target->getVectorWidth()); } case Variability::SOA: {