X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FCellSPU%2FSPUTargetMachine.cpp;h=6500067849dbd1581425213f56a7906bee3c70f8;hb=1bd7335a17010bd4d8f86736cf73cac9f3fb80a5;hp=880da0dff4313e86490b010e56c4ddc49ead135b;hpb=f05522974b3c1b9dc2644831364e19d5132e751b;p=oota-llvm.git diff --git a/lib/Target/CellSPU/SPUTargetMachine.cpp b/lib/Target/CellSPU/SPUTargetMachine.cpp index 880da0dff43..6500067849d 100644 --- a/lib/Target/CellSPU/SPUTargetMachine.cpp +++ b/lib/Target/CellSPU/SPUTargetMachine.cpp @@ -13,48 +13,36 @@ #include "SPU.h" #include "SPURegisterNames.h" -#include "SPUTargetAsmInfo.h" +#include "SPUMCAsmInfo.h" #include "SPUTargetMachine.h" -#include "llvm/Module.h" #include "llvm/PassManager.h" -#include "llvm/Target/TargetMachineRegistry.h" #include "llvm/CodeGen/RegAllocRegistry.h" #include "llvm/CodeGen/SchedulerRegistry.h" +#include "llvm/Target/TargetRegistry.h" using namespace llvm; -extern Target TheCellSPUTarget; -namespace { - // Register the targets - RegisterTarget - CELLSPU(TheCellSPUTarget, "cellspu", "STI CBEA Cell SPU [experimental]"); +extern "C" void LLVMInitializeCellSPUTarget() { + // Register the target. + RegisterTargetMachine X(TheCellSPUTarget); + RegisterAsmInfo Y(TheCellSPUTarget); } -// Force static initialization. -extern "C" void LLVMInitializeCellSPUTarget() { } - const std::pair * SPUFrameInfo::getCalleeSaveSpillSlots(unsigned &NumEntries) const { NumEntries = 1; return &LR[0]; } -const TargetAsmInfo * -SPUTargetMachine::createTargetAsmInfo() const -{ - return new SPULinuxTargetAsmInfo(*this); -} - -SPUTargetMachine::SPUTargetMachine(const Target &T, const Module &M, +SPUTargetMachine::SPUTargetMachine(const Target &T, const std::string &TT, const std::string &FS) - : LLVMTargetMachine(T), - Subtarget(*this, M, FS), + : LLVMTargetMachine(T, TT), + Subtarget(TT, FS), DataLayout(Subtarget.getTargetDataString()), InstrInfo(*this), FrameInfo(*this), TLInfo(*this), - InstrItins(Subtarget.getInstrItineraryData()) -{ + InstrItins(Subtarget.getInstrItineraryData()) { // For the time being, use static relocations, since there's really no // support for PIC yet. setRelocationModel(Reloc::Static); @@ -64,22 +52,9 @@ SPUTargetMachine::SPUTargetMachine(const Target &T, const Module &M, // Pass Pipeline Configuration //===----------------------------------------------------------------------===// -bool -SPUTargetMachine::addInstSelector(PassManagerBase &PM, - CodeGenOpt::Level OptLevel) -{ +bool SPUTargetMachine::addInstSelector(PassManagerBase &PM, + CodeGenOpt::Level OptLevel) { // Install an instruction selector. PM.add(createSPUISelDag(*this)); return false; } - -bool SPUTargetMachine::addAssemblyEmitter(PassManagerBase &PM, - CodeGenOpt::Level OptLevel, - bool Verbose, - formatted_raw_ostream &Out) { - FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose); - if (!Printer) - llvm_report_error("unable to create assembly printer"); - PM.add(Printer); - return false; -}