[flang][NFC] Refactor derived type instantiation
authorTim Keith <tkeith@nvidia.com>
Wed, 22 Apr 2020 22:26:29 +0000 (15:26 -0700)
committerTim Keith <tkeith@nvidia.com>
Thu, 23 Apr 2020 15:29:47 +0000 (08:29 -0700)
commit9623003e9380e649bff0ebee3f11903ccf75af12
treeb4ffd1c819acb4d8da8afc2f14dc06c8270626a9
parentd8e1dd8b9b6554b750b6727a521c28b58ae79c1f
[flang][NFC] Refactor derived type instantiation

Summary:
Move InstantiateComponent and InstantiateIntrinsicType from symbol.cpp
to type.cpp as that is where they are called.

Put both in InstantiateHelper class to better isolate them.
Add CreateDerivedTypeSpec in InstantiateHelper.

Add non-const forms for AsIntrinsic and AsDerived to avoid const_cast.

No functional changes.

Reviewers: DavidTruby, klausler, PeteSteinfeld, jdoerfert

Reviewed By: klausler

Subscribers: llvm-commits

Tags: #flang, #llvm

Differential Revision: https://reviews.llvm.org/D78678
flang/include/flang/Semantics/symbol.h
flang/include/flang/Semantics/type.h
flang/lib/Semantics/symbol.cpp
flang/lib/Semantics/type.cpp