//
// 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.
//
//===----------------------------------------------------------------------===//
//
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;
/// 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
/// 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.
/// 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;
}
/// 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;
}
/// 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;
}
/// 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;
}
};
/// 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);
/// 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
/// 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.
/// 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;
}
/// 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