From: Chris Lattner Date: Sun, 2 Aug 2009 04:44:33 +0000 (+0000) Subject: simplify SPULinuxTargetAsmInfo, remove use of TM. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=09e820b07cc5ae52de35d402cd419030dd3765a0;p=oota-llvm.git simplify SPULinuxTargetAsmInfo, remove use of TM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77869 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/CellSPU/SPUTargetAsmInfo.cpp b/lib/Target/CellSPU/SPUTargetAsmInfo.cpp index 76c4db48307..66c25a84b4b 100644 --- a/lib/Target/CellSPU/SPUTargetAsmInfo.cpp +++ b/lib/Target/CellSPU/SPUTargetAsmInfo.cpp @@ -12,16 +12,17 @@ //===----------------------------------------------------------------------===// #include "SPUTargetAsmInfo.h" -#include "SPUTargetMachine.h" -#include "llvm/Function.h" -#include "llvm/Support/Compiler.h" -#include "llvm/Support/Dwarf.h" - using namespace llvm; -using namespace llvm::dwarf; -SPULinuxTargetAsmInfo::SPULinuxTargetAsmInfo(const SPUTargetMachine &TM) : - SPUTargetAsmInfo(TM) { +SPULinuxTargetAsmInfo::SPULinuxTargetAsmInfo() { + ZeroDirective = "\t.space\t"; + SetDirective = "\t.set"; + Data64bitsDirective = "\t.quad\t"; + AlignmentIsInBytes = false; + LCOMMDirective = "\t.lcomm\t"; + InlineAsmStart = "# InlineAsm Start"; + InlineAsmEnd = "# InlineAsm End"; + PCSymbol = "."; CommentString = "#"; GlobalPrefix = ""; @@ -50,6 +51,3 @@ SPULinuxTargetAsmInfo::SPULinuxTargetAsmInfo(const SPUTargetMachine &TM) : SupportsExceptionHandling = false; } - -// Instantiate default implementation. -TEMPLATE_INSTANTIATION(class SPUTargetAsmInfo); diff --git a/lib/Target/CellSPU/SPUTargetAsmInfo.h b/lib/Target/CellSPU/SPUTargetAsmInfo.h index 8217c16fb87..9507ff9e59e 100644 --- a/lib/Target/CellSPU/SPUTargetAsmInfo.h +++ b/lib/Target/CellSPU/SPUTargetAsmInfo.h @@ -15,32 +15,11 @@ #define SPUTARGETASMINFO_H #include "llvm/Target/TargetAsmInfo.h" -#include "SPUTargetMachine.h" -#include "SPUSubtarget.h" namespace llvm { - // Forward declaration. - class SPUTargetMachine; - - template - struct SPUTargetAsmInfo : public BaseTAI { - explicit SPUTargetAsmInfo(const SPUTargetMachine &TM) { - /* (unused today) - * const SPUSubtarget *Subtarget = &TM.getSubtarget(); */ - - BaseTAI::ZeroDirective = "\t.space\t"; - BaseTAI::SetDirective = "\t.set"; - BaseTAI::Data64bitsDirective = "\t.quad\t"; - BaseTAI::AlignmentIsInBytes = false; - BaseTAI::LCOMMDirective = "\t.lcomm\t"; - BaseTAI::InlineAsmStart = "# InlineAsm Start"; - BaseTAI::InlineAsmEnd = "# InlineAsm End"; - } - }; - - struct SPULinuxTargetAsmInfo : public SPUTargetAsmInfo { - explicit SPULinuxTargetAsmInfo(const SPUTargetMachine &TM); + struct SPULinuxTargetAsmInfo : public TargetAsmInfo { + explicit SPULinuxTargetAsmInfo(); }; } // namespace llvm diff --git a/lib/Target/CellSPU/SPUTargetMachine.cpp b/lib/Target/CellSPU/SPUTargetMachine.cpp index 26215cd26fc..340eb56f361 100644 --- a/lib/Target/CellSPU/SPUTargetMachine.cpp +++ b/lib/Target/CellSPU/SPUTargetMachine.cpp @@ -34,10 +34,8 @@ SPUFrameInfo::getCalleeSaveSpillSlots(unsigned &NumEntries) const { return &LR[0]; } -const TargetAsmInfo * -SPUTargetMachine::createTargetAsmInfo() const -{ - return new SPULinuxTargetAsmInfo(*this); +const TargetAsmInfo *SPUTargetMachine::createTargetAsmInfo() const { + return new SPULinuxTargetAsmInfo(); } SPUTargetMachine::SPUTargetMachine(const Target &T, const Module &M, @@ -48,8 +46,7 @@ SPUTargetMachine::SPUTargetMachine(const Target &T, const Module &M, 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); @@ -59,10 +56,8 @@ 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;