Ejemplo n.º 1
0
 internal sealed override void TypeSig(MemoryStream str)
 {
     str.WriteByte(typeIndex);
     elemType.TypeSig(str);
     MetaDataOut.CompressNum(BlobUtil.CompressUInt(numDims), str);
     if ((sizes != null) && (sizes.Length > 0))
     {
         MetaDataOut.CompressNum(BlobUtil.CompressUInt((uint)sizes.Length), str);
         foreach (int size in sizes)
         {
             MetaDataOut.CompressNum(BlobUtil.CompressUInt((uint)size), str);
         }
     }
     else
     {
         str.WriteByte(0);
     }
     if ((lowerBounds != null) && (lowerBounds.Length > 0))
     {
         MetaDataOut.CompressNum(BlobUtil.CompressUInt((uint)lowerBounds.Length), str);
         foreach (int lowerBound in lowerBounds)
         {
             MetaDataOut.CompressNum(BlobUtil.CompressInt(lowerBound), str);
         }
     }
     else
     {
         str.WriteByte(0);
     }
 }
Ejemplo n.º 2
0
 internal override void TypeSig(MemoryStream str)
 {
     str.WriteByte(GENERICINST);
     MetaDataOut.CompressNum(BlobUtil.CompressUInt((uint)instTypes.Length), str);
     foreach (Type instType in instTypes)
     {
         instType.TypeSig(str);
     }
 }
Ejemplo n.º 3
0
 internal sealed override void TypeSig(MemoryStream sig)
 {
     sig.WriteByte(typeIndex);
     genClass.TypeSig(sig);
     //MetaDataOut.CompressNum((uint)genericParams.Count, sig);
     MetaDataOut.CompressNum(BlobUtil.CompressUInt((uint)genericParams.Count), sig);
     for (int i = 0; i < genericParams.Count; i++)
     {
         ((Type)genericParams[i]).TypeSig(sig);
     }
 }
Ejemplo n.º 4
0
        internal byte[] SigBytes()
        {
            MemoryStream sig = new MemoryStream();

            sig.WriteByte(LocalSigByte);
            MetaDataOut.CompressNum(BlobUtil.CompressUInt((uint)locals.Length), sig);
            foreach (Local lcl in locals)
            {
                ((Local)lcl).TypeSig(sig);
            }
            return(sig.ToArray());
        }
Ejemplo n.º 5
0
        internal sealed override void BuildSignatures(MetaDataOut md)
        {
            MemoryStream sig = new MemoryStream();

            sig.WriteByte(PropertyTag);
            MetaDataOut.CompressNum(BlobUtil.CompressUInt(numPars), sig);
            returnType.TypeSig(sig);
            for (int i = 0; i < numPars; i++)
            {
                parList[i].BuildSignatures(md);
                parList[i].TypeSig(sig);
            }
            typeBlobIx = md.AddToBlobHeap(sig.ToArray());
            done       = false;
        }
Ejemplo n.º 6
0
        internal override byte[] ToBlob()
        {
            MemoryStream str = new MemoryStream();

            str.WriteByte(GetTypeIndex());
            if (elemType == null)
            {
                str.WriteByte(0x50);                    // no info (MAX)
            }
            else
            {
                str.WriteByte(elemType.GetTypeIndex());
            }
            MetaDataOut.CompressNum(BlobUtil.CompressUInt(parNum), str);
            MetaDataOut.CompressNum(BlobUtil.CompressUInt(elemMult), str);
            MetaDataOut.CompressNum(BlobUtil.CompressUInt(len), str);
            return(str.ToArray());
        }
Ejemplo n.º 7
0
        internal sealed override void BuildSignatures(MetaDataOut md)
        {
            MemoryStream sig = new MemoryStream();

            sig.WriteByte((byte)callConv);
            MetaDataOut.CompressNum(BlobUtil.CompressUInt(numPars + numOptPars), sig);
            retType.TypeSig(sig);
            for (int i = 0; i < numPars; i++)
            {
                parTypes[i].TypeSig(sig);
            }
            if (numOptPars > 0)
            {
                sig.WriteByte((byte)ElementType.Sentinel);
                for (int i = 0; i < numOptPars; i++)
                {
                    optParTypes[i].TypeSig(sig);
                }
            }
            sigIx = md.AddToBlobHeap(sig.ToArray());
            done  = false;
        }
Ejemplo n.º 8
0
        /*
         * internal void CheckParTypes(Param[] parList) {
         *   //numGenPars = 0;
         *   for (int i=0; i < numPars; i++) {
         *     if (parTypes[i] is GenericParam)
         *       numGenPars++;
         *   }
         *   if (numGenPars > 0)
         *     callConv |= CallConv.Generic;
         *   else if ((callConv & CallConv.Generic) > 0)
         *     callConv ^= CallConv.Generic;
         * }
         */

        internal void TypeSig(MemoryStream sig)
        {
            Contract.Requires(sig != null);
            sig.WriteByte((byte)callConv);
            if (numGenPars > 0)
            {
                MetaDataOut.CompressNum(BlobUtil.CompressUInt(numGenPars), sig);
            }
            MetaDataOut.CompressNum(BlobUtil.CompressUInt(numPars + numOptPars), sig);
            retType.TypeSig(sig);
            for (int i = 0; i < numPars; i++)
            {
                parTypes[i].TypeSig(sig);
            }
            if (numOptPars > 0)
            {
                sig.WriteByte((byte)ElementType.Sentinel);
                for (int i = 0; i < numOptPars; i++)
                {
                    optParTypes[i].TypeSig(sig);
                }
            }
        }
Ejemplo n.º 9
0
 internal override void TypeSig(MemoryStream sig)
 {
     sig.WriteByte(typeIndex);
     MetaDataOut.CompressNum(BlobUtil.CompressUInt(TypeDefOrRefToken()), sig);
 }
Ejemplo n.º 10
0
 internal sealed override void TypeSig(MemoryStream str)
 {
     str.WriteByte(typeIndex);
     MetaDataOut.CompressNum(BlobUtil.CompressUInt(cmodType.TypeDefOrRefToken()), str);
     type.TypeSig(str);
 }