Eliminate MachineFunction& argument from eliminateFrameIndex in x86 Target. Get...
[oota-llvm.git] / lib / Target / SparcV9 / SparcV9TargetMachine.h
index c8a6116186b5bc15f315b27875b134dcfc6e86c0..4a1539c3642502edb2a507e27ce43ce2ea648adc 100644 (file)
@@ -1,4 +1,4 @@
-//===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- C++ -*-===//
+//===-- SparcV9TargetMachine.h - Define TargetMachine for SparcV9 -*- C++ -*-=//
 // 
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,51 +7,48 @@
 // 
 //===----------------------------------------------------------------------===//
 // 
-// This file declares the primary interface to machine description for the
-// UltraSPARC.
+// This file declares the top-level SparcV9 target machine.
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef SPARC_TARGETMACHINE_H
-#define SPARC_TARGETMACHINE_H
+#ifndef SPARCV9TARGETMACHINE_H
+#define SPARCV9TARGETMACHINE_H
 
-#include "llvm/PassManager.h"
 #include "llvm/Target/TargetFrameInfo.h"
 #include "llvm/Target/TargetMachine.h"
-#include "SparcInstrInfo.h"
-#include "SparcInternals.h"
-#include "SparcRegInfo.h"
-#include "SparcFrameInfo.h"
+#include "SparcV9InstrInfo.h"
+#include "SparcV9Internals.h"
+#include "SparcV9RegInfo.h"
+#include "SparcV9FrameInfo.h"
+#include "SparcV9JITInfo.h"
 
 namespace llvm {
-
-class SparcTargetMachine : public TargetMachine {
-  SparcInstrInfo instrInfo;
-  SparcSchedInfo schedInfo;
-  SparcRegInfo   regInfo;
-  SparcFrameInfo frameInfo;
-  SparcCacheInfo cacheInfo;
+  class PassManager;
+
+class SparcV9TargetMachine : public TargetMachine {
+  SparcV9InstrInfo instrInfo;
+  SparcV9SchedInfo schedInfo;
+  SparcV9RegInfo   regInfo;
+  SparcV9FrameInfo frameInfo;
+  SparcV9JITInfo   jitInfo;
 public:
-  SparcTargetMachine();
-
-  virtual const TargetInstrInfo  &getInstrInfo() const { return instrInfo; }
-  virtual const TargetSchedInfo  &getSchedInfo() const { return schedInfo; }
-  virtual const TargetRegInfo    &getRegInfo()   const { return regInfo; }
-  virtual const TargetFrameInfo  &getFrameInfo() const { return frameInfo; }
-  virtual const TargetCacheInfo  &getCacheInfo() const { return cacheInfo; }
+  SparcV9TargetMachine(const Module &M, IntrinsicLowering *IL);
+  
+  virtual const TargetInstrInfo  *getInstrInfo() const { return &instrInfo; }
+  virtual const TargetSchedInfo  *getSchedInfo() const { return &schedInfo; }
+  virtual const SparcV9RegInfo   *getRegInfo()   const { return &regInfo; }
+  virtual const TargetFrameInfo  *getFrameInfo() const { return &frameInfo; }
+  virtual       TargetJITInfo    *getJITInfo()         { return &jitInfo; }
+  virtual const MRegisterInfo    *getRegisterInfo() const {
+    return &instrInfo.getRegisterInfo();
+  }
 
   virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
-  virtual bool addPassesToJITCompile(FunctionPassManager &PM);
   virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
                                           MachineCodeEmitter &MCE);
-  virtual void replaceMachineCodeForFunction(void *Old, void *New);
-
-  /// getJITStubForFunction - Create or return a stub for the specified
-  /// function.  This stub acts just like the specified function, except that it
-  /// allows the "address" of the function to be taken without having to
-  /// generate code for it.
-  ///
-  ///virtual void *getJITStubForFunction(Function *F, MachineCodeEmitter &MCE);
+
+  static unsigned getModuleMatchQuality(const Module &M);
+  static unsigned getJITMatchQuality();
 };
 
 } // End llvm namespace