This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Detect implicit map type to report unspecified map type for target enter/exit data directives.
ClosedPublic

Authored by arpith-jacob on Jan 17 2016, 2:14 PM.

Details

Summary

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'}}

Diff Detail

Event Timeline

arpith-jacob retitled this revision from to [OpenMP] Detect implicit map type to report unspecified map type for target enter/exit data directives..
arpith-jacob updated this object.
ABataev added inline comments.Jan 17 2016, 9:30 PM
lib/Sema/SemaOpenMP.cpp
8586

Do not cast bool to unsigned, use (IsMapTypeImplicit ? 1 : 0) instead

8602

The same

Addressed comment:
Do not cast bool to unsigned, use (IsMapTypeImplicit ? 1 : 0) instead.

arpith-jacob marked 2 inline comments as done.Jan 18 2016, 6:38 PM
ABataev accepted this revision.Jan 18 2016, 8:33 PM
ABataev edited edge metadata.
This revision is now accepted and ready to land.Jan 18 2016, 8:33 PM
sfantao closed this revision.Jan 19 2016, 12:45 PM
sfantao edited edge metadata.

Committed revision 258179.

Thanks,
Samuel