Defn

scala.scalanative.nir.Defn
See theDefn companion object
sealed abstract class Defn extends Positioned

A definition in NIR.

Programs in NIR are represented as a sequence of definitions denoting types, methods and fields. Definitions fall into two categories:

  • Top-level definitions: these represent classes, modules, traits, or global variables and constants.
  • Member definitions: these represent fields or methods.

Classes and modules inherit from a single parent with the exception of java.lang.Object, which sits at the top of the hierarchy. They may additionally implement traits.

Definitions may also carry attributes providing further information about their semantics (e.g., whether a method may be inlined). Attributes are also used to mark special-purpose definitions, such as stubs, proxies and FFIs.

Attributes

Companion
object
Graph
Supertypes
trait Positioned
class Object
trait Matchable
class Any
Known subtypes
class Class
class Const
class Declare
class Define
class Module
class Trait
class Var
Show all

Members list

Value members

Abstract methods

def attrs: Attrs

Returns the attributes of the definition.

Returns the attributes of the definition.

Attributes

def name: Global

Returns the name of the definition.

Returns the name of the definition.

Attributes

Concrete methods

final def isEntryPoint: Boolean

Returns true iff this is considered as an entry point by reachability analysis.

Returns true iff this is considered as an entry point by reachability analysis.

Attributes

final def show: String

Returns a textual representation of this.

Returns a textual representation of this.

Attributes

Inherited methods

Returns the site in the program sources corresponding to the definition.

Returns the site in the program sources corresponding to the definition.

Attributes

Inherited from:
Positioned