Lexically order files in CMakeLists.txt files.
[oota-llvm.git] / lib / Target / Mips / MipsTargetMachine.h
index b5dc058e9ea15b633ab54be55e7cf68349a1f9ab..6e2562a312e03b5992022b88577489f0cc79af3f 100644 (file)
@@ -22,7 +22,7 @@
 #include "llvm/Target/TargetFrameInfo.h"
 
 namespace llvm {
-  class raw_ostream;
+  class formatted_raw_ostream;
   
   class MipsTargetMachine : public LLVMTargetMachine {
     MipsSubtarget       Subtarget;
@@ -33,10 +33,23 @@ namespace llvm {
   
   protected:
     virtual const TargetAsmInfo *createTargetAsmInfo() const;
-  
+  protected:
+    // To avoid having target depend on the asmprinter stuff libraries,
+    // asmprinter set this functions to ctor pointer at startup time if they are
+    // linked in.
+    typedef FunctionPass *(*AsmPrinterCtorFn)(formatted_raw_ostream &o,
+                                              TargetMachine &tm,
+                                              bool verbose);
+    static AsmPrinterCtorFn AsmPrinterCtor;
+    
   public:
-    MipsTargetMachine(const Module &M, const std::string &FS, bool isLittle);
+    MipsTargetMachine(const Target &T, const Module &M, const std::string &FS, 
+                      bool isLittle);
 
+    static void registerAsmPrinter(AsmPrinterCtorFn F) {
+      AsmPrinterCtor = F;
+    }
+    
     virtual const MipsInstrInfo   *getInstrInfo()     const 
     { return &InstrInfo; }
     virtual const TargetFrameInfo *getFrameInfo()     const 
@@ -54,20 +67,21 @@ namespace llvm {
       return const_cast<MipsTargetLowering*>(&TLInfo); 
     }
 
-    static unsigned getModuleMatchQuality(const Module &M);
-
     // Pass Pipeline Configuration
-    virtual bool addInstSelector(PassManagerBase &PM, unsigned OptLevel);
-    virtual bool addPreEmitPass(PassManagerBase &PM, unsigned OptLevel);
-    virtual bool addAssemblyEmitter(PassManagerBase &PM, unsigned OptLevel,
-                                    bool Verbose, raw_ostream &Out);
+    virtual bool addInstSelector(PassManagerBase &PM,
+                                 CodeGenOpt::Level OptLevel);
+    virtual bool addPreEmitPass(PassManagerBase &PM,
+                                CodeGenOpt::Level OptLevel);
+    virtual bool addAssemblyEmitter(PassManagerBase &PM,
+                                    CodeGenOpt::Level OptLevel,
+                                    bool Verbose, formatted_raw_ostream &Out);
   };
 
 /// MipselTargetMachine - Mipsel target machine.
 ///
 class MipselTargetMachine : public MipsTargetMachine {
 public:
-  MipselTargetMachine(const Module &M, const std::string &FS);
+  MipselTargetMachine(const Target &T, const Module &M, const std::string &FS);
 
   static unsigned getModuleMatchQuality(const Module &M);
 };