[flang-commits] [flang] [mlir] [Flang][MLIR][OpenMP] Allow setting OMP_MAP_PTR_AND_OBJ by frontends (PR #84328)

Krzysztof Parzyszek via flang-commits flang-commits at lists.llvm.org
Thu Mar 7 07:40:17 PST 2024


================
@@ -1820,6 +1820,18 @@ uint64_t getArrayElementSizeInBits(LLVM::LLVMArrayType arrTy, DataLayout &dl) {
   return dl.getTypeSizeInBits(arrTy.getElementType());
 }
 
+// This may be a bit of a naive check, the intent is to verify if the
+// mapped data being passed is a pointer -> pointee that requires special
+// handling in certain cases. There may be a better way to verify this, but
+// unfortunately with opaque pointers we lose the ability to easily check if
+// something is a pointer whilst maintaining access to the underlying type.
+static bool checkIfPointerMap(llvm::omp::OpenMPOffloadMappingFlags mapFlag) {
+  return static_cast<
+             std::underlying_type_t<llvm::omp::OpenMPOffloadMappingFlags>>(
+             mapFlag &
+             llvm::omp::OpenMPOffloadMappingFlags::OMP_MAP_PTR_AND_OBJ) != 0;
----------------
kparzysz wrote:

Please break it up, it's hard to see what's going on here at the first glance.

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


More information about the flang-commits mailing list