Introduce new headers whose inclusion forces linking and
[oota-llvm.git] / lib / Target / CellSPU / SPUTargetMachine.cpp
index 3019b55e36cc0926e1a7d8ff7c5cbf5ccc11e8c3..a1e843c1269c485522bfe842df051a416071126b 100644 (file)
 #include "llvm/Module.h"
 #include "llvm/PassManager.h"
 #include "llvm/Target/TargetMachineRegistry.h"
+#include "llvm/CodeGen/RegAllocRegistry.h"
+#include "llvm/CodeGen/SchedulerRegistry.h"
 
 using namespace llvm;
 
+/// CellSPUTargetMachineModule - Note that this is used on hosts that
+/// cannot link in a library unless there are references into the
+/// library.  In particular, it seems that it is not possible to get
+/// things to work on Win32 without this.  Though it is unused, do not
+/// remove it.
+extern "C" int CellSPUTargetMachineModule;
+int CellSPUTargetMachineModule = 0;
+
 namespace {
   // Register the targets
   RegisterTarget<SPUTargetMachine>
-  CELLSPU("cellspu", "  STI CBEA Cell SPU");
+  CELLSPU("cellspu", "STI CBEA Cell SPU [experimental]");
+}
+
+// Force static initialization when called from llvm/InitializeAllTargets.h
+namespace llvm {
+  void InitializeCellSPUTarget() { }
 }
 
 const std::pair<unsigned, int> *
@@ -36,7 +51,7 @@ SPUFrameInfo::getCalleeSaveSpillSlots(unsigned &NumEntries) const {
 const TargetAsmInfo *
 SPUTargetMachine::createTargetAsmInfo() const
 {
-  return new SPUTargetAsmInfo(*this);
+  return new SPULinuxTargetAsmInfo(*this);
 }
 
 unsigned
@@ -71,15 +86,18 @@ SPUTargetMachine::SPUTargetMachine(const Module &M, const std::string &FS)
 //===----------------------------------------------------------------------===//
 
 bool
-SPUTargetMachine::addInstSelector(PassManagerBase &PM, bool Fast)
+SPUTargetMachine::addInstSelector(PassManagerBase &PM,
+                                  CodeGenOpt::Level OptLevel)
 {
   // Install an instruction selector.
   PM.add(createSPUISelDag(*this));
   return false;
 }
 
-bool SPUTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, 
-                                          std::ostream &Out) {
-  PM.add(createSPUAsmPrinterPass(Out, *this));
+bool SPUTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
+                                          CodeGenOpt::Level OptLevel,
+                                          bool Verbose,
+                                          raw_ostream &Out) {
+  PM.add(createSPUAsmPrinterPass(Out, *this, OptLevel, Verbose));
   return false;
 }