Hi,
this NFC change replaces a sequence of generated
if (Kind == MCK_XXX) {
if (Operand.isXXX()) return MCTargetAsmParser::Match_Success;
}
to
switch (Kind) {
default: break;
...
case MCK_xxx: ...
if (Operand.isXXX()) return MCTargetAsmParser::Match_Success;
break;
...
}
Potentially can generate faster Kind check and significantly eases step debugging.
Example of output (from AMDGPU backend):
switch(Kind) { default: break; // 'Clamp' class case MCK_Clamp: if (Operand.isClamp()) return MCTargetAsmParser::Match_Success; break; // 'DMask' class case MCK_DMask: if (Operand.isDMask()) return MCTargetAsmParser::Match_Success; break;
...
} // end switch(Kind)
space before '('