1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00

StringSwitchify.

llvm-svn: 163649
This commit is contained in:
Chad Rosier 2012-09-11 21:10:25 +00:00
parent e7a6502bbe
commit c778c0a3f4

View File

@ -633,14 +633,16 @@ X86Operand *X86AsmParser::ParseOperand() {
/// getIntelMemOperandSize - Return intel memory operand size.
static unsigned getIntelMemOperandSize(StringRef OpStr) {
if (OpStr == "BYTE") return 8;
if (OpStr == "WORD") return 16;
if (OpStr == "DWORD") return 32;
if (OpStr == "QWORD") return 64;
if (OpStr == "XWORD") return 80;
if (OpStr == "XMMWORD") return 128;
if (OpStr == "YMMWORD") return 256;
return 0;
unsigned Size = StringSwitch<unsigned>(OpStr)
.Case("BYTE", 8)
.Case("WORD", 16)
.Case("DWORD", 32)
.Case("QWORD", 64)
.Case("XWORD", 80)
.Case("XMMWORD", 128)
.Case("YMMWORD", 256)
.Default(0);
return Size;
}
X86Operand *X86AsmParser::ParseIntelBracExpression(unsigned SegReg,