diff options
author | Chris Lattner <sabre@nondot.org> | 2003-12-20 01:22:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-12-20 01:22:19 +0000 |
commit | 1e60a9165dc4d6ce5650dacc026f2942696af920 (patch) | |
tree | 6af93d79e843f6f224f31d291f0b7a7aca81e7b8 /lib/Target/SparcV9/SparcV9TargetMachine.cpp | |
parent | 370e809107c5baf5671daa8709e7d981c0a89685 (diff) | |
download | external_llvm-1e60a9165dc4d6ce5650dacc026f2942696af920.zip external_llvm-1e60a9165dc4d6ce5650dacc026f2942696af920.tar.gz external_llvm-1e60a9165dc4d6ce5650dacc026f2942696af920.tar.bz2 |
Rip JIT specific stuff out of TargetMachine, as per PR176
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10542 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SparcV9/SparcV9TargetMachine.cpp')
-rw-r--r-- | lib/Target/SparcV9/SparcV9TargetMachine.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/lib/Target/SparcV9/SparcV9TargetMachine.cpp b/lib/Target/SparcV9/SparcV9TargetMachine.cpp index 5bbed40..a122e3c 100644 --- a/lib/Target/SparcV9/SparcV9TargetMachine.cpp +++ b/lib/Target/SparcV9/SparcV9TargetMachine.cpp @@ -73,7 +73,8 @@ SparcTargetMachine::SparcTargetMachine() schedInfo(*this), regInfo(*this), frameInfo(*this), - cacheInfo(*this) { + cacheInfo(*this), + jitInfo(*this) { } // addPassesToEmitAssembly - This method controls the entire code generation @@ -152,8 +153,8 @@ SparcTargetMachine::addPassesToEmitAssembly(PassManager &PM, std::ostream &Out) // addPassesToJITCompile - This method controls the JIT method of code // generation for the UltraSparc. // -bool SparcTargetMachine::addPassesToJITCompile(FunctionPassManager &PM) { - const TargetData &TD = getTargetData(); +void SparcJITInfo::addPassesToJITCompile(FunctionPassManager &PM) { + const TargetData &TD = TM.getTargetData(); PM.add(new TargetData("lli", TD.isLittleEndian(), TD.getPointerSize(), TD.getPointerAlignment(), TD.getDoubleAlignment())); @@ -173,11 +174,11 @@ bool SparcTargetMachine::addPassesToJITCompile(FunctionPassManager &PM) { PM.add(createDecomposeMultiDimRefsPass()); // Construct and initialize the MachineFunction object for this fn. - PM.add(createMachineCodeConstructionPass(*this)); + PM.add(createMachineCodeConstructionPass(TM)); // Specialize LLVM code for this target machine and then // run basic dataflow optimizations on LLVM code. - PM.add(createPreSelectionPass(*this)); + PM.add(createPreSelectionPass(TM)); // Run basic dataflow optimizations on LLVM code PM.add(createReassociatePass()); @@ -185,15 +186,13 @@ bool SparcTargetMachine::addPassesToJITCompile(FunctionPassManager &PM) { //PM.add(createLICMPass()); //PM.add(createGCSEPass()); - PM.add(createInstructionSelectionPass(*this)); + PM.add(createInstructionSelectionPass(TM)); - PM.add(getRegisterAllocator(*this)); + PM.add(getRegisterAllocator(TM)); PM.add(createPrologEpilogInsertionPass()); if (!DisablePeephole) - PM.add(createPeepholeOptsPass(*this)); - - return false; // success! + PM.add(createPeepholeOptsPass(TM)); } //---------------------------------------------------------------------------- @@ -201,10 +200,6 @@ bool SparcTargetMachine::addPassesToJITCompile(FunctionPassManager &PM) { // that implements the Sparc backend. (the llvm/CodeGen/Sparc.h interface) //---------------------------------------------------------------------------- -namespace llvm { - -TargetMachine *allocateSparcTargetMachine(const Module &M) { +TargetMachine *llvm::allocateSparcTargetMachine(const Module &M) { return new SparcTargetMachine(); } - -} |