[flang-commits] [flang] Adding warning for Master as it is deprecated in 5.2 (PR #98955)
Michael Klemm via flang-commits
flang-commits at lists.llvm.org
Tue Jul 16 15:20:21 PDT 2024
================
@@ -2758,4 +2758,22 @@ void OmpAttributeVisitor::AddOmpRequiresToScope(Scope &scope,
} while (!scopeIter->IsGlobal());
}
+void OmpAttributeVisitor::IssueNonConformanceWarning(
+ llvm::omp::Directive D, parser::CharBlock source) {
+ std::string warnStr = "";
+ std::string dirName = llvm::omp::getOpenMPDirectiveName(D).str();
+ switch (D) {
+ case llvm::omp::OMPD_master:
+ warnStr = "OpenMP directive " + dirName +
+ " has been deprecated, please use masked instead.";
+ break;
+ case llvm::omp::OMPD_target_loop:
+ default:
+ warnStr = "Usage of directive " + dirName +
+ "is non-confirming to OpenMP standard.";
----------------
mjklemm wrote:
Please only commit this suggestion, if the warning is only hit for deprecated OpenMP directives.
Nit: In any case there's a missing space after the directive name and I would suggest to enclose the directive names in single quotes.
https://github.com/llvm/llvm-project/pull/98955
More information about the flang-commits
mailing list