static RegisterTarget<MipsTargetMachine> X("mips", "Mips");
static RegisterTarget<MipselTargetMachine> Y("mipsel", "Mipsel");
+MipsTargetMachine::AsmPrinterCtorFn MipsTargetMachine::AsmPrinterCtor = 0;
+
+
+// Force static initialization when called from llvm/InitializeAllTargets.h
+namespace llvm {
+ void InitializeMipsTarget() { }
+}
+
const TargetAsmInfo *MipsTargetMachine::
createTargetAsmInfo() const
{
// Install an instruction selector pass using
// the ISelDag to gen Mips code.
bool MipsTargetMachine::
-addInstSelector(PassManagerBase &PM, unsigned OptLevel)
+addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel)
{
PM.add(createMipsISelDag(*this));
return false;
// machine code is emitted. return true if -print-machineinstrs should
// print out the code after the passes.
bool MipsTargetMachine::
-addPreEmitPass(PassManagerBase &PM, unsigned OptLevel)
+addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel)
{
PM.add(createMipsDelaySlotFillerPass(*this));
return true;
// Implements the AssemblyEmitter for the target. Must return
// true if AssemblyEmitter is supported
bool MipsTargetMachine::
-addAssemblyEmitter(PassManagerBase &PM, unsigned OptLevel,
- bool Verbose, raw_ostream &Out)
-{
+addAssemblyEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
+ bool Verbose, raw_ostream &Out) {
// Output assembly language.
- PM.add(createMipsCodePrinterPass(Out, *this, OptLevel, Verbose));
+ assert(AsmPrinterCtor && "AsmPrinter was not linked in");
+ PM.add(AsmPrinterCtor(Out, *this, OptLevel, Verbose));
return false;
}