From 0842b82eca31d9370f1113dfad07a70b6360c583 Mon Sep 17 00:00:00 2001 From: Andrey Guskov Date: Fri, 24 Apr 2015 15:51:55 +0300 Subject: [PATCH] Fix typos in the previous LLVM debug info commit --- ctx.cpp | 8 +++++++- type.cpp | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) 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: {