<commit_before>package dotty.tools.dotc
package transform

import scala.collection.mutable
import core._
import Contexts._
import Symbols._
import Decorators._
import NameOps._
import StdNames.nme
import dotty.tools.dotc.transform.TreeTransforms.{TransformerInfo, TreeTransformer, MiniPhaseTransform}
import dotty.tools.dotc.ast.Trees._
import dotty.tools.dotc.ast.{untpd, tpd}
import dotty.tools.dotc.core.Constants.Constant
import dotty.tools.dotc.core.Types.MethodType
import dotty.tools.dotc.core.Names.Name
import dotty.runtime.LazyVals
import SymUtils._
import scala.collection.mutable.ListBuffer
import dotty.tools.dotc.core.Denotations.SingleDenotation
import dotty.tools.dotc.core.SymDenotations.SymDenotation
import dotty.tools.dotc.core.DenotTransformers.DenotTransformer

class LazyValTranformContext {

  import tpd._


  def transformer = new LazyValsTransform

  val containerFlags = Flags.Synthetic | Flags.Mutable

  /** this map contains mutable state of transformation: OffsetDefs to be appended to companion object definitions,
    * and number of bits currently used */
  class OffsetInfo(var defs: List[Tree], var ord:Int)
  val appendOffsetDefs = mutable.Map.empty[Name, OffsetInfo]

  class LazyValsTransform extends MiniPhaseTransform with DenotTransformer {

    override def phaseName: String = "LazyVals"

    override def treeTransformPhase = this.next

    /** List of names of phases that should have finished their processing of all compilation units
      * before this phase starts */

    /** List of names of phases that should have finished their processing of all compilation units
      * before this phase starts */

    /** List of names of phases that should have finished processing of tree
      * before this phase starts processing same tree */
    // override def ensureAfter: Set[String] = Set("mixin")

    def transform(ref: SingleDenotation)(implicit ctx: Context): SingleDenotation = {
      ref
    }

    override def transformValDef(tree: ValDef)(implicit ctx: Context, info: TransformerInfo): Tree = {
      if (!(tree.mods is Flags.Lazy) || (tree.mods is Flags.ModuleVal)) tree
      else {
        val isField = tree.symbol.owner.isClass

        if (isField) {
          if (tree.symbol.isVolatile) transformFieldValDefVolatile(tree)
          else transformFieldValDefNonVolatile(tree)
        }
        else transformLocalValDef(tree)
      }<commit_msg>Make LazyVals an IdentityDenotTransformer<commit_after>package dotty.tools.dotc
package transform

import scala.collection.mutable
import core._
import Contexts._
import Symbols._
import Decorators._
import NameOps._
import StdNames.nme
import dotty.tools.dotc.transform.TreeTransforms.{TransformerInfo, TreeTransformer, MiniPhaseTransform}
import dotty.tools.dotc.ast.Trees._
import dotty.tools.dotc.ast.{untpd, tpd}
import dotty.tools.dotc.core.Constants.Constant
import dotty.tools.dotc.core.Types.MethodType
import dotty.tools.dotc.core.Names.Name
import dotty.runtime.LazyVals
import SymUtils._
import scala.collection.mutable.ListBuffer
import dotty.tools.dotc.core.Denotations.SingleDenotation
import dotty.tools.dotc.core.SymDenotations.SymDenotation
import dotty.tools.dotc.core.DenotTransformers.{IdentityDenotTransformer, DenotTransformer}

class LazyValTranformContext {

  import tpd._


  def transformer = new LazyValsTransform

  val containerFlags = Flags.Synthetic | Flags.Mutable

  /** this map contains mutable state of transformation: OffsetDefs to be appended to companion object definitions,
    * and number of bits currently used */
  class OffsetInfo(var defs: List[Tree], var ord:Int)
  val appendOffsetDefs = mutable.Map.empty[Name, OffsetInfo]

  class LazyValsTransform extends MiniPhaseTransform with IdentityDenotTransformer {

    override def phaseName: String = "LazyVals"

    override def treeTransformPhase = this.next

    /** List of names of phases that should have finished their processing of all compilation units
      * before this phase starts */

    /** List of names of phases that should have finished their processing of all compilation units
      * before this phase starts */

    /** List of names of phases that should have finished processing of tree
      * before this phase starts processing same tree */
    // override def ensureAfter: Set[String] = Set("mixin")

    override def transformValDef(tree: ValDef)(implicit ctx: Context, info: TransformerInfo): Tree = {
      if (!(tree.mods is Flags.Lazy) || (tree.mods is Flags.ModuleVal)) tree
      else {
        val isField = tree.symbol.owner.isClass

        if (isField) {
          if (tree.symbol.isVolatile) transformFieldValDefVolatile(tree)
          else transformFieldValDefNonVolatile(tree)
        }
        else transformLocalValDef(tree)
      }
{'fraction_non_alphanumeric': 0.07660196201210603, 'fraction_numerical': 0.0, 'mean_word_length': 4.06553911205074, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4814678', 'n_tokens_mistral': 1387, 'n_tokens_neox': 1348, 'n_words': 401}