Skip to content

Instruction Mask

BlazingTwist edited this page Dec 19, 2022 · 1 revision

The InstructionMask class has several static Factory Methods to make your code easier to read.
Let's explore how we can use them to match various CodeInstructions:

FactoryMethod CodeInstruction(Ldarg, 5) CodeInstruction(Ldloc, 5) CodeInstruction(Ldloc, 4)
MatchAny ()
MatchOpCodes (Ldarg, Ldfld)
MatchOperands (5, 4)
MatchOperand (5) (4)
MatchOpCode (Ldarg) (Ldloc)
MatchInstruction (Ldarg, 5) (Ldloc, 5) (Ldloc, 4)
MatchCodeInstruction (CodeInstruction(Ldarg, 5)) (CodeInstruction(Ldloc, 5)) (CodeInstruction(Ldloc, 4))

See also:

Clone this wiki locally