-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[flang][OpenMP] Parse iterators, add to MAP clause, TODO for lowering #113167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
e6c345a
4cf2b44
44c9884
a51febd
13d9cbe
c25df9a
ddc9c86
88af970
42c19a5
420305e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3424,7 +3424,17 @@ struct AssignedGotoStmt { | |||||
|
|
||||||
| WRAPPER_CLASS(PauseStmt, std::optional<StopCode>); | ||||||
|
|
||||||
| // Parse tree nodes for OpenMP 4.5 directives and clauses | ||||||
| // Parse tree nodes for OpenMP 4.5+ directives and clauses | ||||||
|
|
||||||
| // [5.0] 2.1.6 iterator-specifier -> type-declaration-stmt = subscript-triple | ||||||
| // iterator-modifier -> iterator-specifier-list | ||||||
| struct OmpIteratorSpecifier { | ||||||
| TUPLE_CLASS_BOILERPLATE(OmpIteratorSpecifier); | ||||||
| CharBlock source; | ||||||
| std::tuple<TypeDeclarationStmt, SubscriptTriplet> t; | ||||||
| }; | ||||||
|
|
||||||
| WRAPPER_CLASS(OmpIteratorModifier, std::list<OmpIteratorSpecifier>); | ||||||
|
|
||||||
| // 2.5 proc-bind-clause -> PROC_BIND (MASTER | CLOSE | SPREAD) | ||||||
| struct OmpProcBindClause { | ||||||
|
|
@@ -3450,16 +3460,25 @@ struct OmpObject { | |||||
| WRAPPER_CLASS(OmpObjectList, std::list<OmpObject>); | ||||||
|
|
||||||
| // 2.15.5.1 map -> | ||||||
| // MAP ([ [map-type-modifiers [,] ] map-type : ] variable-name-list) | ||||||
| // map-type-modifiers -> map-type-modifier [,] [...] | ||||||
| // MAP ([[map-type-modifier-list [,]] [iterator-modifier [,]] map-type : ] | ||||||
| // variable-name-list) | ||||||
| // map-type-modifier-list -> map-type-modifier [,] [...] | ||||||
| // map-type-modifier -> ALWAYS | CLOSE | PRESENT | OMPX_HOLD | ||||||
| // map-type -> TO | FROM | TOFROM | ALLOC | RELEASE | DELETE | ||||||
| struct OmpMapClause { | ||||||
| ENUM_CLASS(TypeModifier, Always, Close, Present, OmpxHold); | ||||||
| ENUM_CLASS(TypeModifier, Always, Close, Present, Ompx_Hold); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strictly speaking, I think this should be a separate commit (along with it's "friend" down below), as it is a minor fix for a previous change (from what I can tell).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The separate PR: #113366.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The "friend" below is only used in this PR. PRs introducing code that is not executed are frowned upon, unless they are in a stack. |
||||||
| ENUM_CLASS(Type, To, From, Tofrom, Alloc, Release, Delete) | ||||||
| TUPLE_CLASS_BOILERPLATE(OmpMapClause); | ||||||
| std::tuple<std::optional<std::list<TypeModifier>>, std::optional<Type>, | ||||||
| OmpObjectList> | ||||||
|
|
||||||
| // All modifiers are parsed into optional lists, even if they are unique. | ||||||
| // The checks for satisfying those constraints are deferred to semantics. | ||||||
| // In OpenMP 5.2 the non-comma syntax has been deprecated: keep the | ||||||
| // information about separator presence to emit a diagnostic if needed. | ||||||
| std::tuple<std::optional<std::list<TypeModifier>>, | ||||||
| std::optional<std::list<OmpIteratorModifier>>, // unique | ||||||
| std::optional<std::list<Type>>, // unique | ||||||
| OmpObjectList, | ||||||
| bool> // were the modifiers comma-separated | ||||||
|
||||||
| bool> // were the modifiers comma-separated | |
| bool> // where the modifiers comma-separated? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually "Were they comma-separated or not?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah "were" is correct. Question mark would be good! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is a general update then may be saying OpenMP 5.2 is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.