Remove warnings about unused parameters and shadowed variables.
[oota-llvm.git] / include / llvm / Target / TargetMachine.h
index 01cbe7d3106a98a5122ed475eea4280693af5aeb..b495f85d349936afcabd1daa3aa5108d664d4a26 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -24,14 +24,13 @@ class TargetAsmInfo;
 class TargetData;
 class TargetSubtarget;
 class TargetInstrInfo;
-class TargetInstrDescriptor;
 class TargetJITInfo;
 class TargetLowering;
 class TargetFrameInfo;
 class MachineCodeEmitter;
-class MRegisterInfo;
+class TargetRegisterInfo;
 class Module;
-class FunctionPassManager;
+class PassManagerBase;
 class PassManager;
 class Pass;
 class TargetMachOWriterInfo;
@@ -100,7 +99,7 @@ public:
   /// used by the LLC tool to determine which target to use when an explicit
   /// -march option is not specified.  If a target returns zero, it will never
   /// be chosen without an explicit -march option.
-  static unsigned getModuleMatchQuality(const Module &M) { return 0; }
+  static unsigned getModuleMatchQuality(const Module &) { return 0; }
 
   /// getJITMatchQuality - This static method should be implemented by targets
   /// that provide JIT capabilities to indicate how suitable they are for
@@ -141,7 +140,7 @@ public:
   /// not, return null.  This is kept separate from RegInfo until RegInfo has
   /// details of graph coloring register allocation removed from it.
   ///
-  virtual const MRegisterInfo *getRegisterInfo() const { return 0; }
+  virtual const TargetRegisterInfo *getRegisterInfo() const { return 0; }
 
   /// getJITInfo - If this target supports a JIT, return information for it,
   /// otherwise return null.
@@ -187,18 +186,19 @@ public:
 
   /// getEnableTailMergeDefault - the default setting for -enable-tail-merge
   /// on this target.  User flag overrides.
-  virtual const bool getEnableTailMergeDefault() const { return false; }
+  virtual bool getEnableTailMergeDefault() const { return true; }
 
   /// addPassesToEmitFile - Add passes to the specified pass manager to get the
   /// specified file emitted.  Typically this will involve several steps of code
   /// generation.  If Fast is set to true, the code generator should emit code
-  /// as fast as possible, without regard for compile time.  This method should
-  /// return FileModel::Error if emission of this file type is not supported.
+  /// as fast as possible, though the generated code may be less efficient.
+  /// This method should return FileModel::Error if emission of this file type
+  /// is not supported.
   ///
