[llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Mon Feb 2 13:07:07 PST 2004


Changes in directory llvm/lib/Target/PowerPC:

PowerPCTargetMachine.cpp updated: 1.3 -> 1.4

---
Log message:

Include PowerPC.h.  Flesh out the stub versions of addPassesToEmitAssembly()
and addPassesToJITCompile() slightly.


---
Diffs of the changes:  (+13 -3)

Index: llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp
diff -u llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.3 llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.4
--- llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.3	Fri Jan 23 00:39:30 2004
+++ llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp	Mon Feb  2 13:06:36 2004
@@ -11,6 +11,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "PowerPCTargetMachine.h"
+#include "PowerPC.h"
 #include "llvm/Module.h"
 #include "llvm/PassManager.h"
 #include "llvm/Target/TargetMachineImpls.h"
@@ -35,17 +36,26 @@
     FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 4), JITInfo(*this) {
 }
 
-// addPassesToEmitAssembly - We currently use all of the same passes as the JIT
-// does to emit statically compiled machine code.
+/// addPassesToEmitAssembly - Add passes to the specified pass manager
+/// to implement a static compiler for this target.
+///
 bool PowerPCTargetMachine::addPassesToEmitAssembly(PassManager &PM,
 					       std::ostream &Out) {
-  return true;
+  // <insert instruction selector passes here>
+  PM.add(createRegisterAllocator());
+  PM.add(createPrologEpilogCodeInserter());
+  // <insert assembly code output passes here>
+  PM.add(createMachineCodeDeleter());
+  return true; // change to `return false' when this actually works.
 }
 
 /// addPassesToJITCompile - Add passes to the specified pass manager to
 /// implement a fast dynamic compiler for this target.
 ///
 void PowerPCJITInfo::addPassesToJITCompile(FunctionPassManager &PM) {
+  // <insert instruction selector passes here>
+  PM.add(createRegisterAllocator());
+  PM.add(createPrologEpilogCodeInserter());
 }
 
 } // end namespace llvm





More information about the llvm-commits mailing list