DependencyRecorder

dotty.tools.dotc.sbt.DependencyRecorder

Record dependencies using addUsedName/addClassDependency and inform Zinc using sendToZinc().

Note: As an alternative design choice, we could directly call the appropriate callback as we record each dependency, this way we wouldn't need to record them locally and we could get rid of sendToZinc(), but this may be less efficient since it would mean calling classNameAsString on each call to addUsedName rather than once per class.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Classlikes

final class FoundDepsInClass

An object that maintain the set of used names and class dependencies from within a class

An object that maintain the set of used names and class dependencies from within a class

Attributes

Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def addClassDependency(toClass: Symbol, context: DependencyContext)(using Context): Unit

Record a dependency to the class to in a given context from the current non-local enclosing class.

Record a dependency to the class to in a given context from the current non-local enclosing class.

Attributes

def addUsedName(sym: Symbol, includeSealedChildren: Boolean)(using Context): Unit

Record a reference to the name of sym from the current non-local enclosing class.

Record a reference to the name of sym from the current non-local enclosing class.

Value parameters

includeSealedChildren

See documentation of addUsedRawName.

Attributes

def addUsedRawName(name: Name, includeSealedChildren: Boolean)(using Context): Unit

Record a reference to name from the current non-local enclosing class (aka, "from class").

Record a reference to name from the current non-local enclosing class (aka, "from class").

Most of the time, prefer to use addUsedName which takes care of name mangling.

Zinc will use this information to invalidate the current non-local enclosing class if something changes in the set of definitions named name among the possible dependencies of the from class.

Value parameters

includeSealedChildren

If true, the addition or removal of children to a sealed class called name will also invalidate the from class. Note that this only has an effect if zinc's IncOptions.useOptimizedSealed is enabled, otherwise the addition or removal of children always lead to invalidation. TODO: If the compiler reported to zinc all usages of SymDenotation#{children,sealedDescendants} (including from macro code), we should be able to turn IncOptions.useOptimizedSealed on by default safely.

Attributes

def clear(): Unit

Clear all state.

Clear all state.

Attributes

A map from a non-local class to the names and classes it uses, this does not include names which are only defined and not referenced.

A map from a non-local class to the names and classes it uses, this does not include names which are only defined and not referenced.

Attributes

def sendToZinc()(using Context): Unit

Send the collected dependency information to Zinc and clear the local caches.

Send the collected dependency information to Zinc and clear the local caches.

Attributes