[flang] OpenMP allocate directive parse tree fix
authorEthan Luis McDonough <ethanluismcdonough@gmail.com>
Fri, 5 May 2023 19:53:08 +0000 (14:53 -0500)
committerEthan Luis McDonough <ethanluismcdonough@gmail.com>
Fri, 5 May 2023 19:55:25 +0000 (14:55 -0500)
commit597d8563cd66f23d857196bf135a0c513115ece2
tree781e9d75b8d43dbc8f284f7bb4e81930b4890895
parent936d40cdb5c82ca74358b260dc69f7150209a81a
[flang] OpenMP allocate directive parse tree fix

Addresses the same issue as the following abandoned revision: D104391.

Rewrite leading declarative allocations so they are nested within their respective executable allocate directive

Original:
```
ExecutionPartConstruct -> OpenMPDeclarativeAllocate
ExecutionPartConstruct -> OpenMPDeclarativeAllocate
ExecutionPartConstruct -> OpenMPExecutableAllocate
```

After rewriting:
```
ExecutionPartConstruct -> OpenMPExecutableAllocate
| ExecutionPartConstruct -> OpenMPDeclarativeAllocate
| ExecutionPartConstruct -> OpenMPDeclarativeAllocate
```

Co-authored-by: Isaac Perry <isaac.perry@arm.com>
Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D148409
flang/lib/Parser/unparse.cpp
flang/lib/Semantics/canonicalize-omp.cpp
flang/lib/Semantics/resolve-directives.cpp
flang/test/Parser/OpenMP/allocate-tree-spec-part.f90 [new file with mode: 0644]
flang/test/Parser/OpenMP/allocate-tree.f90 [new file with mode: 0644]