Implement MachineInstrInfo interface
[oota-llvm.git] / lib / Target / X86 / X86InstrInfo.cpp
1 //===- X86InstructionInfo.cpp - X86 Instruction Information ---------------===//
2 //
3 // This file contains the X86 implementation of the MInstructionInfo class.
4 //
5 //===----------------------------------------------------------------------===//
6
7 #include "X86InstructionInfo.h"
8 #include "llvm/CodeGen/MachineInstr.h"
9 #include <iostream>
10
11 // X86Insts - Turn the InstructionInfo.def file into a bunch of instruction
12 // descriptors
13 //
14 static const MachineInstrDescriptor X86Insts[] = {
15 #define I(ENUM, NAME, FLAGS, TSFLAGS) \
16              { NAME, -1, -1, 0, false, 0, 0, TSFLAGS, FLAGS },
17 #include "X86InstructionInfo.def"
18 };
19
20 X86InstructionInfo::X86InstructionInfo()
21   : MachineInstrInfo(X86Insts, sizeof(X86Insts)/sizeof(X86Insts[0]), 0) {
22 }
23
24
25 // print - Print out an x86 instruction in GAS syntax
26 void X86InstructionInfo::print(const MachineInstr *MI, std::ostream &O) const {
27   // FIXME: This sucks.
28   O << getName(MI->getOpCode()) << "\n";
29 }
30