Ejemplo n.º 1
0
        public static bool Match <T>(this ILNode node, ILCode code, out T operand, out ILExpression arg)
        {
            List <ILExpression> args;

            if (node.Match(code, out operand, out args) && args.Count == 1)
            {
                arg = args[0];
                return(true);
            }
            arg = null;
            return(false);
        }
Ejemplo n.º 2
0
        public static bool MatchLdloc(this ILNode node, ILVariable expectedVar)
        {
            ILVariable v;

            return(node.Match(ILCode.Ldloc, out v) && v == expectedVar);
        }
Ejemplo n.º 3
0
        public static bool MatchThis(this ILNode node)
        {
            ILVariable v;

            return(node.Match(ILCode.Ldloc, out v) && v.IsParameter && v.OriginalParameter.Index == -1);
        }