[flang] [llvm] [flang][OpenMP] Overhaul implementation of ATOMIC construct (PR #137852)
Tom Eccles via llvm-commits
llvm-commits at lists.llvm.org
Wed May 28 10:19:08 PDT 2025
================
@@ -777,5 +777,22 @@ inline bool checkForSymbolMatch(const Fortran::semantics::SomeExpr *lhs,
}
return false;
}
+
+/// If the top-level operation (ignoring parentheses) is either an
+/// evaluate::FunctionRef, or a specialization of evaluate::Operation,
+/// then return the list of arguments (wrapped in SomeExpr). Otherwise,
+/// return the "expr" but with top-level parentheses stripped.
+std::vector<SomeExpr> GetOpenMPTopLevelArguments(const SomeExpr &expr);
+
+/// Check if expr is same as x, or a sequence of Convert operations on x.
+bool IsSameOrConvertOf(const SomeExpr &expr, const SomeExpr &x);
+
+/// Strip away any top-level Convert operations (if any exist) and return
+/// the input value. A ComplexConstructor(x, 0) is also considered as a
+/// convert operation.
+/// If the input is not Operation, Designator, FunctionRef or Constant,
+/// is returns std::nullopt.
+MaybeExpr GetConvertInput(const SomeExpr &x);
+
----------------
tblah wrote:
Should these be defined in tools.cpp not check-omp-structure.cpp?
https://github.com/llvm/llvm-project/pull/137852
More information about the llvm-commits
mailing list