Don't define llvm::X86Disassembler::InstructionSpecifier in different ways in
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sun, 20 Apr 2014 21:35:26 +0000 (21:35 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sun, 20 Apr 2014 21:35:26 +0000 (21:35 +0000)
different source files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206719 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
lib/Target/X86/Disassembler/X86DisassemblerDecoderCommon.h
utils/TableGen/X86DisassemblerShared.h

index 19455e33ed9ef9b49927084483b3b4a09d9b64a2..67f52e55fac4960310a3b32c685615264bfaf379 100644 (file)
@@ -16,9 +16,6 @@
 #ifndef X86DISASSEMBLERDECODER_H
 #define X86DISASSEMBLERDECODER_H
 
-#define INSTRUCTION_SPECIFIER_FIELDS \
-  uint16_t operands;
-
 #define INSTRUCTION_IDS     \
   uint16_t instructionIDs;
 
@@ -531,6 +528,14 @@ typedef int (*byteReader_t)(const void* arg, uint8_t* byte, uint64_t address);
  */
 typedef void (*dlog_t)(void* arg, const char *log);
 
+/*
+ * The specification for how to extract and interpret a full instruction and
+ * its operands.
+ */
+struct InstructionSpecifier {
+  uint16_t operands;
+};
+
 /*
  * The x86 internal instruction, which is produced by the decoder.
  */
index b8130a0f9c73a59b5c67823cf5ad60fe224244cc..d323fa2cc721636c36ff26d7afe60c6feb77f306 100644 (file)
@@ -538,15 +538,6 @@ enum ModifierType {
 
 #define X86_MAX_OPERANDS 5
 
-/*
- * The specification for how to extract and interpret a full instruction and
- * its operands.
- */
-struct InstructionSpecifier {
-  /* The macro below must be defined wherever this file is included. */
-  INSTRUCTION_SPECIFIER_FIELDS
-};
-
 /*
  * Decoding mode for the Intel disassembler.  16-bit, 32-bit, and 64-bit mode
  * are supported, and represent real mode, IA-32e, and IA-32e in 64-bit mode,
index 036e92430b0cca576beab50ed66efe7ff40c7e0b..2d3d3fc1bcbb92d67dcecd4b05e46aea1bdd0d35 100644 (file)
 #include <string.h>
 #include <string>
 
-#define INSTRUCTION_SPECIFIER_FIELDS       \
-  struct OperandSpecifier operands[X86_MAX_OPERANDS]; \
-  InstructionContext      insnContext;     \
-  std::string             name;            \
-                                           \
-  InstructionSpecifier() {                 \
-    insnContext = IC;                      \
-    name = "";                             \
-    memset(operands, 0, sizeof(operands)); \
-  }
-
 #define INSTRUCTION_IDS           \
   InstrUID   instructionIDs[256];
 
 #undef INSTRUCTION_SPECIFIER_FIELDS
 #undef INSTRUCTION_IDS
 
+struct InstructionSpecifier {
+  llvm::X86Disassembler::OperandSpecifier operands[X86_MAX_OPERANDS];
+  llvm::X86Disassembler::InstructionContext insnContext;
+  std::string name;
+
+  InstructionSpecifier() {
+    insnContext = llvm::X86Disassembler::IC;
+    name = "";
+    memset(operands, 0, sizeof(operands));
+  }
+};
+
 #endif