Printing support for more stuff
[oota-llvm.git] / lib / Target / TargetInstrInfo.cpp
index a911116f7bcf673318a6e73fba714c482b311b6f..b14156a937712e5ca87d6d2440862b782fb25707 100644 (file)
@@ -1,14 +1,19 @@
-//===-- TargetMachine.cpp - General Target Information ---------------------==//
+//===-- MachineInstrInfo.cpp - Target Instruction Information -------------===//
 //
-// This file describes the general parts of a Target machine.
-// This file also implements MachineInstrInfo and MachineCacheInfo.
 //
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Target/MachineInstrInfo.h"
+#include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/Constant.h"
 #include "llvm/DerivedTypes.h"
 
+// External object describing the machine instructions
+// Initialized only when the TargetMachine class is created
+// and reset when that class is destroyed.
+// 
+const MachineInstrDescriptor* TargetInstrDescriptors = 0;
+
 //---------------------------------------------------------------------------
 // class MachineInstructionInfo
 //     Interface to description of machine instructions
@@ -28,6 +33,10 @@ MachineInstrInfo::~MachineInstrInfo() {
   TargetInstrDescriptors = NULL;       // reset global variable
 }
 
+void MachineInstrInfo::print(const MachineInstr *MI, std::ostream &O,
+                             const TargetMachine &TM) const {
+  MI->print(O, TM);
+}
 
 bool MachineInstrInfo::constantFitsInImmedField(MachineOpCode opCode,
                                                 int64_t intValue) const {