[flang] Don't add a source range to a type instantiation's scope
authorPeter Klausler <pklausler@nvidia.com>
Wed, 15 Feb 2023 19:11:54 +0000 (11:11 -0800)
committerPeter Klausler <pklausler@nvidia.com>
Wed, 15 Feb 2023 20:05:12 +0000 (12:05 -0800)
commitee437afa912b2608dad783225ec8e98d98f5a084
tree5b61292fb0a4c276bcfc3bbf196859916f8492f0
parent6f3e6a765a9e9ba4fa6a991980355b0ef9007052
[flang] Don't add a source range to a type instantiation's scope

A type instantiation's scope doesn't require a source range, as we don't
need/want it to be the result of SemanticsContext::FindScope(), and
adding the original type's source range to the scope of one of its
instantiations has the side effect of expanding the source range of
all of its parents to include the original type definition, which
breaks FindScope() for any scope including a type instantiation.

Differential Revision: https://reviews.llvm.org/D144129
flang/lib/Semantics/type.cpp