diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2017-10-25 15:54:04 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2017-10-25 15:54:04 +0000 |
commit | 1596739a8b396239d79587ca47c17239e04e8fa2 (patch) | |
tree | 227fdc509c89ae78ea527a59a8089bfba9b8eedd /lib/Sema | |
parent | f5a3eef96117aae3537285eac87e375adab1e2ff (diff) | |
download | clang-1596739a8b396239d79587ca47c17239e04e8fa2.tar.gz |
[OPENMP] Improve debug info for taskgroup implicitly generated
expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316585 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaOpenMP.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp index 82e7967fb2..941ac75fa6 100644 --- a/lib/Sema/SemaOpenMP.cpp +++ b/lib/Sema/SemaOpenMP.cpp @@ -835,10 +835,10 @@ void DSAStackTy::addTaskgroupReductionData(ValueDecl *D, SourceRange SR, Expr *&TaskgroupReductionRef = Stack.back().first.back().TaskgroupReductionRef; if (!TaskgroupReductionRef) { - auto *VD = buildVarDecl(SemaRef, SourceLocation(), + auto *VD = buildVarDecl(SemaRef, SR.getBegin(), SemaRef.Context.VoidPtrTy, ".task_red."); - TaskgroupReductionRef = buildDeclRefExpr( - SemaRef, VD, SemaRef.Context.VoidPtrTy, SourceLocation()); + TaskgroupReductionRef = + buildDeclRefExpr(SemaRef, VD, SemaRef.Context.VoidPtrTy, SR.getBegin()); } } @@ -858,10 +858,10 @@ void DSAStackTy::addTaskgroupReductionData(ValueDecl *D, SourceRange SR, Expr *&TaskgroupReductionRef = Stack.back().first.back().TaskgroupReductionRef; if (!TaskgroupReductionRef) { - auto *VD = buildVarDecl(SemaRef, SourceLocation(), - SemaRef.Context.VoidPtrTy, ".task_red."); - TaskgroupReductionRef = buildDeclRefExpr( - SemaRef, VD, SemaRef.Context.VoidPtrTy, SourceLocation()); + auto *VD = buildVarDecl(SemaRef, SR.getBegin(), SemaRef.Context.VoidPtrTy, + ".task_red."); + TaskgroupReductionRef = + buildDeclRefExpr(SemaRef, VD, SemaRef.Context.VoidPtrTy, SR.getBegin()); } } @@ -9720,8 +9720,7 @@ static bool ActOnOMPReductionKindClause( // (type of the variable or single array element). PrivateTy = Context.getVariableArrayType( Type, - new (Context) OpaqueValueExpr(SourceLocation(), Context.getSizeType(), - VK_RValue), + new (Context) OpaqueValueExpr(ELoc, Context.getSizeType(), VK_RValue), ArrayType::Normal, /*IndexTypeQuals=*/0, SourceRange()); } else if (!ASE && !OASE && Context.getAsArrayType(D->getType().getNonReferenceType())) @@ -9803,8 +9802,7 @@ static bool ActOnOMPReductionKindClause( if (Type->isPointerType()) { // Cast to pointer type. auto CastExpr = S.BuildCStyleCastExpr( - SourceLocation(), Context.getTrivialTypeSourceInfo(Type, ELoc), - SourceLocation(), Init); + ELoc, Context.getTrivialTypeSourceInfo(Type, ELoc), ELoc, Init); if (CastExpr.isInvalid()) continue; Init = CastExpr.get(); @@ -9898,9 +9896,9 @@ static bool ActOnOMPReductionKindClause( S.BuildBinOp(Stack->getCurScope(), ReductionId.getLocStart(), BO_Assign, LHSDRE, ReductionOp.get()); } else { - auto *ConditionalOp = new (Context) ConditionalOperator( - ReductionOp.get(), SourceLocation(), LHSDRE, SourceLocation(), - RHSDRE, Type, VK_LValue, OK_Ordinary); + auto *ConditionalOp = new (Context) + ConditionalOperator(ReductionOp.get(), ELoc, LHSDRE, ELoc, RHSDRE, + Type, VK_LValue, OK_Ordinary); ReductionOp = S.BuildBinOp(Stack->getCurScope(), ReductionId.getLocStart(), BO_Assign, LHSDRE, ConditionalOp); @@ -10782,7 +10780,7 @@ Sema::ActOnOpenMPDependClause(OpenMPDependClauseKind DepKind, } bool Suppress = getDiagnostics().getSuppressAllDiagnostics(); getDiagnostics().setSuppressAllDiagnostics(/*Val=*/true); - ExprResult Res = CreateBuiltinUnaryOp(SourceLocation(), UO_AddrOf, + ExprResult Res = CreateBuiltinUnaryOp(ELoc, UO_AddrOf, RefExpr->IgnoreParenImpCasts()); getDiagnostics().setSuppressAllDiagnostics(Suppress); if (!Res.isUsable() && !isa<OMPArraySectionExpr>(SimpleExpr)) { |