OSDN Git Service

simplify SPULinuxTargetAsmInfo, remove use of TM.
authorChris Lattner <sabre@nondot.org>
Sun, 2 Aug 2009 04:44:33 +0000 (04:44 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 2 Aug 2009 04:44:33 +0000 (04:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77869 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CellSPU/SPUTargetAsmInfo.cpp
lib/Target/CellSPU/SPUTargetAsmInfo.h
lib/Target/CellSPU/SPUTargetMachine.cpp

index 76c4db4..66c25a8 100644 (file)
 //===----------------------------------------------------------------------===//
 
 #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<TargetAsmInfo>(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<TargetAsmInfo>);
index 8217c16..9507ff9 100644 (file)
 #define SPUTARGETASMINFO_H
 
 #include "llvm/Target/TargetAsmInfo.h"
-#include "SPUTargetMachine.h"
-#include "SPUSubtarget.h"
 
 namespace llvm {
 
-  // Forward declaration.
-  class SPUTargetMachine;
-  
-  template <class BaseTAI>
-  struct SPUTargetAsmInfo : public BaseTAI {
-    explicit SPUTargetAsmInfo(const SPUTargetMachine &TM) {
-      /* (unused today)
-       * const SPUSubtarget *Subtarget = &TM.getSubtarget<SPUSubtarget>(); */
-
-      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<TargetAsmInfo> {
-    explicit SPULinuxTargetAsmInfo(const SPUTargetMachine &TM);
+  struct SPULinuxTargetAsmInfo : public TargetAsmInfo {
+    explicit SPULinuxTargetAsmInfo();
   };
 } // namespace llvm
 
index 26215cd..340eb56 100644 (file)
@@ -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;