From: Benjamin Kramer Date: Sat, 11 Feb 2012 16:01:02 +0000 (+0000) Subject: Don't mix declarations and code. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=6b30274e27fc65752abb2e1fe48b538ccd824a24;p=oota-llvm.git Don't mix declarations and code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150305 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c b/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c index c15709d33da..72ae8552027 100644 --- a/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c +++ b/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c @@ -826,7 +826,7 @@ static int getID(struct InternalInstruction* insn, void *miiArg) { const struct InstructionSpecifier *spec; uint16_t instructionIDWithOpsize; - const struct InstructionSpecifier *specWithOpsize; + const char *specName, *specWithOpSizeName; spec = specifierForUID(instructionID); @@ -843,15 +843,13 @@ static int getID(struct InternalInstruction* insn, void *miiArg) { return 0; } - specWithOpsize = specifierForUID(instructionIDWithOpsize); - - const char *specName = x86DisassemblerGetInstrName(instructionID, miiArg); - const char *specWithOpSizeSizeName = + specName = x86DisassemblerGetInstrName(instructionID, miiArg); + specWithOpSizeName = x86DisassemblerGetInstrName(instructionIDWithOpsize, miiArg); - if (is16BitEquvalent(specName, specWithOpSizeSizeName)) { + if (is16BitEquvalent(specName, specWithOpSizeName)) { insn->instructionID = instructionIDWithOpsize; - insn->spec = specWithOpsize; + insn->spec = specifierForUID(instructionIDWithOpsize); } else { insn->instructionID = instructionID; insn->spec = spec; diff --git a/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h b/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h index c2a40ae0d3c..7e2667614fd 100644 --- a/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h +++ b/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h @@ -20,7 +20,7 @@ extern "C" { #endif -#define INSTRUCTION_SPECIFIER_FIELDS \ +#define INSTRUCTION_SPECIFIER_FIELDS #define INSTRUCTION_IDS \ unsigned instructionIDs;