[flang-commits] [flang] [Flang OpenMP] Add semantics checks for cray pointer usage in DSA list (PR #121028)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Thu Jan 2 06:57:40 PST 2025


================
@@ -4522,6 +4525,22 @@ void OmpStructureChecker::CheckProcedurePointer(
   }
 }
 
+void OmpStructureChecker::CheckCrayPointee(
+    const parser::OmpObjectList &objectList, llvm::StringRef clause) {
+  SymbolSourceMap symbols;
+  GetSymbolsInObjectList(objectList, symbols);
+  for (auto it{symbols.begin()}; it != symbols.end(); ++it) {
+    const auto *symbol{it->first};
+    const auto source{it->second};
+    if (symbol->test(Symbol::Flag::CrayPointee)) {
+      context_.Say(source,
+          "Cray Pointee '%s' may not appear in %s clause, use Cray Pointer '%s' instead"_err_en_US,
+          symbol->name(), clause.str(),
+          semantics::GetCrayPointer(*symbol).name());
----------------
tblah wrote:

@mjklemm is this a correct interpretation of the standard? It isn't clear to me if naming cray pointees is actually prohibited, it only seems to require that the data-sharing attribute is the same as the pointer.

Of course, they are deprecated so we could disallow on those grounds (as we did with `-` reductions).

https://github.com/llvm/llvm-project/pull/121028


More information about the flang-commits mailing list