diff options
author | Dan Gohman <gohman@apple.com> | 2008-03-11 22:29:46 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-03-11 22:29:46 +0000 |
commit | bfae83139dcb4fffd50b939e1b1224b0126f04d4 (patch) | |
tree | 384a612855c8cb2cdf31642dc137ed7c9081449b /include/llvm | |
parent | e846dd89c173d462d197046b76d37588896623f3 (diff) | |
download | external_llvm-bfae83139dcb4fffd50b939e1b1224b0126f04d4.zip external_llvm-bfae83139dcb4fffd50b939e1b1224b0126f04d4.tar.gz external_llvm-bfae83139dcb4fffd50b939e1b1224b0126f04d4.tar.bz2 |
Use PassManagerBase instead of FunctionPassManager for functions
that merely add passes. This allows them to be used with either
FunctionPassManager or PassManager, or even with a custom new
kind of pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48256 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/CodeGen/FileWriters.h | 6 | ||||
-rw-r--r-- | include/llvm/Target/TargetJITInfo.h | 1 | ||||
-rw-r--r-- | include/llvm/Target/TargetMachine.h | 26 |
3 files changed, 16 insertions, 17 deletions
diff --git a/include/llvm/CodeGen/FileWriters.h b/include/llvm/CodeGen/FileWriters.h index d8be4d8..ac66b9d 100644 --- a/include/llvm/CodeGen/FileWriters.h +++ b/include/llvm/CodeGen/FileWriters.h @@ -18,13 +18,13 @@ namespace llvm { - class FunctionPassManager; + class PassManagerBase; class MachineCodeEmitter; class TargetMachine; - MachineCodeEmitter *AddELFWriter(FunctionPassManager &FPM, std::ostream &O, + MachineCodeEmitter *AddELFWriter(PassManagerBase &FPM, std::ostream &O, TargetMachine &TM); - MachineCodeEmitter *AddMachOWriter(FunctionPassManager &FPM, std::ostream &O, + MachineCodeEmitter *AddMachOWriter(PassManagerBase &FPM, std::ostream &O, TargetMachine &TM); } // end llvm namespace diff --git a/include/llvm/Target/TargetJITInfo.h b/include/llvm/Target/TargetJITInfo.h index 98d17c4..c78a212 100644 --- a/include/llvm/Target/TargetJITInfo.h +++ b/include/llvm/Target/TargetJITInfo.h @@ -23,7 +23,6 @@ namespace llvm { class Function; - class FunctionPassManager; class MachineBasicBlock; class MachineCodeEmitter; class MachineRelocation; diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h index 60068b6..5c721a685 100644 --- a/include/llvm/Target/TargetMachine.h +++ b/include/llvm/Target/TargetMachine.h @@ -30,7 +30,7 @@ class TargetFrameInfo; class MachineCodeEmitter; class TargetRegisterInfo; class Module; -class FunctionPassManager; +class PassManagerBase; class PassManager; class Pass; class TargetMachOWriterInfo; @@ -195,7 +195,7 @@ public: /// This method should return FileModel::Error if emission of this file type /// is not supported. /// - virtual FileModel::Model addPassesToEmitFile(FunctionPassManager &PM, + virtual FileModel::Model addPassesToEmitFile(PassManagerBase &PM, std::ostream &Out, CodeGenFileType FileType, bool Fast) { @@ -206,7 +206,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) { return true; } @@ -217,7 +217,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) { return true; } @@ -251,7 +251,7 @@ public: /// 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); @@ -260,7 +260,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 @@ -269,7 +269,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. @@ -277,7 +277,7 @@ 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 &PM, bool Fast) { return true; } @@ -285,14 +285,14 @@ public: /// 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 &PM, 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 &PM, bool Fast) { return false; } @@ -300,7 +300,7 @@ 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, + virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, std::ostream &Out) { return true; } @@ -308,7 +308,7 @@ public: /// 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. If DumpAsm is true, the generated assembly is printed to cerr. - virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast, bool DumpAsm, + virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast, bool DumpAsm, MachineCodeEmitter &MCE) { return true; } @@ -317,7 +317,7 @@ public: /// a code emitter (without setting flags), if supported. If this is not /// supported, 'true' should be returned. If DumpAsm is true, the generated /// assembly is printed to cerr. - virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast, + virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast, bool DumpAsm, MachineCodeEmitter &MCE) { return true; } |