#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> *
const TargetAsmInfo *
SPUTargetMachine::createTargetAsmInfo() const
{
- return new SPUTargetAsmInfo(*this);
+ return new SPULinuxTargetAsmInfo(*this);
}
unsigned
//===----------------------------------------------------------------------===//
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;
}