Skip to content

[Flang][OpenMP] Update relevant warnings to emit when OMP >= v5.2 #144492

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Stylie777
Copy link
Contributor

There has been a number of deprecation warnings that have been added to Flang, however these features are only deprecated when the OpenMP Version being used is 5.2 or later. Previously, flang did not consider the version with the warnings so would always be emitted.

Flang now ensures warnings are emitted for the appropriate version of OpenMP, and tests are updated to reflect this change.

Copy link
Contributor

@tblah tblah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe IssueNonConformanceWarning should have an argument specifying the minimum version to warn on? That way this can not be forgotten in the future

@Stylie777
Copy link
Contributor Author

Thanks for the suggestion @tblah, I had avoided doing the version check inside the function to avoid a potentially needed function call, but this approach would be more robust so I will rework the implementation to do this.

Copy link
Contributor

@tblah tblah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nits fixed. Previous discussion was here: #142378 (review)

Edit: see failing test - this does look relevant.

void IssueNonConformanceWarning(
llvm::omp::Directive D, parser::CharBlock source);
void IssueNonConformanceWarning(llvm::omp::Directive D,
parser::CharBlock source, unsigned emit_from_version);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
parser::CharBlock source, unsigned emit_from_version);
parser::CharBlock source, unsigned emitFromVersion);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

void OmpAttributeVisitor::IssueNonConformanceWarning(
llvm::omp::Directive D, parser::CharBlock source) {
void OmpAttributeVisitor::IssueNonConformanceWarning(llvm::omp::Directive D,
parser::CharBlock source, unsigned emit_from_version) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
parser::CharBlock source, unsigned emit_from_version) {
parser::CharBlock source, unsigned emitFromVersion) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

There has been a number of deprecation warnings that have been
added to Flang, however these features are only deprecated when
the OpenMP Version being used is 5.2 or later. Previously, flang
did not consider the version with the warnings so would always be
emitted.

Flang now ensures warnings are emitted for the appropriate
version of OpenMP, and tests are updated to reflect this change.
@Stylie777 Stylie777 force-pushed the deprecation_warnings_omp_5_2 branch from 23ab4b3 to 2846d90 Compare June 17, 2025 10:33
@Stylie777
Copy link
Contributor Author

The test failure is related yes, new test that was added while I was away so this has been updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants