[Flang][OpenMP] Fix when the toplevel unit is present in declare target
authorKiran Chandramohan <kiran.chandramohan@arm.com>
Tue, 21 Feb 2023 15:39:19 +0000 (15:39 +0000)
committerKiran Chandramohan <kiran.chandramohan@arm.com>
Tue, 21 Feb 2023 16:01:58 +0000 (16:01 +0000)
commit5789bcc92e93ae54ce9253c12f2b2850cc3501dd
tree80ebd3f9590e5a677a3fe9798da2e02f887ff9be
parent5f928a223ef2c14701eab3077a534c1e49269a51
[Flang][OpenMP] Fix when the toplevel unit is present in declare target

If the toplevel unit is present in a declare target construct, do not
try to again find the enclosing construct.
Patch also re-arranges the checks.

Reviewed By: peixin

Differential Revision: https://reviews.llvm.org/D144264
flang/lib/Semantics/check-omp-structure.cpp
flang/test/Semantics/OpenMP/omp-declare-target03.f90