• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# TypeSystem.FieldDesc类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Internal.TypeSystem.FieldDesc的典型用法代码示例。如果您正苦于以下问题:C# FieldDesc类的具体用法?C# FieldDesc怎么用?C# FieldDesc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FieldDesc类属于Internal.TypeSystem命名空间,在下文中一共展示了FieldDesc类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetFieldRvaData

 /// <summary>
 /// Gets an object representing the static data for RVA mapped fields from the PE image.
 /// </summary>
 public ObjectNode GetFieldRvaData(FieldDesc field)
 {
     if (field.GetType() == typeof(Internal.IL.Stubs.PInvokeLazyFixupField))
     {
         var pInvokeFixup = (Internal.IL.Stubs.PInvokeLazyFixupField)field;
         PInvokeMetadata metadata = pInvokeFixup.PInvokeMetadata;
         return NodeFactory.PInvokeMethodFixup(metadata.Module, metadata.Name);
     }
     else
     {
         // Use the typical field definition in case this is an instantiated generic type
         field = field.GetTypicalFieldDefinition();
         return NodeFactory.ReadOnlyDataBlob(NameMangler.GetMangledFieldName(field),
             ((EcmaField)field).GetFieldRvaData(), NodeFactory.Target.PointerSize);
     }
 }
开发者ID:nattress,项目名称:corert,代码行数:19,代码来源:Compilation.cs


示例2: NewToken

 public ILToken NewToken(FieldDesc value)
 {
     return NewToken(value, 0x0a000000);
 }
开发者ID:nguerrera,项目名称:corert,代码行数:4,代码来源:ILEmitter.cs


示例3: GetFieldRvaData

 /// <summary>
 /// Gets an object representing the static data for RVA mapped fields from the PE image.
 /// </summary>
 public object GetFieldRvaData(FieldDesc field)
 {
     return _nodeFactory.ReadOnlyDataBlob(NameMangler.GetMangledFieldName(field),
         ((EcmaField)field).GetFieldRvaData(), _typeSystemContext.Target.PointerSize);
 }
开发者ID:schellap,项目名称:corert,代码行数:8,代码来源:Compilation.cs


示例4: AppendFieldSignature

 private void AppendFieldSignature(StringBuilder sb, FieldDesc field)
 {
     this.TypeNameFormatter.AppendNameWithValueClassPrefix(sb, field.FieldType);
     sb.Append(' ');
     AppendOwningType(sb, field.OwningType);
     sb.Append("::");
     sb.Append(field.Name);
 }
开发者ID:tijoytom,项目名称:corert,代码行数:8,代码来源:ILDisassember.cs


示例5: ComputeHasGCStaticBase

        protected override bool ComputeHasGCStaticBase(FieldDesc field)
        {
            Debug.Assert(field.IsStatic);

            TypeDesc fieldType = field.FieldType;
            if (fieldType.IsValueType)
                return ((DefType)fieldType).ContainsGCPointers;
            else
                return fieldType.IsGCPointer;

        }
开发者ID:krytarowski,项目名称:corert,代码行数:11,代码来源:TestTypeSystemContext.cs


示例6: GetMangledFieldName

        public string GetMangledFieldName(FieldDesc field)
        {
            string mangledName;
            if (_mangledFieldNames.TryGetValue(field, out mangledName))
                return mangledName;

            return ComputeMangledFieldName(field);
        }
开发者ID:tijoytom,项目名称:corert,代码行数:8,代码来源:NameMangler.cs


示例7: GetFieldTypeOrPlaceholder

 private TypeDesc GetFieldTypeOrPlaceholder(FieldDesc field)
 {
     try
     {
         return field.FieldType;
     }
     catch
     {
         // TODO: For now, catch errors due to missing dependencies
         return _compilation.TypeSystemContext.GetWellKnownType(WellKnownType.Boolean);
     }
 }
开发者ID:justinvp,项目名称:corert,代码行数:12,代码来源:CppWriter.cs


示例8: GetCppFieldName

 public string GetCppFieldName(FieldDesc field)
 {
     return _compilation.NameMangler.GetMangledFieldName(field).ToString();
 }
开发者ID:justinvp,项目名称:corert,代码行数:4,代码来源:CppWriter.cs


示例9: RvaFieldData

 public RvaFieldData(Compilation compilation, FieldDesc field)
 {
     Debug.Assert(field.HasRva);
     Field = field;
     _compilation = compilation;
 }
开发者ID:niemyjski,项目名称:corert,代码行数:6,代码来源:RvaFieldData.cs


示例10: GeneratesMetadata

 public bool GeneratesMetadata(FieldDesc fieldDef)
 {
     return GeneratesMetadata((MetadataType)fieldDef.OwningType);
 }
开发者ID:tijoytom,项目名称:corert,代码行数:4,代码来源:MultifileMetadataPolicy.cs


示例11: AddField

        public void AddField(FieldDesc field)
        {
            RegisteredField reg = GetRegisteredField(field);
            if (reg.IncludedInCompilation)
                return;
            reg.IncludedInCompilation = true;

            if (_options.IsCppCodeGen)
            {
                // Precreate name to ensure that all types referenced by signatures are present
                GetRegisteredType(field.OwningType);
                GetRegisteredType(field.FieldType);
            }
        }
开发者ID:AustinWise,项目名称:corert,代码行数:14,代码来源:Compilation.cs


