summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/MSP430/MSP430TargetMachine.cpp')
-rw-r--r--llvm/lib/Target/MSP430/MSP430TargetMachine.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp b/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp
index bf259e2add5..1558d01e2cd 100644
--- a/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp
+++ b/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp
@@ -37,7 +37,10 @@ static RegisterTarget<MSP430TargetMachine>
X(TheMSP430Target, "msp430", "MSP430 [experimental]");
// Force static initialization.
-extern "C" void LLVMInitializeMSP430Target() { }
+extern "C" void LLVMInitializeMSP430Target() {
+ TargetRegistry::RegisterAsmPrinter(TheMSP430Target,
+ &createMSP430CodePrinterPass);
+}
MSP430TargetMachine::MSP430TargetMachine(const Target &T,
const Module &M,
@@ -64,8 +67,10 @@ bool MSP430TargetMachine::addAssemblyEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool Verbose,
formatted_raw_ostream &Out) {
- // Output assembly language.
- PM.add(createMSP430CodePrinterPass(Out, *this, Verbose));
+ FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
+ if (!Printer)
+ llvm_report_error("unable to create assembly printer");
+ PM.add(Printer);
return false;
}
OpenPOWER on IntegriCloud