<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/60765>60765</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Flang][OpenMP] Support structure components and arrays in clauses
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            openmp,
            flang:ir
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          kiranchandramohan
      </td>
    </tr>
</table>

<pre>
    Some OpenMP clauses like `map` permit structure components and arrays. Some functions are currently not equipped to handle these cases and can cause ICE. https://github.com/llvm/llvm-project/blob/a8483b9b30385807790882b3b770fa6d016a0aa4/flang/lib/Lower/OpenMP.cpp#L44

Reproducers

```
integer :: arr(10)
!$omp target enter data map( to: arr(:))
end
```

```
  type s
    integer :: val
  end type s

  type(s) :: v

  !$omp target enter data map(to:v%val)
end
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU9uK5DgM_RrnRWzhKHEuD3mo7trAQi-7TH-BnKiqPJ3YHtvpof5-SKqrL0NDMxASpOgc6QgditGcLHMn1J1Qh4yWdHahezKB7HAmOwaa3Zlspt146R7dzPCfZ_vv_zBMtESOMJknBlHJmbyoJHgOs0kQU1iGtASGwc3eWbYpAtkRKAS6xB1sVMfFDsk4G4HWyiUEtmm6gHUJ-MdivOcRkoN1kIkhnTkyDLS2XbkGsjCsU8A_93_v4JySj6LYC-wF9ieTzoveDW4W2E_T8-3zlw_uOw9JYK8npwX21JRNoVtdyKJRjazrVjYN6kLXtTxSNcq8IklUCuyPE9nTSmRW4IP7yUFgf93IbvBeYPFQlkIehNxf39_YBzcuA4f4Pi0q-fJsobGJTxxgnb7Yr0sS2ORSYPtSjrnA0s0eEoUTJ2CbOMBIiWBdPDaQ3BtyW0L7imY7ftr10yRAuniGeIsAfhvumabbP7bjh-r3DAKbKLB9RX2s-FrQpudZoFr7faUkG7tibIuWMu7yqq7KSqm8yc4dSV2xrhWVlSKqZV0it21RkSx1fawxMx1KLCTmKkeVq2bXlO2xOba6aHVTlLoWpeSZzLRbj2fnwikzMS7cVbKuVDaR5ilu7kF0nu3sBaLAe4F4PZZib8KaUocsdNsB6uUURSknE1N8Y00mTZsN-w2mDkLdXQ9LqAM8Lt678KWvwNibMbMlTN0fW2LTFgX2m7xfAQAA__8Hnz4p">