Ejemplo n.º 1
0
        public void GenerateGet(Expression target, MethodBodyGenerator generator, MethodCompileOption option)
        {
            var field = this.field;

            if (field.FieldType == null)
            {
                throw new InvalidOperationException(string.Concat("Use of undeclared field ", field));
            }
            if (field is Generators.FieldGenerator)
            {
                field = ((Generators.FieldGenerator)field).FieldInfo;
            }
            if ((option & MethodCompileOption.EmitStartAddress) == MethodCompileOption.EmitStartAddress && field.FieldType.IsValueType)
            {
                generator.LoadFieldAddress(field);
            }
            else
            {
                generator.LoadField(field);
            }
        }