-  virtual FileModel::Model addPassesToEmitFile(FunctionPassManager &PM,
-                                               std::ostream &Out,
-                                               CodeGenFileType FileType,
-                                               bool Fast) {
+  virtual FileModel::Model addPassesToEmitFile(PassManagerBase &,
+                                               std::ostream &,
+                                               CodeGenFileType,
+                                               bool /*Fast*/) {
     return FileModel::None;
   }
 
@@ -206,8 +206,8 @@ public:
   /// to be split up (e.g., to add an object writer pass), this method can be
   /// used to finish up adding passes to emit the file, if necessary.
   ///
-  virtual bool addPassesToEmitFileFinish(FunctionPassManager &PM,
-                                         MachineCodeEmitter *MCE, bool Fast) {
+  virtual bool addPassesToEmitFileFinish(PassManagerBase &,
+                                         MachineCodeEmitter *, bool /*Fast*/) {
     return true;
   }
  
@@ -217,8 +217,9 @@ public:
   /// of functions.  This method returns true if machine code emission is
   /// not supported.
   ///
-  virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
-                                          MachineCodeEmitter &MCE, bool Fast) {
+  virtual bool addPassesToEmitMachineCode(PassManagerBase &,
+                                          MachineCodeEmitter &,
+                                          bool /*Fast*/) {
     return true;
   }
 
@@ -226,8 +227,8 @@ public:
   /// require having the entire module at once.  This is not recommended, do not
   /// use this.
   virtual bool WantsWholeFile() const { return false; }
-  virtual bool addPassesToEmitWholeFile(PassManager &PM, std::ostream &Out,
-                                        CodeGenFileType FileType, bool Fast) {
+  virtual bool addPassesToEmitWholeFile(PassManager &, std::ostream &,
+                                        CodeGenFileType, bool /*Fast*/) {
     return true;
   }
 };
@@ -243,14 +244,15 @@ public:
   /// addPassesToEmitFile - Add passes to the specified pass manager to get the
   /// specified file emitted.  Typically this will involve several steps of code
   /// generation.  If Fast is set to true, the code generator should emit code
-  /// as fast as possible, without regard for compile time.  This method should
-  /// return FileModel::Error if emission of this file type is not supported.
+  /// as fast as possible, though the generated code may be less efficient.
+  /// This method should return FileModel::Error if emission of this file type
+  /// is not supported.
   ///
   /// The default implementation of this method adds components from the
   /// LLVM retargetable code generator, invoking the methods below to get
   /// target-specific passes in standard locations.
   ///
-  virtual FileModel::Model addPassesToEmitFile(FunctionPassManager &PM,
+  virtual FileModel::Model addPassesToEmitFile(PassManagerBase &PM,
                                                std::ostream &Out,
                                                CodeGenFileType FileType,
                                                bool Fast);
@@ -259,7 +261,7 @@ public:
   /// to be split up (e.g., to add an object writer pass), this method can be
   /// used to finish up adding passes to emit the file, if necessary.
   ///
-  virtual bool addPassesToEmitFileFinish(FunctionPassManager &PM,
+  virtual bool addPassesToEmitFileFinish(PassManagerBase &PM,
                                          MachineCodeEmitter *MCE, bool Fast);
  
   /// addPassesToEmitMachineCode - Add passes to the specified pass manager to
@@ -268,7 +270,7 @@ public:
   /// of functions.  This method returns true if machine code emission is
   /// not supported.
   ///
-  virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
+  virtual bool addPassesToEmitMachineCode(PassManagerBase &PM,
                                           MachineCodeEmitter &MCE, bool Fast);
   
   /// Target-Independent Code Generator Pass Configuration Options.
@@ -276,22 +278,29 @@ public:
   /// addInstSelector - This method should add any "last minute" LLVM->LLVM
   /// passes, then install an instruction selector pass, which converts from
   /// LLVM code to machine instructions.
-  virtual bool addInstSelector(FunctionPassManager &PM, bool Fast) {
+  virtual bool addInstSelector(PassManagerBase &, bool /*Fast*/) {
     return true;
   }
-  
+
+  /// addPreRegAllocPasses - This method may be implemented by targets that want
+  /// to run passes immediately before register allocation. This should return
+  /// true if -print-machineinstrs should print after these passes.
+  virtual bool addPreRegAlloc(PassManagerBase &, bool /*Fast*/) {
+    return false;
+  }
+
   /// addPostRegAllocPasses - This method may be implemented by targets that
   /// want to run passes after register allocation but before prolog-epilog
   /// insertion.  This should return true if -print-machineinstrs should print
   /// after these passes.
-  virtual bool addPostRegAlloc(FunctionPassManager &PM, bool Fast) {
+  virtual bool addPostRegAlloc(PassManagerBase &, bool /*Fast*/) {
     return false;
   }
   
   /// addPreEmitPass - This pass may be implemented by targets that want to run
   /// passes immediately before machine code is emitted.  This should return
   /// true if -print-machineinstrs should print out the code after the passes.
-  virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast) {
+  virtual bool addPreEmitPass(PassManagerBase &, bool /*Fast*/) {
     return false;
   }
   
@@ -299,30 +308,31 @@ public:
   /// addAssemblyEmitter - This pass should be overridden by the target to add
   /// the asmprinter, if asm emission is supported.  If this is not supported,
   /// 'true' should be returned.
-  virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast
-                                  std::ostream &Out) {
+  virtual bool addAssemblyEmitter(PassManagerBase &, bool /*Fast*/
+                                  std::ostream &) {
     return true;
   }
   
   /// addCodeEmitter - This pass should be overridden by the target to add a
   /// code emitter, if supported.  If this is not supported, 'true' should be
-  /// returned.
-  virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast, 
-                              MachineCodeEmitter &MCE) {
+  /// returned. If DumpAsm is true, the generated assembly is printed to cerr.
+  virtual bool addCodeEmitter(PassManagerBase &, bool /*Fast*/,
+                              bool /*DumpAsm*/, MachineCodeEmitter &) {
     return true;
   }
 
   /// addSimpleCodeEmitter - This pass should be overridden by the target to add
   /// a code emitter (without setting flags), if supported.  If this is not
-  /// supported, 'true' should be returned.
-  virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast, 
-                                    MachineCodeEmitter &MCE) {
+  /// supported, 'true' should be returned.  If DumpAsm is true, the generated
+  /// assembly is printed to cerr.
+  virtual bool addSimpleCodeEmitter(PassManagerBase &, bool /*Fast*/,
+                                    bool /*DumpAsm*/, MachineCodeEmitter &) {
     return true;
   }
 
   /// getEnableTailMergeDefault - the default setting for -enable-tail-merge
   /// on this target.  User flag overrides.
-  virtual const bool getEnableTailMergeDefault() const { return false; }
+  virtual bool getEnableTailMergeDefault() const { return true; }
 };
 
 } // End llvm namespace