X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FTargetInstrInfo.cpp;h=b14156a937712e5ca87d6d2440862b782fb25707;hb=2b46e8ecccfe8a6adc861158a21b67fb9e786885;hp=ca26718708e1fa08ddb4e418b767de637ba13d17;hpb=93fa70598c88fe14ebe4b3752daab4ea265233e1;p=oota-llvm.git diff --git a/lib/Target/TargetInstrInfo.cpp b/lib/Target/TargetInstrInfo.cpp index ca26718708e..b14156a9377 100644 --- a/lib/Target/TargetInstrInfo.cpp +++ b/lib/Target/TargetInstrInfo.cpp @@ -1,25 +1,29 @@ -//===-- 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 //--------------------------------------------------------------------------- -MachineInstrInfo::MachineInstrInfo(const TargetMachine& tgt, - const MachineInstrDescriptor* Desc, +MachineInstrInfo::MachineInstrInfo(const MachineInstrDescriptor* Desc, unsigned DescSize, unsigned NumRealOpCodes) - : target(tgt), desc(Desc), descSize(DescSize), numRealOpCodes(NumRealOpCodes) { + : desc(Desc), descSize(DescSize), numRealOpCodes(NumRealOpCodes) { // FIXME: TargetInstrDescriptors should not be global assert(TargetInstrDescriptors == NULL && desc != NULL); TargetInstrDescriptors = desc; // initialize global variable @@ -29,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 {