/* Ċ Ġ* ĠCopyright Ġ 2 0 1 0 - 2 0 1 5 ĠJetBrains Ġs . r . o . Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġorg . jetbrains . kotlin . frontend . di Ċ Ċ import Ġorg . jetbrains . kotlin . container .* Ċ import Ġorg . jetbrains . kotlin . context . Lazy Resolve Token Ċ import Ġorg . jetbrains . kotlin . context . Module Context Ċ import Ġorg . jetbrains . kotlin . extensions . Storage Component Container Contributor Ċ import Ġorg . jetbrains . kotlin . incremental . components . Lookup Tracker Ċ import Ġorg . jetbrains . kotlin . resolve .* Ċ import Ġorg . jetbrains . kotlin . resolve . lazy .* Ċ import Ġorg . jetbrains . kotlin . resolve . lazy . declarations . Declaration Provider Factory Ċ import Ġorg . jetbrains . kotlin . types . expressions . Declaration Scope Provider For Local Classifier Analyzer Ċ import Ġorg . jetbrains . kotlin . types . expressions . Local Class Descriptor Holder Ċ import Ġorg . jetbrains . kotlin . types . expressions . Local Lazy Declaration Resolver Ċ Ċ fun ĠStorage Component Container . configure Module ( ĊĠĠĠĠĠĠĠ Ġmodule Context : ĠModule Context , Ġplatform : ĠTarget Platform Ċ ) Ġ{ ĊĠĠĠ Ġuse Instance ( module Context ) ĊĠĠĠ Ġuse Instance ( module Context . module ) ĊĠĠĠ Ġuse Instance ( module Context . project ) ĊĠĠĠ Ġuse Instance ( module Context . storage Manager ) ĊĠĠĠ Ġuse Instance ( module Context . built Ins ) ĊĠĠĠ Ġuse Instance ( module Context . platform To Kotlin Class Map ) ĊĊĠĠĠ Ġuse Instance ( platform ) ĊĊĠĠĠ Ġplatform . platform Configurator . configure ( this ) ĊĊĠĠĠ Ġfor Ġ( extension Ġin ĠStorage Component Container Contributor . get Instances ( module Context . project )) Ġ{ ĊĠĠĠĠĠĠĠ Ġextension . add Declarations ( this , Ġplatform ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġconfigure Platform In dependent Components () Ċ } Ċ Ċ private Ġfun ĠStorage Component Container . configure Platform In dependent Components () Ġ{ ĊĠĠĠ Ġuse Impl < Sup ertype Loop Checker Impl >() Ċ } Ċ Ċ fun ĠStorage Component Container . configure Module ( ĊĠĠĠĠĠĠĠ Ġmodule Context : ĠModule Context , Ġplatform : ĠTarget Platform , Ġtrace : ĠBinding Trace Ċ ) Ġ{ ĊĠĠĠ Ġconfigure Module ( module Context , Ġplatform ) ĊĠĠĠ Ġuse Instance ( trace ) Ċ } Ċ Ċ fun Ġcreate Container For Body Resolve ( ĊĠĠĠĠĠĠĠ Ġmodule Context : ĠModule Context , Ġbinding Trace : ĠBinding Trace , ĊĠĠĠĠĠĠĠ Ġplatform : ĠTarget Platform , Ġstatement Filter : ĠStatement Filter Ċ ): ĠStorage Component Container Ġ= Ġcreate Container (" Body Resolve ") Ġ{ ĊĠĠĠ Ġconfigure Module ( module Context , Ġplatform , Ġbinding Trace ) ĊĊĠĠĠ Ġuse Instance ( statement Filter ) ĊĊĠĠĠ Ġuse Instance ( Lookup Tracker . DO _ NOTH ING ) ĊĠĠĠ Ġuse Instance ( Body Resolve Cache . Throw Exception ) ĊĊĠĠĠ Ġuse Impl < Body Resolver >() Ċ } Ċ Ċ fun Ġcreate Container For Lazy Body Resolve ( ĊĠĠĠĠĠĠĠ Ġmodule Context : ĠModule Context , Ġkotlin Code Analyzer : ĠKotlin Code Analyzer , ĊĠĠĠĠĠĠĠ Ġbinding Trace : ĠBinding Trace , Ġplatform : ĠTarget Platform , ĊĠĠĠĠĠĠĠ Ġbody Resolve Cache : ĠBody Resolve Cache Ċ ): ĠStorage Component Container Ġ= Ġcreate Container (" Lazy Body Resolve ") Ġ{ ĊĠĠĠ Ġconfigure Module ( module Context , Ġplatform , Ġbinding Trace ) ĊĊĠĠĠ Ġuse Instance ( Lookup Tracker . DO _ NOTH ING ) ĊĠĠĠ Ġuse Instance ( kotlin Code Analyzer ) ĊĠĠĠ Ġuse Instance ( kotlin Code Analyzer . getFile Scope Provider ()) ĊĠĠĠ Ġuse Instance ( body Resolve Cache ) ĊĠĠĠ Ġuse Impl < Lazy Top Down Analyzer For TopLevel >() ĊĠĠĠ Ġuse Impl < Basic Absent Descriptor Handler >() Ċ } Ċ Ċ fun Ġcreate Container For Lazy Local Classifier Analyzer ( ĊĠĠĠĠĠĠĠ Ġmodule Context : ĠModule Context , ĊĠĠĠĠĠĠĠ Ġbinding Trace : ĠBinding Trace , ĊĠĠĠĠĠĠĠ Ġplatform : ĠTarget Platform , ĊĠĠĠĠĠĠĠ Ġlookup Tracker : ĠLookup Tracker , ĊĠĠĠĠĠĠĠ Ġlocal Class Descriptor Holder : ĠLocal Class Descriptor Holder Ċ ): ĠStorage Component Container Ġ= Ġcreate Container (" Local Classifier Analyzer ") Ġ{ ĊĠĠĠ Ġconfigure Module ( module Context , Ġplatform , Ġbinding Trace ) ĊĊĠĠĠ Ġuse Instance ( local Class Descriptor Holder ) ĊĠĠĠ Ġuse Instance ( lookup Tracker ) ĊĊĠĠĠ Ġuse Impl < Lazy Top Down Analyzer >() ĊĊĠĠĠ Ġuse Instance ( No TopLevel Descriptor Provider ) ĊĊĠĠĠ ĠCompiler Environment . configure ( this ) ĊĊĠĠĠ Ġuse Instance ( File Scope Provider . Throw Exception ) ĊĊĠĠĠ Ġuse Impl < Declaration Scope Provider For Local Classifier Analyzer >() ĊĠĠĠ Ġuse Impl < Local Lazy Declaration Resolver >() Ċ } Ċ Ċ fun Ġcreate Container For Lazy Resolve ( ĊĠĠĠĠĠĠĠ Ġmodule Context : ĠModule Context , ĊĠĠĠĠĠĠĠ Ġdeclaration Provider Factory : ĠDeclaration Provider Factory , ĊĠĠĠĠĠĠĠ Ġbinding Trace : ĠBinding Trace , ĊĠĠĠĠĠĠĠ Ġplatform : ĠTarget Platform , ĊĠĠĠĠĠĠĠ Ġtarget Environment : ĠTarget Environment Ċ ): ĠStorage Component Container Ġ= Ġcreate Container (" Lazy Resolve ") Ġ{ ĊĠĠĠ Ġconfigure Module ( module Context , Ġplatform , Ġbinding Trace ) ĊĊĠĠĠ Ġuse Instance ( declaration Provider Factory ) ĊĠĠĠ Ġuse Instance ( Lookup Tracker . DO _ NOTH ING ) ĊĊĠĠĠ Ġtarget Environment . configure ( this ) ĊĊĠĠĠ Ġuse Impl < Lazy Resolve Token >() ĊĠĠĠ Ġuse Impl < Resolve Session >() Ċ } Ċ Ċ @ Jvm Over loads Ġfun Ġcreate Lazy Resolve Session ( ĊĠĠĠĠĠĠĠ Ġmodule Context : ĠModule Context , ĊĠĠĠĠĠĠĠ Ġdeclaration Provider Factory : ĠDeclaration Provider Factory , ĊĠĠĠĠĠĠĠ Ġbinding Trace : ĠBinding Trace , ĊĠĠĠĠĠĠĠ Ġplatform : ĠTarget Platform , ĊĠĠĠĠĠĠĠ Ġtarget Environment : ĠTarget Environment Ġ= ĠCompiler Environment Ċ ): ĠResolve Session Ġ= Ġcreate Container For Lazy Resolve ( module Context , Ġdeclaration Provider Factory , Ġbinding Trace , Ġplatform , Ġtarget Environment ). get < Resolve Session >() Ċ