VariableUsageResolver

Creates new connections between the place where a variable is declared and where it is used.

A field access is modeled with a MemberExpression. After AST building, its base and member references are set to DeclaredReferenceExpression stubs. This pass resolves those references and makes the member point to the appropriate FieldDeclaration and the base to the "this" FieldDeclaration of the containing class. It is also capable of resolving references to fields that are inherited from a superclass and thus not declared in the actual base class. When base or member declarations are not found in the graph, a new "inferred" FieldDeclaration is being created that is then used to collect all usages to the same unknown declaration. DeclaredReferenceExpression stubs are removed from the graph after being resolved.

Accessing a local variable is modeled directly with a DeclaredReferenceExpression. This step of the pass doesn't remove the DeclaredReferenceExpression nodes like in the field usage case but rather makes their "refersTo" point to the appropriate ValueDeclaration.

Constructors

Link copied to clipboard

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun accept(result: TranslationResult)
Link copied to clipboard
fun addSoftDependency(toAdd: Class<out Pass?>)
Link copied to clipboard
Link copied to clipboard
open override fun cleanup()
Link copied to clipboard

Check if the pass requires a specific language frontend and if that frontend has been executed.

Link copied to clipboard

Specifies, whether this pass supports this particular language. This defaults to true * and needs to be overridden if a different behaviour is wanted.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard