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); }
public static bool MatchLdloc(this ILNode node, ILVariable expectedVar) { ILVariable v; return(node.Match(ILCode.Ldloc, out v) && v == expectedVar); }
public static bool MatchThis(this ILNode node) { ILVariable v; return(node.Match(ILCode.Ldloc, out v) && v.IsParameter && v.OriginalParameter.Index == -1); }