[flang] Retrieve the correct scope when lowering SELECT TYPE
authorValentin Clement <clementval@gmail.com>
Thu, 16 Feb 2023 08:05:12 +0000 (09:05 +0100)
committerValentin Clement <clementval@gmail.com>
Thu, 16 Feb 2023 08:05:35 +0000 (09:05 +0100)
commitb0de87268a60e9e755b34b2fb505589e01aab14c
tree65cae1c1b4ceb3933524f537a16215d59328d8ed
parent86c8ea9ac92221076518586852d13d6a1f414777
[flang] Retrieve the correct scope when lowering SELECT TYPE

Scope to retrieve the associating entity is needed to map the
symbol to the IR value. The scope can be found with a source
information. For the type case in SELECT TYPE construct, the source
information is on the Statement<TypeCase>. This patch updates
the lowering so the scopes for each type guards is retrieved
before the processing.

Reviewed By: PeteSteinfeld, vdonaldson

Differential Revision: https://reviews.llvm.org/D144133
flang/lib/Lower/Bridge.cpp
flang/test/Lower/select-type.f90