[llvm-branch-commits] [flang] [Flang][OpenMP][MLIR] Initial derived type member map support (PR #82853)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Apr 24 11:38:53 PDT 2024


================
@@ -97,7 +269,7 @@ getOmpObjectSymbol(const Fortran::parser::OmpObject &ompObject) {
             if (auto *arrayEle =
                     Fortran::parser::Unwrap<Fortran::parser::ArrayElement>(
                         designator)) {
-              sym = GetFirstName(arrayEle->base).symbol;
+              sym = GetLastName(arrayEle->base).symbol;
----------------
agozillon wrote:

>From my understanding (and someone do please chime in if I am incorrect or misunderstanding), it will get the far right symbol, whereas previously it would get the far left symbol. 

So given the following:

dtype1%dtype2%array[2:10]

The getFirstName method would have retrieved "dtype1", not ideal as that's not what the ompObject is really referencing or what we care about in the case of unwrapping an array as it isn't the arrays symbol.

In the case of getLastName, we'd end up with "array", which is more what we'd expect.  

As we never really used constructs like this with getOmpObjectSymbol before (from what I can tell at least) it wasn't noticeable I believe. As for array[2:10] either getFirstName or getLastName will resolve to "array". 

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


More information about the llvm-branch-commits mailing list