llvm.org GIT mirror llvm / 5aacafc
Don't define llvm::X86Disassembler::InstructionSpecifier in different ways in different source files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206719 91177308-0d34-0410-b5e6-96231b3b80d8 Richard Smith 6 years ago
3 changed file(s) with 20 addition(s) and 23 deletion(s). Raw diff Collapse all Expand all
1414
1515 #ifndef X86DISASSEMBLERDECODER_H
1616 #define X86DISASSEMBLERDECODER_H
17
18 #define INSTRUCTION_SPECIFIER_FIELDS \
19 uint16_t operands;
2017
2118 #define INSTRUCTION_IDS \
2219 uint16_t instructionIDs;
531528 typedef void (*dlog_t)(void* arg, const char *log);
532529
533530 /*
531 * The specification for how to extract and interpret a full instruction and
532 * its operands.
533 */
534 struct InstructionSpecifier {
535 uint16_t operands;
536 };
537
538 /*
534539 * The x86 internal instruction, which is produced by the decoder.
535540 */
536541 struct InternalInstruction {
538538 #define X86_MAX_OPERANDS 5
539539
540540 /*
541 * The specification for how to extract and interpret a full instruction and
542 * its operands.
543 */
544 struct InstructionSpecifier {
545 /* The macro below must be defined wherever this file is included. */
546 INSTRUCTION_SPECIFIER_FIELDS
547 };
548
549 /*
550541 * Decoding mode for the Intel disassembler. 16-bit, 32-bit, and 64-bit mode
551542 * are supported, and represent real mode, IA-32e, and IA-32e in 64-bit mode,
552543 * respectively.
1212 #include
1313 #include
1414
15 #define INSTRUCTION_SPECIFIER_FIELDS \
16 struct OperandSpecifier operands[X86_MAX_OPERANDS]; \
17 InstructionContext insnContext; \
18 std::string name; \
19 \
20 InstructionSpecifier() { \
21 insnContext = IC; \
22 name = ""; \
23 memset(operands, 0, sizeof(operands)); \
24 }
25
2615 #define INSTRUCTION_IDS \
2716 InstrUID instructionIDs[256];
2817
3120 #undef INSTRUCTION_SPECIFIER_FIELDS
3221 #undef INSTRUCTION_IDS
3322
23 struct InstructionSpecifier {
24 llvm::X86Disassembler::OperandSpecifier operands[X86_MAX_OPERANDS];
25 llvm::X86Disassembler::InstructionContext insnContext;
26 std::string name;
27
28 InstructionSpecifier() {
29 insnContext = llvm::X86Disassembler::IC;
30 name = "";
31 memset(operands, 0, sizeof(operands));
32 }
33 };
34
3435 #endif