[flang-commits] [flang] [flang][Semantics][OpenMP] Check type of reduction variables (PR #94596)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Thu Jun 6 09:13:45 PDT 2024


================
@@ -2378,6 +2378,89 @@ bool OmpStructureChecker::CheckIntrinsicOperator(
   return false;
 }
 
+static bool isReductionAllowedForType(
+    const parser::OmpClause::Reduction &x, const DeclTypeSpec *type) {
+  assert(type && "no type for reduction symbol");
----------------
klausler wrote:

Semantics uses a `CHECK()` macro.  But maybe you'd be better off passing a reference rather than a pointer.  Use `DEREF()` to check a pointer and turn it into a reference if you're confident that the pointer will never be null, even in an erroneous program.

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


More information about the flang-commits mailing list