Example #1
0
 private void Add(GenericInstMethodSig sig)
 {
     if (sig == null)
     {
         return;
     }
     Add(sig.GenericArguments);
 }
Example #2
0
 private void Add(GenericInstMethodSig gsig)
 {
     if (gsig == null)
     {
         return;
     }
     Add(gsig.ExtraData);
     Add(gsig.GenericArguments);
 }
Example #3
0
        private bool ContainsGenericParameterInternal(GenericInstMethodSig gim)
        {
            if (gim == null)
            {
                return(false);
            }
            if (!recursionCounter.Increment())
            {
                return(false);
            }

            bool res = ContainsGenericParameter(gim.GenericArguments);

            recursionCounter.Decrement();
            return(res);
        }
Example #4
0
        /// <summary>
        /// Reads a <see cref="GenericInstMethodSig"/>
        /// </summary>
        /// <param name="callingConvention">First byte of signature</param>
        /// <returns>A new <see cref="GenericInstMethodSig"/> instance</returns>
        private GenericInstMethodSig ReadGenericInstMethod(CallingConvention callingConvention)
        {
            uint count;

            if (!reader.ReadCompressedUInt32(out count))
            {
                return(null);
            }
            var sig  = new GenericInstMethodSig(callingConvention, count);
            var args = sig.GenericArguments;

            for (uint i = 0; i < count; i++)
            {
                args.Add(ReadType());
            }
            return(sig);
        }
Example #5
0
 /// <summary>
 /// Gets the generic arguments
 /// </summary>
 /// <param name="sig">this</param>
 /// <returns>All generic arguments</returns>
 public static IList <TypeSig> GetGenericArguments(this GenericInstMethodSig sig)
 {
     return(sig == null?ThreadSafeListCreator.Create <TypeSig>() : sig.GenericArguments);
 }
Example #6
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="method">The generic method</param>
 /// <param name="sig">The instantiated method sig</param>
 public MethodSpecUser(IMethodDefOrRef method, GenericInstMethodSig sig)
 {
     this.method        = method;
     this.instantiation = sig;
 }
Example #7
0
 /// <summary>
 /// Checks whether <paramref name="gim"/> contains a <see cref="GenericVar"/> or a
 /// <see cref="GenericMVar"/>.
 /// </summary>
 /// <param name="gim">Generic method signature</param>
 /// <returns><c>true</c> if <paramref name="gim"/> contains a <see cref="GenericVar"/>
 /// or a <see cref="GenericMVar"/>.</returns>
 public static bool ContainsGenericParameter(GenericInstMethodSig gim)
 {
     return(new TypeHelper().ContainsGenericParameterInternal(gim));
 }