diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-15 23:17:20 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-15 23:17:20 +0000 |
commit | 1e1f8ba28cc05212dfd347be219daa698d7294a5 (patch) | |
tree | f7633721aea9c1fc92a560c755e8ce7c3f4beb9e /lib/Target/PIC16/PIC16TargetMachine.cpp | |
parent | fea4ec6dff9634ff134911369f3853bf6bc85dc5 (diff) |
Register AsmPrinter for XCore, MSP430, and PIC16 targets.
- Switch to standard addAssemblyEmitter logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75854 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PIC16/PIC16TargetMachine.cpp')
-rw-r--r-- | lib/Target/PIC16/PIC16TargetMachine.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/Target/PIC16/PIC16TargetMachine.cpp b/lib/Target/PIC16/PIC16TargetMachine.cpp index 45a61fa29be..72c117f759b 100644 --- a/lib/Target/PIC16/PIC16TargetMachine.cpp +++ b/lib/Target/PIC16/PIC16TargetMachine.cpp @@ -41,7 +41,12 @@ static RegisterTarget<CooperTargetMachine> Y(TheCooperTarget, "cooper", "PIC16 Cooper [experimental]."); // Force static initialization. -extern "C" void LLVMInitializePIC16Target() { } +extern "C" void LLVMInitializePIC16Target() { + TargetRegistry::RegisterAsmPrinter(ThePIC16Target, + &createPIC16CodePrinterPass); + TargetRegistry::RegisterAsmPrinter(TheCooperTarget, + &createPIC16CodePrinterPass); +} // PIC16TargetMachine - Traditional PIC16 Machine. PIC16TargetMachine::PIC16TargetMachine(const Target &T, const Module &M, @@ -74,8 +79,10 @@ bool PIC16TargetMachine::addAssemblyEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel, bool Verbose, formatted_raw_ostream &Out) { - // Output assembly language. - PM.add(createPIC16CodePrinterPass(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; } |