Ejemplo n.º 1
0
            public override Vertex WriteVertex(NodeFactory factory)
            {
                switch (_type.Category)
                {
                case Internal.TypeSystem.TypeFlags.SzArray:
                    return(GetNativeWriter(factory).GetModifierTypeSignature(TypeModifierKind.Array, _parameterTypeSig.WriteVertex(factory)));

                case Internal.TypeSystem.TypeFlags.Pointer:
                    return(GetNativeWriter(factory).GetModifierTypeSignature(TypeModifierKind.Pointer, _parameterTypeSig.WriteVertex(factory)));

                case Internal.TypeSystem.TypeFlags.ByRef:
                    return(GetNativeWriter(factory).GetModifierTypeSignature(TypeModifierKind.ByRef, _parameterTypeSig.WriteVertex(factory)));

                case Internal.TypeSystem.TypeFlags.Array:
                {
                    Vertex elementType = _parameterTypeSig.WriteVertex(factory);

                    // Skip bounds and lobounds (TODO)
                    var bounds   = Array.Empty <uint>();
                    var lobounds = Array.Empty <uint>();

                    return(GetNativeWriter(factory).GetMDArrayTypeSignature(elementType, (uint)((ArrayType)_type).Rank, bounds, lobounds));
                }
                }

                Debug.Assert(false, "UNREACHABLE");
                return(null);
            }
Ejemplo n.º 2
0
        public override Vertex WriteVertex(NodeFactory factory)
        {
            // Always use the NativeLayoutInfo blob for names and sigs, even if the associated types/methods are written elsewhere.
            // This saves space, since we can Unify more signatures, allows optimizations in comparing sigs in the same module, and
            // prevents the dynamic type loader having to know about other native layout sections (since sigs contain types). If we are
            // using a non-native layout info writer, write the sig to the native layout info, and refer to it by offset in its own
            // section.  At runtime, we will assume all names and sigs are in the native layout and find it.

            Vertex signature = _signatureToBePlaced.WriteVertex(factory);

            return(SetSavedVertex(factory.MetadataManager.NativeLayoutInfo.SignaturesSection.Place(signature)));
        }