This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Parsing and sema support for map clause
ClosedPublic

Authored by kkwli0 on Oct 27 2015, 3:15 PM.

Details

Summary

This patch is to add parsing and sema support for map clause. This includes the new map types and the map type modifier added in OpenMP 4.5.

Diff Detail

Event Timeline

kkwli0 updated this revision to Diff 38601.Oct 27 2015, 3:15 PM
kkwli0 retitled this revision from to [OpenMP] Parsing and sema support for map clause.
kkwli0 updated this object.
kkwli0 added a subscriber: cfe-commits.
ABataev added inline comments.Nov 10 2015, 12:05 PM
include/clang/AST/OpenMPClause.h
2628

I don't like the idea of friend Sema. If Sema needs some interfaces, they must be public.

include/clang/Basic/OpenMPKinds.h
83

This must be the last element in enum.

87

Remove this one, it is not required

include/clang/Sema/Sema.h
8013–8014

I think DepLinLoc and MapLoc can joined into one argument, like DepLinMapLoc

lib/AST/StmtPrinter.cpp
853–854

I think MapType can be optional, just like MapTypeModifier

856–858

Better to use ranged for, if possible

lib/Parse/ParseOpenMP.cpp
780–781

These two can be joined

lib/Sema/SemaOpenMP.cpp
7482–7484

Use ranged loop and do not use noload version.

7503–7505

Ranged loop

7507–7509

Braces are not needed

7522–7524

Extra braces

7636–7638

Extra braces

test/OpenMP/target_map_messages.cpp
1

Tests for templates, serialization/deserialization, AST printing, region nesting

kkwli0 marked 13 inline comments as done.Nov 11 2015, 2:16 PM
kkwli0 updated this revision to Diff 40176.Nov 13 2015, 2:12 PM

Update the patch after the first review.

ABataev added inline comments.Nov 17 2015, 5:52 AM
include/clang/AST/OpenMPClause.h
2660–2662

Not all important arguments are described

2683–2686

Not all important arguments are described

lib/Basic/OpenMPKinds.cpp
199

Extra spaces between arg and ')'

lib/Sema/SemaOpenMP.cpp
318–342

Tmp is bad name.

test/OpenMP/target_data_ast_print.cpp
1 ↗(On Diff #40176)

Also add tests for templates, serialization/deserialization

test/OpenMP/target_map_messages.cpp
3

Still no tests for templates

kkwli0 marked 6 inline comments as done.Nov 18 2015, 11:30 AM

Address the comments and will post an updated patch.

kkwli0 updated this revision to Diff 40537.Nov 18 2015, 11:53 AM

Updated patch with the 2nd review comments addressed.

ABataev accepted this revision.Nov 20 2015, 2:48 AM
ABataev edited edge metadata.

LG

This revision is now accepted and ready to land.Nov 20 2015, 2:48 AM
kkwli0 closed this revision.Nov 22 2015, 9:42 PM

Committed revision 253849.
Committed revision 253850.