[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC.h PPCMachOWriterInfo.cpp PPCTargetMachine.cpp PPCTargetMachine.h

Bill Wendling isanbard at gmail.com
Wed Feb 7 17:40:04 PST 2007



Changes in directory llvm/lib/Target/PowerPC:

PPC.h updated: 1.37 -> 1.38
PPCMachOWriterInfo.cpp updated: 1.2 -> 1.3
PPCTargetMachine.cpp updated: 1.115 -> 1.116
PPCTargetMachine.h updated: 1.28 -> 1.29
---
Log message:

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).


---
Diffs of the changes:  (+11 -17)

 PPC.h                  |    2 --
 PPCMachOWriterInfo.cpp |    6 +++---
 PPCTargetMachine.cpp   |   16 ++++++----------
 PPCTargetMachine.h     |    4 ++--
 4 files changed, 11 insertions(+), 17 deletions(-)


Index: llvm/lib/Target/PowerPC/PPC.h
diff -u llvm/lib/Target/PowerPC/PPC.h:1.37 llvm/lib/Target/PowerPC/PPC.h:1.38
--- llvm/lib/Target/PowerPC/PPC.h:1.37	Fri Nov 17 16:10:59 2006
+++ llvm/lib/Target/PowerPC/PPC.h	Wed Feb  7 19:39:44 2007
@@ -33,8 +33,6 @@
                                       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


Index: llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp
diff -u llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp:1.2 llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp:1.3
--- llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp:1.2	Fri Feb  2 20:41:58 2007
+++ llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp	Wed Feb  7 19:39:44 2007
@@ -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 @@
                           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


Index: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
diff -u llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.115 llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.116
--- llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.115	Tue Jan 23 21:41:36 2007
+++ llvm/lib/Target/PowerPC/PPCTargetMachine.cpp	Wed Feb  7 19:39:44 2007
@@ -129,16 +129,6 @@
   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 @@
   return false;
 }
 
+bool PPCTargetMachine::addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
+                                            MachineCodeEmitter &MCE) {
+  // Machine code emitter pass for PowerPC.
+  PM.add(createPPCCodeEmitterPass(*this, MCE));
+  return false;
+}


Index: llvm/lib/Target/PowerPC/PPCTargetMachine.h
diff -u llvm/lib/Target/PowerPC/PPCTargetMachine.h:1.28 llvm/lib/Target/PowerPC/PPCTargetMachine.h:1.29
--- llvm/lib/Target/PowerPC/PPCTargetMachine.h:1.28	Tue Jan 23 21:41:36 2007
+++ llvm/lib/Target/PowerPC/PPCTargetMachine.h	Wed Feb  7 19:39:44 2007
@@ -69,10 +69,10 @@
   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.






More information about the llvm-commits mailing list