public PEAPI.Field ResolveField(string name, BaseTypeRef ret_type, CodeGen code_gen) { FieldDef fielddef = (FieldDef)field_table[new DictionaryEntry(name, ret_type.FullName)]; if (fielddef != null) { return(fielddef.Resolve(code_gen, classdef)); } ExternTypeRef type_ref = code_gen.ThisModule.GetTypeRef(FullName, false); IFieldRef fieldref = type_ref.GetFieldRef(ret_type, name); fieldref.Resolve(code_gen); return(fieldref.PeapiField); }
public override void Emit(CodeGen code_gen, MethodDef meth, PEAPI.CILInstructions cil) { if (field_ref != null) { field_ref.Resolve(code_gen); cil.FieldInst(PEAPI.FieldOp.ldtoken, field_ref.PeapiField); } else if (method_ref != null) { method_ref.Resolve(code_gen); cil.MethInst(PEAPI.MethodOp.ldtoken, method_ref.PeapiMethod); } else if (type_ref != null) { type_ref.Resolve(code_gen); cil.TypeInst(PEAPI.TypeOp.ldtoken, type_ref.PeapiType); } }
public override void Emit(CodeGen code_gen, MethodDef meth, PEAPI.CILInstructions cil) { operand.Resolve(code_gen); cil.FieldInst(op, operand.PeapiField); }