MakeInlineableDirect

dotty.tools.dotc.inlines.PrepareInlineable.InlineAccessors.MakeInlineableDirect
class MakeInlineableDirect(inlineSym: Symbol) extends MakeInlineableMap

Direct approach: place the accessor with the accessed symbol. This has the advantage that we can re-use the receiver as is. But it is only possible if the receiver is essentially this or an outer this, which is indicated by the test that we can find a host for the accessor.

Attributes

Graph
Supertypes
trait Insert
class TreeMap
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def ifNoHost(reference: RefTree)(using Context): Tree

Attributes

Definition Classes
def preTransform(tree: Tree)(using Context): Tree

Inherited methods

def accessorIfNeeded(tree: Tree)(using Context): Tree

Replace tree with a reference to an accessor if needed

Replace tree with a reference to an accessor if needed

Attributes

Inherited from:
Insert
def accessorNameOf(name: TermName, site: Symbol)(using Context): TermName

The name of the accessor for definition with given name in given site

The name of the accessor for definition with given name in given site

Attributes

Inherited from:
MakeInlineableMap
protected def accessorSymbol(owner: Symbol, accessorName: TermName, accessorInfo: Type, accessed: Symbol)(using Context): Symbol

An accessor symbol, create a fresh one unless one exists already

An accessor symbol, create a fresh one unless one exists already

Attributes

Inherited from:
Insert
protected def checkUnstableAccessor(accessedTree: Tree, accessor: Symbol)(using Context): Unit

Attributes

Inherited from:
MakeInlineableMap
def needsAccessor(sym: Symbol)(using Context): Boolean

A definition needs an accessor if it is private, protected, or qualified private and it is not part of the tree that gets inlined. The latter test is implemented by excluding all symbols properly contained in the inline method.

A definition needs an accessor if it is private, protected, or qualified private and it is not part of the tree that gets inlined. The latter test is implemented by excluding all symbols properly contained in the inline method.

Constant vals don't need accessors since they are inlined in FirstTransform. Inline methods don't need accessors since they are inlined in Typer.

When creating accessors for staged/quoted code we only need to create accessors for the code that is staged. This excludes code at level 0 (except if it is inlined).

Attributes

Inherited from:
MakeInlineableMap
def postTransform(tree: Tree)(using Context): Tree

Attributes

Inherited from:
MakeInlineableMap
override def transform(tree: Tree)(using Context): Tree

Attributes

Definition Classes
Inherited from:
MakeInlineableMap
def transform(trees: List[Tree])(using Context): List[Instance.this.Tree]

Attributes

Inherited from:
TreeMap
def transformBlock(blk: Block)(using Context): Instance.this.Block

Attributes

Inherited from:
TreeMap

Attributes

Inherited from:
TreeMap

Attributes

Inherited from:
TreeMap
def transformStats(trees: List[Tree], exprOwner: Symbol)(using Context): List[Instance.this.Tree]

Attributes

Inherited from:
TreeMap
def transformSub[Tr <: Tree](trees: List[Tr])(using Context): List[Tr]

Attributes

Inherited from:
TreeMap
def transformSub[Tr <: Tree](tree: Tr)(using Context): Tr

Attributes

Inherited from:
TreeMap
def useAccessor(reference: RefTree)(using Context): Tree

Create an accessor unless one exists already, and replace the original access with a reference to the accessor.

Create an accessor unless one exists already, and replace the original access with a reference to the accessor.

Value parameters

onLHS

The reference is on the left-hand side of an assignment

reference

The original reference to the non-public symbol

Attributes

Inherited from:
Insert
def useSetter(getterRef: Tree)(using Context): Tree

Given a reference to a getter accessor, the corresponding setter reference

Given a reference to a getter accessor, the corresponding setter reference

Attributes

Inherited from:
Insert

Inherited fields

Attributes

Inherited from:
TreeMap