[flang] preserve symbol in DescriptorInquiry
authorJean Perier <jperier@nvidia.com>
Thu, 17 Jun 2021 10:40:19 +0000 (12:40 +0200)
committerJean Perier <jperier@nvidia.com>
Thu, 17 Jun 2021 10:42:08 +0000 (12:42 +0200)
commit1a4af2e45ee59cff3d577986b9b7f3f5bd5ab01f
tree22d4144c91c3fe8f0144715c3b0c96a2aba84d87
parentb18f30fb2dd157e5fef91d9327fd12b8965e7e0c
[flang] preserve symbol in DescriptorInquiry

Do not use ultimate symbols in DescriptorInquiry. Using the ultimate
symbol may lead to issues later for at least two reasons:

- The original symbols may have volatile/asynchronous attributes that
  the ultimate may not have. Later phases working on the DescriptorInquiry
  would then not apply potential care required by these attributes.
- HostAssociatedDetails symbols are used by OpenMP for symbols with
  special OpenMP attributes inside OpenMP region (e.g variables with
  private attribute), so it is very important to preserve this
  aspect in the DescriptorInquiry, that would otherwise apply on the
  symbol outside of the region.

Differential Revision: https://reviews.llvm.org/D104385
flang/lib/Evaluate/shape.cpp
flang/lib/Evaluate/variable.cpp