
CallResolver handles the process of resolving a CallExpr or UnknownVarExpr to a method call or a field access.
Slots
- args
-
Expr[] args
- base
-
CType base
-
private Void constantFolding()
If the epxression is a call, check for constant folding.
- curMethod
-
MethodDef curMethod
- curType
-
TypeDef curType
-
private Str errSig()
- expr
-
NameExpr expr
- find
-
Void find()
Find the method or field with the specified name.
- found
-
CSlot found
-
private Void insertImplicitThis()
If the call has no explicit target, and is a instance field or method, then we need to insert an implicit this.
- isVar
-
Bool isVar
- location
-
Location location
- make
-
new make(Compiler compiler, TypeDef curType, MethodDef curMethod, NameExpr expr)
Construct with NameExpr (base class of CallExpr and UnknownVarExpr)
- name
-
Str name
- resolve
-
Expr resolve()
Resolve into a method call or field access
- resolveBase
-
Void resolveBase()
Resolve the base type which defines the slot we are calling.
-
private CallExpr resolveToCallExpr()
-
private Void resolveToExpr()
Compute the expression type the call itself (what gets left on the stack).
-
private FieldExpr resolveToFieldExpr()
- result
-
Expr result
- target
-
Expr target