[flang-commits] [flang] [flang][OpenMP] Fix construct privatization in default clause (PR #72510)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Mon Apr 15 07:20:18 PDT 2024


================
@@ -268,21 +268,39 @@ void DataSharingProcessor::insertLastPrivateCompare(mlir::Operation *op) {
   firOpBuilder.restoreInsertionPoint(localInsPt);
 }
 
+void DataSharingProcessor::collectSymbolsInNestedRegions(
+    Fortran::lower::pft::Evaluation &eval,
+    Fortran::semantics::Symbol::Flag flag,
+    llvm::SetVector<const Fortran::semantics::Symbol *>
+        &symbolsInNestedRegions) {
+  for (Fortran::lower::pft::Evaluation &nestedEval :
+       eval.getNestedEvaluations()) {
+    if (nestedEval.hasNestedEvaluations()) {
+      if (nestedEval.isConstruct())
+        // Recursively look for OpenMP constructs within `nestedEval`'s region
+        collectSymbolsInNestedRegions(nestedEval, flag, symbolsInNestedRegions);
+      else
+        converter.collectSymbolSet(nestedEval, symbolsInNestedRegions, flag,
+                                   /*collectSymbols=*/true,
+                                   /*collectHostAssociatedSymbols=*/false);
----------------
kiranchandramohan wrote:

Why is `collectHostAssociatedSymbols` `false` here? Is it because a previous invocation of collectSymbolSet has already collected it?

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


More information about the flang-commits mailing list