Factor shared code

llvm-svn: 7600
This commit is contained in:
Chris Lattner 2003-08-05 16:34:44 +00:00
parent edc8c54e16
commit 1d6ba3e359
1 changed files with 4 additions and 8 deletions

View File

@ -41,15 +41,12 @@ X86TargetMachine::X86TargetMachine(unsigned Config)
FrameInfo(TargetFrameInfo::StackGrowsDown, 8/*16 for SSE*/, 4) {
}
// llc backend for x86
// addPassesToEmitAssembly - We currently use all of the same passes as the JIT
// does to emit statically compiled machine code.
bool X86TargetMachine::addPassesToEmitAssembly(PassManager &PM,
std::ostream &Out) {
PM.add(createLowerSwitchPass());
PM.add(createX86SimpleInstructionSelector(*this));
PM.add(createLocalRegisterAllocator());
PM.add(createX86FloatingPointStackifierPass());
PM.add(createPrologEpilogCodeInserter());
PM.add(createX86PeepholeOptimizerPass());
addPassesToJITCompile(PM);
PM.add(createX86CodePrinterPass(Out, *this));
return false; // success!
}
@ -93,7 +90,6 @@ bool X86TargetMachine::addPassesToJITCompile(PassManager &PM) {
if (PrintCode) // Print the register-allocated code
PM.add(createX86CodePrinterPass(std::cerr, *this));
return false; // success!
}