[flang-commits] [PATCH] D87906: [Flang][OpenACC] Fix for branching out issue in OpenACC parallel construct.

sameeran joshi via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Oct 9 03:11:56 PDT 2020


sameeranjoshi added a comment.

In D87906#2319931 <https://reviews.llvm.org/D87906#2319931>, @clementval wrote:

> @sameeranjoshi Do you have time to address latest review comments?

Sorry for holding this for a long, I was trying to solve unknown regressions with respect to `check-do-forall.cpp` after the current suggested set of changes.

See issue mentioned inline.



================
Comment at: flang/lib/Semantics/tools.cpp:1337
+                    },
+      construct);
+}
----------------
tskeith wrote:
> The call to `common::GetPtrFromOptional` could be moved outside of `std::visit` so that it doesn't have to be repeated in each lambda.
> 
> Even better might be to change the return type to `const <std::optional<parser::Name>> &`. Is there any reason to convert it to a pointer?
My knowledge of modern cpp seemed to pull me back.
I tried various different ways to return `const std::optional<parser::Name> &`, all resulting in either seg-fault or unknown regressions in fortran loops.
I have managed to do this change using a `return-by-value` and not `return-by-reference`.
If these changes still need to be modified, some suggestions on using a return-by-reference would be helpful.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87906/new/

https://reviews.llvm.org/D87906



More information about the flang-commits mailing list