All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scala.scalanative.codegen.ModuleArray.scala Maven / Gradle / Ivy

There is a newer version: 0.5.5
Show newest version
package scala.scalanative
package codegen

import scala.collection.mutable
import scalanative.nir._
import scalanative.linker.Class

class ModuleArray(meta: Metadata) {
  val index = mutable.Map.empty[Class, Int]
  val modules = mutable.UnrolledBuffer.empty[Class]
  meta.classes.foreach { cls =>
    if (cls.isModule && cls.allocated) {
      index(cls) = modules.size
      modules += cls
    }
  }
  val size: Int = modules.size
  val value: Val =
    Val.ArrayValue(Type.Ptr, Seq.fill[Val](modules.length)(Val.Null))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy