diff options
author | Bill Wendling <isanbard@gmail.com> | 2007-02-08 01:39:44 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2007-02-08 01:39:44 +0000 |
commit | eb1ac3385096dd6f45a1548f3492f21648f55b4c (patch) | |
tree | 3287520c2c9c1ed9784304a202db68f8494f63fc /lib/Target/PowerPC | |
parent | 50e4e88d9797753390e86a513ece4e9ce7ab5d77 (diff) | |
download | external_llvm-eb1ac3385096dd6f45a1548f3492f21648f55b4c.zip external_llvm-eb1ac3385096dd6f45a1548f3492f21648f55b4c.tar.gz external_llvm-eb1ac3385096dd6f45a1548f3492f21648f55b4c.tar.bz2 |
Moved the MachOWriter and ELFWriter out of the Target/* files. Placed the
definition of it into the CodeGen library. This is so that a backend doesn't
necessarily add in these writers if it doesn't use them (like in the lli
program).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34034 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC')
-rw-r--r-- | lib/Target/PowerPC/PPC.h | 2 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCMachOWriterInfo.cpp | 6 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCTargetMachine.cpp | 16 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCTargetMachine.h | 4 |
4 files changed, 11 insertions, 17 deletions
diff --git a/lib/Target/PowerPC/PPC.h b/lib/Target/PowerPC/PPC.h index bfaa874..9327f30 100644 --- a/lib/Target/PowerPC/PPC.h +++ b/lib/Target/PowerPC/PPC.h @@ -33,8 +33,6 @@ FunctionPass *createPPCAsmPrinterPass(std::ostream &OS, PPCTargetMachine &TM); FunctionPass *createPPCCodeEmitterPass(PPCTargetMachine &TM, MachineCodeEmitter &MCE); -void addPPCMachOObjectWriterPass(FunctionPassManager &FPM, std::ostream &o, - PPCTargetMachine &tm); } // end namespace llvm; // Defines symbolic names for PowerPC registers. This defines a mapping from diff --git a/lib/Target/PowerPC/PPCMachOWriterInfo.cpp b/lib/Target/PowerPC/PPCMachOWriterInfo.cpp index 7b5c4fe..e2c2ceb 100644 --- a/lib/Target/PowerPC/PPCMachOWriterInfo.cpp +++ b/lib/Target/PowerPC/PPCMachOWriterInfo.cpp @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by Bill Wendling and is distributed under the -// University of Illinois Open Source License. See LICENSE.TXT for details. +// This file was developed by Nate Begeman and Bill Wendling and is distributed +// under the University of Illinois Open Source License. See LICENSE.TXT for +// details. // //===----------------------------------------------------------------------===// // @@ -25,7 +26,6 @@ PPCMachOWriterInfo::PPCMachOWriterInfo(const PPCTargetMachine &TM) HDR_CPU_SUBTYPE_POWERPC_ALL) {} PPCMachOWriterInfo::~PPCMachOWriterInfo() {} - /// GetTargetRelocation - For the MachineRelocation MR, convert it to one or /// more PowerPC MachORelocation(s), add the new relocations to the /// MachOSection, and rewrite the instruction at the section offset if required diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp index f23b022..99c4aa1 100644 --- a/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -129,16 +129,6 @@ bool PPCTargetMachine::addAssemblyEmitter(FunctionPassManager &PM, bool Fast, return false; } -bool PPCTargetMachine::addObjectWriter(FunctionPassManager &PM, bool Fast, - std::ostream &Out) { - // FIXME: until the macho writer is 100% functional, diable this by default. - return true; - - // FIXME: support PPC ELF files at some point - addPPCMachOObjectWriterPass(PM, Out, *this); - return false; -} - bool PPCTargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast, MachineCodeEmitter &MCE) { // The JIT should use the static relocation model in ppc32 mode, PIC in ppc64. @@ -161,3 +151,9 @@ bool PPCTargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast, return false; } +bool PPCTargetMachine::addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast, + MachineCodeEmitter &MCE) { + // Machine code emitter pass for PowerPC. + PM.add(createPPCCodeEmitterPass(*this, MCE)); + return false; +} diff --git a/lib/Target/PowerPC/PPCTargetMachine.h b/lib/Target/PowerPC/PPCTargetMachine.h index af35cc5..a249952 100644 --- a/lib/Target/PowerPC/PPCTargetMachine.h +++ b/lib/Target/PowerPC/PPCTargetMachine.h @@ -69,10 +69,10 @@ public: virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast); virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast, std::ostream &Out); - virtual bool addObjectWriter(FunctionPassManager &PM, bool Fast, - std::ostream &Out); virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast, MachineCodeEmitter &MCE); + virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast, + MachineCodeEmitter &MCE); }; /// PPC32TargetMachine - PowerPC 32-bit target machine. |