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
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 @@
schedInfo(*this),
regInfo(*this),
frameInfo(*this),
- cacheInfo(*this) {
+ cacheInfo(*this),
+ jitInfo(*this) {
}
// addPassesToEmitAssembly - This method controls the entire code generation
@@ -152,8 +153,8 @@
// 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 @@
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 @@
//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 @@
// 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();
}
-
-}