示例12: GetRegisteredField

        internal RegisteredField GetRegisteredField(FieldDesc field)
        {
            RegisteredField existingRegistration;
            if (_registeredFields.TryGetValue(field, out existingRegistration))
                return existingRegistration;

            RegisteredField registration = new RegisteredField() { Field = field };
            _registeredFields.Add(field, registration);

            GetRegisteredType(field.OwningType);

            return registration;
        }
开发者ID:AustinWise,项目名称:corert,代码行数:13,代码来源:Compilation.cs


示例13: FieldForInstantiatedType

 internal FieldForInstantiatedType(FieldDesc fieldDef, InstantiatedType instantiatedType)
 {
     _fieldDef = fieldDef;
     _instantiatedType = instantiatedType;
 }
开发者ID:tijoytom,项目名称:corert,代码行数:5,代码来源:FieldForInstantiatedType.cs


示例14: AddFieldReference

        private void AddFieldReference(FieldDesc field)
        {
            if (field.IsStatic)
            {
                var owningType = (MetadataType)field.OwningType;

                Object node;
                if (field.IsThreadStatic)
                {
                    node = _nodeFactory.TypeThreadStaticsSymbol(owningType);
                }
                else
                {
                    if (field.HasGCStaticBase)
                        node = _nodeFactory.TypeGCStaticsSymbol(owningType);
                    else
                        node = _nodeFactory.TypeNonGCStaticsSymbol(owningType);
                }

                // TODO: Remove once the depedencies for static fields are tracked properly
                _writer.GetCppSignatureTypeName(owningType);

                _dependencies.Add(node);
            }
        }
开发者ID:nguerrera,项目名称:corert,代码行数:25,代码来源:ILToCppImporter.cs


示例15: GeneratesMetadata

 public bool GeneratesMetadata(FieldDesc fieldDef)
 {
     if (_fieldGeneratesMetadata != null)
         return _fieldGeneratesMetadata(fieldDef);
     return false;
 }
开发者ID:tijoytom,项目名称:corert,代码行数:6,代码来源:MockPolicy.cs


示例16: GetFieldRvaData

 /// <summary>
 /// Gets an object representing the static data for RVA mapped fields from the PE image.
 /// </summary>
 public ObjectNode GetFieldRvaData(FieldDesc field)
 {
     if (field.GetType() == typeof(Internal.IL.Stubs.PInvokeLazyFixupField))
     {
         var pInvokeFixup = (Internal.IL.Stubs.PInvokeLazyFixupField)field;
         PInvokeMetadata metadata = pInvokeFixup.PInvokeMetadata;
         return _nodeFactory.PInvokeMethodFixup(metadata.Module, metadata.Name);
     }
     else
     {
         return _nodeFactory.ReadOnlyDataBlob(NameMangler.GetMangledFieldName(field),
             ((EcmaField)field).GetFieldRvaData(), _typeSystemContext.Target.PointerSize);
     }
 }
开发者ID:shahid-pk,项目名称:corert,代码行数:17,代码来源:Compilation.cs


示例17: FieldAndOffset

 public FieldAndOffset(FieldDesc field, int offset)
 {
     Field = field;
     Offset = offset;
 }
开发者ID:xier2012,项目名称:corert,代码行数:5,代码来源:MetadataType.cs


示例18: GetCppStaticFieldName

 public string GetCppStaticFieldName(FieldDesc field)
 {
     TypeDesc type = field.OwningType;
     string typeName = GetCppTypeName(type);
     return typeName.Replace("::", "__") + "__" + _compilation.NameMangler.GetMangledFieldName(field);
 }
开发者ID:justinvp,项目名称:corert,代码行数:6,代码来源:CppWriter.cs


示例19: ComputeMangledFieldName

        private string ComputeMangledFieldName(FieldDesc field)
        {
            string prependTypeName = null;
            if (!_compilation.IsCppCodeGen)
                prependTypeName = GetMangledTypeName(field.OwningType);

            if (field is EcmaField)
            {
                var deduplicator = new HashSet<string>();

                // Add consistent names for all fields of the type, independent on the order in which
                // they are compiled
                lock (this)
                {
                    foreach (var f in field.OwningType.GetFields())
                    {
                        string name = SanitizeName(f.Name);

                        if (deduplicator.Contains(name))
                        {
                            string nameWithIndex;
                            for (int index = 1; ; index++)
                            {
                                nameWithIndex = name + "_" + index.ToString(CultureInfo.InvariantCulture);
                                if (!deduplicator.Contains(nameWithIndex))
                                    break;
                            }
                            name = nameWithIndex;
                        }
                        deduplicator.Add(name);

                        if (prependTypeName != null)
                            name = prependTypeName + "__" + name;

                        _mangledFieldNames = _mangledFieldNames.Add(f, name);
                    }
                }

                return _mangledFieldNames[field];
            }


            string mangledName = SanitizeName(field.Name);

            if (prependTypeName != null)
                mangledName = prependTypeName + "__" + mangledName;

            lock (this)
            {
                _mangledFieldNames = _mangledFieldNames.Add(field, mangledName);
            }

            return mangledName;
        }
开发者ID:noahfalk,项目名称:corert,代码行数:54,代码来源:NameMangler.cs


示例20: ObjectToHandle

 private CORINFO_FIELD_STRUCT_* ObjectToHandle(FieldDesc field) { return (CORINFO_FIELD_STRUCT_*)ObjectToHandle((Object)field); }
开发者ID:smartmaster,项目名称:corert,代码行数:1,代码来源:CorInfoImpl.cs



注:本文中的Internal.TypeSystem.FieldDesc类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TypeSystem.Instantiation类代码示例发布时间:2022-05-26
下一篇:
C# TypeSystem.DefType类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap