/* Ċ Ġ* ĠCopyright Ġ 2 0 1 0 - 2 0 2 0 ĠJetBrains Ġs . r . o . Ġand ĠKotlin ĠProgramming ĠLanguage Ġcontributors . Ċ Ġ* ĠUse Ġof Ġthis Ġsource Ġcode Ġis Ġgoverned Ġby Ġthe ĠApache Ġ 2 . 0 Ġlicense Ġthat Ġcan Ġbe Ġfound Ġin Ġthe Ġlicense / LICENSE . txt Ġfile . Ċ Ġ*/ Ċ Ċ package Ġorg . jetbrains . kotlin . idea . fir . low . level . api Ċ Ċ import Ġcom . google . common . collect . Map Maker Ċ import Ġorg . jetbrains . kotlin . fir . F ir Session Ċ import Ġorg . jetbrains . kotlin . fir . F ir Session Component Ċ import Ġorg . jetbrains . kotlin . fir . declarations . F ir Resolve Phase Ċ import Ġorg . jetbrains . kotlin . fir . resolve . Scope Session Ċ import Ġorg . jetbrains . kotlin . fir . resolve . transformers . F ir Transformer Based Resolve Processor Ċ import Ġorg . jetbrains . kotlin . fir . resolve . transformers . create Transformer Based Processor By Phase Ċ import Ġjava . util .* Ċ Ċ class ĠF ir Transformer Provider Ġ{ ĊĠĠĠ Ġprivate Ġval Ġscope Session Ġ= ĠMap Maker (). weak Keys (). make Map < F ir Session , ĠScope Session >() ĊĠĠĠ Ġprivate Ġval Ġtransform ers Ġ= ĠMap Maker (). weak Keys (). make Map < F ir Session , ĠEnum Map < F ir Resolve Phase , ĠF ir Transformer Based Resolve Processor >>() ĊĊĊĠĠĠ Ġfun Ġget Transformer For Phase ( session : ĠF ir Session , Ġphase : ĠF ir Resolve Phase ): ĠF ir Transformer Based Resolve Processor Ġ= ĊĠĠĠĠĠĠĠ Ġtransform ers . compute If Absent ( session ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġscopes Session Ġ= Ġget Scope Session ( session ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠEnum Map < F ir Resolve Phase , ĠF ir Transformer Based Resolve Processor >( F ir Resolve Phase :: class . java ). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠF ir Resolve Phase . values (). forEach Ġ{ Ġresolve Phase Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( resolve Phase Ġ!= ĠF ir Resolve Phase . RAW _ FI R ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġput ( resolve Phase , Ġresolve Phase . create Transformer Based Processor By Phase ( session , Ġscopes Session )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ}. getValue ( phase ) ĊĊĠĠĠ Ġfun Ġget Scope Session ( session : ĠF ir Session ): ĠScope Session Ġ= ĊĠĠĠĠĠĠĠ Ġscope Session . get Or Put ( session ) Ġ{ ĠScope Session () Ġ} Ċ } Ċ