From de3aa4f77f511ace5b9fc1e3a777b0c3ec5ffa27 Mon Sep 17 00:00:00 2001 From: Brian Gaeke Date: Wed, 18 Jun 2003 21:43:21 +0000 Subject: [PATCH] lib/Target/X86/X86TargetMachine.{cpp,h}: Add initial version (non-working) of llc guts for X86, and add a prototype for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6779 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86TargetMachine.cpp | 13 +++++++++++++ lib/Target/X86/X86TargetMachine.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index d5a628cb670..1673fffd0c1 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -41,6 +41,19 @@ X86TargetMachine::X86TargetMachine(unsigned Config) FrameInfo(TargetFrameInfo::StackGrowsDown, 8/*16 for SSE*/, 4) { } +// llc backend for x86 +bool X86TargetMachine::addPassesToEmitAssembly(PassManager &PM, + std::ostream &Out) { + PM.add(createLowerSwitchPass()); + PM.add(createSimpleX86InstructionSelector(*this)); + PM.add(createLocalRegisterAllocator()); + PM.add(createX86FloatingPointStackifierPass()); + PM.add(createPrologEpilogCodeInserter()); + PM.add(createX86PeepholeOptimizerPass()); + PM.add(createX86CodePrinterPass(Out)); + return false; // success! +} + /// addPassesToJITCompile - Add passes to the specified pass manager to /// implement a fast dynamic compiler for this target. Return true if this is /// not supported for this target. diff --git a/lib/Target/X86/X86TargetMachine.h b/lib/Target/X86/X86TargetMachine.h index 35a3b6a4285..0b2981d3809 100644 --- a/lib/Target/X86/X86TargetMachine.h +++ b/lib/Target/X86/X86TargetMachine.h @@ -42,6 +42,8 @@ public: /// virtual bool addPassesToEmitMachineCode(PassManager &PM, MachineCodeEmitter &MCE); + + virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out); }; #endif -- 2.34.1