-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[flang][OpenMP] Sema checks, lowering with new format of MAP modifiers #149137
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 all commits
0929234
acc1a7d
0733ec1
a7476b1
a3459e4
faff0d3
17ad478
724cc83
3886bbc
20bc435
7d232c5
dd339d6
658101b
20c7591
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 |
---|---|---|
|
@@ -27,7 +27,8 @@ class CanonicalizationOfOmp { | |
public: | ||
template <typename T> bool Pre(T &) { return true; } | ||
template <typename T> void Post(T &) {} | ||
CanonicalizationOfOmp(parser::Messages &messages) : messages_{messages} {} | ||
CanonicalizationOfOmp(SemanticsContext &context) | ||
: context_{context}, messages_{context.messages()} {} | ||
|
||
void Post(parser::Block &block) { | ||
for (auto it{block.begin()}; it != block.end(); ++it) { | ||
|
@@ -401,6 +402,11 @@ class CanonicalizationOfOmp { | |
// if the specified OpenMP version is less than 6.0, rewrite the affected | ||
// modifiers back into the pre-6.0 forms. | ||
void CanonicalizeMapModifiers(parser::OmpMapClause &map) { | ||
unsigned version{context_.langOptions().OpenMPVersion}; | ||
if (version >= 60) { | ||
return; | ||
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. Should we warn about the new map modifiers being used with older versions? 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 OmpValidateModifiiers function should be doing that. I can add a testcase for that. |
||
} | ||
|
||
// Omp{Always, Close, Present, xHold}Modifier -> OmpMapTypeModifier | ||
// OmpDeleteModifier -> OmpMapType | ||
using Modifier = parser::OmpMapClause::Modifier; | ||
|
@@ -432,12 +438,13 @@ class CanonicalizationOfOmp { | |
// same construct. This is for converting utility constructs to executable | ||
// constructs. | ||
std::map<parser::SpecificationPart *, parser::Block *> blockForSpec_; | ||
SemanticsContext &context_; | ||
parser::Messages &messages_; | ||
}; | ||
|
||
bool CanonicalizeOmp(parser::Messages &messages, parser::Program &program) { | ||
CanonicalizationOfOmp omp{messages}; | ||
bool CanonicalizeOmp(SemanticsContext &context, parser::Program &program) { | ||
CanonicalizationOfOmp omp{context}; | ||
Walk(program, omp); | ||
return !messages.AnyFatalError(); | ||
return !context.messages().AnyFatalError(); | ||
} | ||
} // namespace Fortran::semantics |
Uh oh!
There was an error while loading. Please reload this page.
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.
This adds a use of
SemanticContext
without including its header file. This means the build was failing when precompiled headers are disabled.See https://lab.llvm.org/staging/#/builders/36/builds/21866
Fixed in 0586067