-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[flang][OpenMP] Extract OMP version hint into helper functions, NFC #113621
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
Conversation
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
Parse the locator list in OmpDependClause as an OmpObjectList (instead of a list of Designators). When a common block appears in the locator list, show an informative message. Implement resolving symbols in DependSinkVec in a dedicated visitor instead of having a visitor for OmpDependClause. Resolve unresolved names common blocks in OmpObjectList. Minor changes to the code organization: - rename OmpDependenceType to OmpTaskDependenceType (to follow 5.2 terminology), - rename Depend::WithLocators to Depend::DepType, - add comments with more detailed spec references to parse-tree.h.
Member
|
@llvm/pr-subscribers-flang-openmp @llvm/pr-subscribers-flang-semantics Author: Krzysztof Parzyszek (kparzysz) ChangesFull diff: https://github.com/llvm/llvm-project/pull/113621.diff 1 Files Affected:
diff --git a/flang/lib/Semantics/check-omp-structure.cpp b/flang/lib/Semantics/check-omp-structure.cpp
index 892745c9c36b6b..e9a2fcecd9efe6 100644
--- a/flang/lib/Semantics/check-omp-structure.cpp
+++ b/flang/lib/Semantics/check-omp-structure.cpp
@@ -38,6 +38,16 @@ namespace Fortran::semantics {
CheckAllowedClause(llvm::omp::Y); \
}
+std::string ThisVersion(unsigned version) {
+ std::string tv{
+ std::to_string(version / 10) + "." + std::to_string(version % 10)};
+ return "OpenMP v" + tv;
+}
+
+std::string TryVersion(unsigned version) {
+ return "try -fopenmp-version=" + std::to_string(version);
+}
+
// 'OmpWorkshareBlockChecker' is used to check the validity of the assignment
// statements and the expressions enclosed in an OpenMP Workshare construct
class OmpWorkshareBlockChecker {
@@ -200,14 +210,10 @@ bool OmpStructureChecker::CheckAllowedClause(llvmOmpClause clause) {
auto clauseName{parser::ToUpperCaseLetters(getClauseName(clause).str())};
auto dirName{parser::ToUpperCaseLetters(getDirectiveName(dir).str())};
- std::string thisVersion{
- std::to_string(version / 10) + "." + std::to_string(version % 10)};
- std::string goodVersion{std::to_string(allowedInVersion)};
-
context_.Say(dirCtx.clauseSource,
- "%s clause is not allowed on directive %s in OpenMP v%s, "
- "try -fopenmp-version=%d"_err_en_US,
- clauseName, dirName, thisVersion, allowedInVersion);
+ "%s clause is not allowed on directive %s in %s, %s"_err_en_US,
+ clauseName, dirName, ThisVersion(version),
+ TryVersion(allowedInVersion));
}
}
return CheckAllowed(clause);
@@ -3373,8 +3379,8 @@ void OmpStructureChecker::Enter(const parser::OmpClause::Lastprivate &x) {
std::to_string(version / 10) + "." + std::to_string(version % 10)};
context_.Say(GetContext().clauseSource,
"LASTPRIVATE clause with CONDITIONAL modifier is not "
- "allowed in OpenMP v%s, try -fopenmp-version=%d"_err_en_US,
- thisVersion, allowedInVersion);
+ "allowed in %s, %s"_err_en_US,
+ ThisVersion(version), TryVersion(allowedInVersion));
}
}
}
|
…kparzysz/spr/d02-flang-omp-hint
tblah
approved these changes
Oct 25, 2024
Base automatically changed from
users/kparzysz/spr/d01-flang-depend-update
to
main
October 28, 2024 21:06
NoumanAmir657
pushed a commit
to NoumanAmir657/llvm-project
that referenced
this pull request
Nov 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
No description provided.