diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-07-25 06:49:55 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-25 06:49:55 +0000 |
| commit | 5680b4f285402e7cf1dc6aa7e5527ca8270a55a7 (patch) | |
| tree | 8ef1bb8de5dddc88860992616994fb07efd8de1f /llvm/lib/Target/Mips | |
| parent | d43b86d4a45f4cfc5b1e27d62ace35940a52e82b (diff) | |
| download | bcm5719-llvm-5680b4f285402e7cf1dc6aa7e5527ca8270a55a7.tar.gz bcm5719-llvm-5680b4f285402e7cf1dc6aa7e5527ca8270a55a7.zip | |
Add new helpers for registering targets.
- Less boilerplate == good.
llvm-svn: 77052
Diffstat (limited to 'llvm/lib/Target/Mips')
| -rw-r--r-- | llvm/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp | 16 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/Mips.h | 3 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MipsTargetMachine.cpp | 15 |
3 files changed, 8 insertions, 26 deletions
diff --git a/llvm/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp b/llvm/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp index 132c9b0000b..9eda5e222cf 100644 --- a/llvm/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp +++ b/llvm/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp @@ -87,16 +87,6 @@ namespace { #include "MipsGenAsmWriter.inc" -/// createMipsCodePrinterPass - Returns a pass that prints the MIPS -/// assembly code for a MachineFunction to the given output stream, -/// using the given target machine description. This should work -/// regardless of whether the function is in SSA form. -FunctionPass *llvm::createMipsCodePrinterPass(formatted_raw_ostream &o, - TargetMachine &tm, - bool verbose) { - return new MipsAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose); -} - //===----------------------------------------------------------------------===// // // Mips Asm Directives @@ -560,8 +550,6 @@ void MipsAsmPrinter::PrintGlobalVariable(const GlobalVariable *GVar) { // Force static initialization. extern "C" void LLVMInitializeMipsAsmPrinter() { - TargetRegistry::RegisterAsmPrinter(TheMipsTarget, createMipsCodePrinterPass); - - TargetRegistry::RegisterAsmPrinter(TheMipselTarget, - createMipsCodePrinterPass); + RegisterAsmPrinter<MipsAsmPrinter> X(TheMipsTarget); + RegisterAsmPrinter<MipsAsmPrinter> Y(TheMipselTarget); } diff --git a/llvm/lib/Target/Mips/Mips.h b/llvm/lib/Target/Mips/Mips.h index 09a80729a56..a9ab050d6f0 100644 --- a/llvm/lib/Target/Mips/Mips.h +++ b/llvm/lib/Target/Mips/Mips.h @@ -25,9 +25,6 @@ namespace llvm { FunctionPass *createMipsISelDag(MipsTargetMachine &TM); FunctionPass *createMipsDelaySlotFillerPass(MipsTargetMachine &TM); - FunctionPass *createMipsCodePrinterPass(formatted_raw_ostream &OS, - TargetMachine &TM, - bool Verbose); extern Target TheMipsTarget; extern Target TheMipselTarget; diff --git a/llvm/lib/Target/Mips/MipsTargetMachine.cpp b/llvm/lib/Target/Mips/MipsTargetMachine.cpp index e82dcee6362..b5e2da74ba7 100644 --- a/llvm/lib/Target/Mips/MipsTargetMachine.cpp +++ b/llvm/lib/Target/Mips/MipsTargetMachine.cpp @@ -16,17 +16,14 @@ #include "MipsTargetMachine.h" #include "llvm/Module.h" #include "llvm/PassManager.h" -#include "llvm/Target/TargetMachineRegistry.h" +#include "llvm/Target/TargetRegistry.h" using namespace llvm; -// Register the target. -static RegisterTarget<MipsTargetMachine> X(TheMipsTarget, "mips", "Mips"); - -static RegisterTarget<MipselTargetMachine> Y(TheMipselTarget, "mipsel", - "Mipsel"); - -// Force static initialization. -extern "C" void LLVMInitializeMipsTarget() { } +extern "C" void LLVMInitializeMipsTarget() { + // Register the target. + RegisterTargetMachine<MipsTargetMachine> X(TheMipsTarget); + RegisterTargetMachine<MipselTargetMachine> Y(TheMipselTarget); +} const TargetAsmInfo *MipsTargetMachine:: createTargetAsmInfo() const |

