================
@@ -468,15 +505,49 @@ void DataSharingProcessor::doPrivatize(const 
semantics::Symbol *sym,
   lower::SymbolBox hsb = converter.lookupOneLevelUpSymbol(*sym);
   assert(hsb && "Host symbol box not found");
 
-  mlir::Type symType = hsb.getAddr().getType();
+  mlir::Value privVal = hsb.getAddr();
+  mlir::Type allocType;
+  if (mlir::isa<fir::PointerType>(privVal.getType()))
+    allocType = privVal.getType();
+  else
+    allocType = fir::unwrapRefType(privVal.getType());
+
   mlir::Location symLoc = hsb.getAddr().getLoc();
   std::string privatizerName = sym->name().ToString() + ".privatizer";
   bool isFirstPrivate = sym->test(semantics::Symbol::Flag::OmpFirstPrivate);
 
+  if (auto poly = mlir::dyn_cast<fir::ClassType>(allocType)) {
+    if (!mlir::isa<fir::PointerType>(poly.getEleTy()) && isFirstPrivate)
+      TODO(symLoc, "create polymorphic host associated copy");
+  }
----------------
tblah wrote:

Done in 
[7cb83e3](https://github.com/llvm/llvm-project/pull/124019/commits/7cb83e335cfd25ab750e8c15c951dfb9198ac7a1)

https://github.com/llvm/llvm-project/pull/124019
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to