summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorSamuel Antao <sfantao@us.ibm.com>2016-01-19 20:40:49 +0000
committerSamuel Antao <sfantao@us.ibm.com>2016-01-19 20:40:49 +0000
commit23abd726e66f44bf1f59c8c23830dd3ea4242b23 (patch)
treea3aba04470b2dd1b0478653024869470a8d2e8ff /clang/lib/AST
parent311f27c0a8f637cdbc46c5ccf7f9e59854503788 (diff)
downloadbcm5719-llvm-23abd726e66f44bf1f59c8c23830dd3ea4242b23.tar.gz
bcm5719-llvm-23abd726e66f44bf1f59c8c23830dd3ea4242b23.zip
[OpenMP] Detect implicit map type to report unspecified map type for target enter/exit data directives.
Support for the following OpenMP 4.5 restriction on 'target enter data' and 'target exit data': - A map-type must be specified in all map clauses. I have to save 'IsMapTypeImplicit' when parsing a map clause to support this constraint and for more informative error messages. This helps me support the following case: #pragma omp target enter data map(r) // expected-error {{map type must be specified for '#pragma omp target enter data'}} and distinguish it from: #pragma omp target enter data map(tofrom: r) // expected-error {{map type 'tofrom' is not allowed for '#pragma omp target enter data'}} Patch by Arpith Jacob. Thanks! llvm-svn: 258179
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/OpenMPClause.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/AST/OpenMPClause.cpp b/clang/lib/AST/OpenMPClause.cpp
index 1ef43f7694c..1d1da53732d 100644
--- a/clang/lib/AST/OpenMPClause.cpp
+++ b/clang/lib/AST/OpenMPClause.cpp
@@ -400,10 +400,12 @@ OMPMapClause *OMPMapClause::Create(const ASTContext &C, SourceLocation StartLoc,
SourceLocation EndLoc, ArrayRef<Expr *> VL,
OpenMPMapClauseKind TypeModifier,
OpenMPMapClauseKind Type,
+ bool TypeIsImplicit,
SourceLocation TypeLoc) {
void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
- OMPMapClause *Clause = new (Mem) OMPMapClause(
- TypeModifier, Type, TypeLoc, StartLoc, LParenLoc, EndLoc, VL.size());
+ OMPMapClause *Clause =
+ new (Mem) OMPMapClause(TypeModifier, Type, TypeIsImplicit, TypeLoc,
+ StartLoc, LParenLoc, EndLoc, VL.size());
Clause->setVarRefs(VL);
Clause->setMapTypeModifier(TypeModifier);
Clause->setMapType(Type);
OpenPOWER on IntegriCloud