[flang] Move various Instantiate functions to tools.cc
authorTim Keith <tkeith@nvidia.com>
Thu, 11 Jul 2019 01:20:27 +0000 (18:20 -0700)
committerTim Keith <tkeith@nvidia.com>
Thu, 11 Jul 2019 15:51:40 +0000 (08:51 -0700)
commitc37707a5b1d5076d043265e6fe8d9f174829974e
treebeedb338449a599cd67985dcfcdc77d4559da9e2
parentca06058da81b9111050cc9832cfced3ce5a0e3ac
[flang] Move various Instantiate functions to tools.cc

Move these functions from scope.cc, symbol.cc, type.cc into tools.cc:
  Scope::FindOrInstantiateDerivedType
  Scope::InstantiateDerivedType
  Scope::InstantiateIntrinsicType
  Symbol::Instantiate
  DerivedTypeSpec::ProcessParameterExpressions
  DerivedTypeSpec::Instantiate

This eliminates some dependencies in these files on SemanticsContext,
FoldingContext, etc.

It also allows three of the functions to be private to tools.cc
because they are only called from the others.

Original-commit: flang-compiler/f18@48c6efbf95390446fa10ca61b3e7f6b7db6c836d
Reviewed-on: https://github.com/flang-compiler/f18/pull/559
Tree-same-pre-rewrite: false
flang/lib/semantics/expression.cc
flang/lib/semantics/resolve-names.cc
flang/lib/semantics/scope.cc
flang/lib/semantics/scope.h
flang/lib/semantics/symbol.cc
flang/lib/semantics/symbol.h
flang/lib/semantics/tools.cc
flang/lib/semantics/tools.h
flang/lib/semantics/type.cc
flang/lib/semantics/type.h