summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2017-10-25 15:54:04 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2017-10-25 15:54:04 +0000
commitd070a585f617a2d37d24c6fcf31f2323f7dcc296 (patch)
tree73edb91c618fa81c4ba6b79fac23ea7c0c88aa2e /clang/lib
parentc551406ba263660352f3b84cbe0d85609666dd4e (diff)
downloadbcm5719-llvm-d070a585f617a2d37d24c6fcf31f2323f7dcc296.tar.gz
bcm5719-llvm-d070a585f617a2d37d24c6fcf31f2323f7dcc296.zip
[OPENMP] Improve debug info for taskgroup implicitly generated
expressions. llvm-svn: 316585
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaOpenMP.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 82e7967fb2b..941ac75fa66 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/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)) {
OpenPOWER on IntegriCloud