This patch adds parser support for defaultmap clause [OpenMP 5.0].
Details
Diff Detail
Event Timeline
Thanks @do for this patch. I have two comments.
- I think the linux CI is failing since the patch is not formatted. Can you run clang-format on the two source files (flang/include/flang/Parser/parse-tree.h, flang/lib/Parser/openmp-parsers.cpp)? Since we build clang also along with flang you likely have clang-format as well in your bin.
./bin/clang-format -i <path-to-filename>
- Can you also add a parse-tree dump test similar to what is in the following file? This is just to check that the parse-tree created is correct and it is easier for the reviewers to see the parse-tree.
https://github.com/llvm/llvm-project/blob/main/flang/test/Parser/omp-sections.f90
flang/lib/Parser/openmp-parsers.cpp | ||
---|---|---|
54–59 | Will do. Thanks. |
flang/test/Parser/omp-defaultmap-unparse.f90 | ||
---|---|---|
35–56 ↗ | (On Diff #425719) | Nit: For the unparse tests only the relevant section is required. You can remove the checks for the rest from all the tests. !PARSE-TREE: OmpBeginBlockDirective !PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target !PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause !PARSE-TREE: ImplicitBehavior = Tofrom !PARSE-TREE: VariableCategory = Scalar |
254–279 ↗ | (On Diff #425719) | Nit: I think you can move these entries also close to the individual tests. |
flang/test/Parser/omp-defaultmap-unparse.f90 | ||
---|---|---|
42–55 ↗ | (On Diff #425737) | @do I meant you can remove the check for Block and OmpEndBlockDirective and just have the following. !PARSE-TREE: OmpBeginBlockDirective !PARSE-TREE: OmpBlockDirective -> llvm::omp::Directive = target !PARSE-TREE: OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause !PARSE-TREE: ImplicitBehavior = Tofrom !PARSE-TREE: VariableCategory = Scalar |
flang/include/flang/Parser/parse-tree.h | ||
---|---|---|
3346 ↗ | (On Diff #425020) | This change is missed. |
@do I am trying to land this patch for you as you suggested, but I need your email address to make you the author of this patch. I believe this patch was uploaded via the web interface and so it doesn't have your email address tied to it.