This is an archive of the discontinued LLVM Phabricator instance.

[Flang] [OpenMP] Add function for mapping OpenMP Parser clause classes with the corresponding clause kind
ClosedPublic

Authored by praveen on Mar 14 2021, 9:49 AM.

Details

Summary
  1. Generate the mapping for clauses between the parser class and the corresponding clause kind for OpenMP and OpenACC using tablegen.

2, Add a common function to get the OmpObjectList from the OpenMP clauses to avoid repetition of code.

Diff Detail

Event Timeline

praveen created this revision.Mar 14 2021, 9:49 AM
praveen requested review of this revision.Mar 14 2021, 9:49 AM
Herald added a project: Restricted Project. · View Herald Transcript
yhegde added a subscriber: yhegde.Mar 14 2021, 9:57 PM
clementval accepted this revision.Mar 15 2021, 10:56 AM

LGTM. Thanks for working on that. I'll probably make use of this in the OpenACC part where it makes sense.

flang/lib/Semantics/check-omp-structure.cpp
1460

We could maybe generate this list from TableGen as well since we have the information. Anyway doesn't need to be done in this patch.

This revision is now accepted and ready to land.Mar 15 2021, 10:56 AM

Thanks for this patch. Couple of nits.

flang/lib/Semantics/check-omp-structure.cpp
843–845

Nit: extra space?

llvm/utils/TableGen/DirectiveEmitter.cpp
652

Would it be possible to add a test in the following file?
test/TableGen/directive1.td

clementval added inline comments.Mar 15 2021, 5:10 PM
llvm/utils/TableGen/DirectiveEmitter.cpp
652

Right. I missed that point. +1

praveen updated this revision to Diff 331043.Mar 16 2021, 10:49 AM

Update test case directive1.td for TableGen changes

praveen marked 4 inline comments as done.Mar 16 2021, 10:56 AM

@kiranchandramohan @clementval Thanks for the review . I have updated the test case for the Tablegen changes.

The clang-tidy seems to identify the case style as invalid for this function name GenerateFlangClauseParserKindMap
Any changes required regarding this ? All other functions in the file DirectiveEmitter.cpp follows the same naming convention.

flang/lib/Semantics/check-omp-structure.cpp
1460

I have added this in TODO . Thanks

llvm/utils/TableGen/DirectiveEmitter.cpp
652

Updated the test file test/TableGen/directive1.td . Thanks

The clang-tidy seems to identify the case style as invalid for this function name GenerateFlangClauseParserKindMap
Any changes required regarding this ? All other functions in the file DirectiveEmitter.cpp follows the same naming convention.

Don't worry about this. All other TableGen backend follows this naming convention that's why we did it too.

praveen marked an inline comment as done.Mar 16 2021, 11:54 AM

The clang-tidy seems to identify the case style as invalid for this function name GenerateFlangClauseParserKindMap
Any changes required regarding this ? All other functions in the file DirectiveEmitter.cpp follows the same naming convention.

Don't worry about this. All other TableGen backend follows this naming convention that's why we did it too.

Thanks for the clarification. Will push the patch.

This revision was landed with ongoing or failed builds.Mar 16 2021, 11:53 PM
This revision was automatically updated to reflect the committed changes.