-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[flang][OpenMP] Parsing support for map type modifiers #111860
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
Merged
kparzysz
merged 7 commits into
llvm:main
from
kparzysz:users/kparzysz/omp-present-map-parse
Oct 11, 2024
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
424475c
[flang][OpenMP] Parsing support for map type modifiers
kparzysz 4e3c975
clang-format
kparzysz 0d20947
more format
kparzysz 2c74157
pacify msvc
kparzysz 3447262
add todo testcases
kparzysz abf8e6e
add braces
kparzysz 254b3d3
add explanatory comment
kparzysz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2073,11 +2073,27 @@ class UnparseVisitor { | |
":"); | ||
Walk(std::get<OmpObjectList>(x.t)); | ||
} | ||
void Unparse(const OmpMapType::Always &) { Word("ALWAYS,"); } | ||
void Unparse(const OmpMapClause &x) { | ||
Walk(std::get<std::optional<OmpMapType>>(x.t), ":"); | ||
auto &typeMod = | ||
std::get<std::optional<std::list<OmpMapClause::TypeModifier>>>(x.t); | ||
auto &type = std::get<std::optional<OmpMapClause::Type>>(x.t); | ||
Walk(typeMod); | ||
if (typeMod.has_value() && type.has_value()) { | ||
Put(", "); | ||
} | ||
Walk(type); | ||
if (typeMod.has_value() || type.has_value()) { | ||
Put(": "); | ||
} | ||
Walk(std::get<OmpObjectList>(x.t)); | ||
} | ||
void Unparse(const OmpMapClause::TypeModifier &x) { | ||
if (x == OmpMapClause::TypeModifier::OmpxHold) { | ||
Word("OMPX_HOLD"); | ||
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. Why is this a special case? 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. Because the enum name is "OmpxHold". The EnumToString returns "OMPXHOLD" for it, but it needs the underscore. |
||
} else { | ||
Word(OmpMapClause::EnumToString(x)); | ||
} | ||
} | ||
void Unparse(const OmpScheduleModifier &x) { | ||
Walk(std::get<OmpScheduleModifier::Modifier1>(x.t)); | ||
Walk(",", std::get<std::optional<OmpScheduleModifier::Modifier2>>(x.t)); | ||
|
@@ -2775,7 +2791,6 @@ class UnparseVisitor { | |
WALK_NESTED_ENUM(OmpScheduleModifierType, ModType) // OMP schedule-modifier | ||
WALK_NESTED_ENUM(OmpLinearModifier, Type) // OMP linear-modifier | ||
WALK_NESTED_ENUM(OmpDependenceType, Type) // OMP dependence-type | ||
WALK_NESTED_ENUM(OmpMapType, Type) // OMP map-type | ||
WALK_NESTED_ENUM(OmpScheduleClause, ScheduleType) // OMP schedule-type | ||
WALK_NESTED_ENUM(OmpDeviceClause, DeviceModifier) // OMP device modifier | ||
WALK_NESTED_ENUM(OmpDeviceTypeClause, Type) // OMP DEVICE_TYPE | ||
|
@@ -2785,6 +2800,7 @@ class UnparseVisitor { | |
WALK_NESTED_ENUM(OmpCancelType, Type) // OMP cancel-type | ||
WALK_NESTED_ENUM(OmpOrderClause, Type) // OMP order-type | ||
WALK_NESTED_ENUM(OmpOrderModifier, Kind) // OMP order-modifier | ||
WALK_NESTED_ENUM(OmpMapClause, Type) // OMP map-type | ||
#undef WALK_NESTED_ENUM | ||
void Unparse(const ReductionOperator::Operator x) { | ||
switch (x) { | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you add a test for the TODO?
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