summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PIC16
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/PIC16')
-rw-r--r--llvm/lib/Target/PIC16/PIC16.h5
-rw-r--r--llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp20
-rw-r--r--llvm/lib/Target/PIC16/PIC16TargetMachine.cpp16
3 files changed, 10 insertions, 31 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16.h b/llvm/lib/Target/PIC16/PIC16.h
index b1df058cb8e..447beba7d69 100644
--- a/llvm/lib/Target/PIC16/PIC16.h
+++ b/llvm/lib/Target/PIC16/PIC16.h
@@ -343,10 +343,7 @@ namespace PIC16CC {
FunctionPass *createPIC16ISelDag(PIC16TargetMachine &TM);
- FunctionPass *createPIC16CodePrinterPass(formatted_raw_ostream &OS,
- TargetMachine &TM,
- bool Verbose);
- // Banksel optimzer pass.
+ // Banksel optimizer pass.
FunctionPass *createPIC16MemSelOptimizerPass();
extern Target ThePIC16Target;
diff --git a/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp b/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp
index 8cd57614305..95d363e4ecc 100644
--- a/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp
+++ b/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp
@@ -24,6 +24,7 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
+#include "llvm/Target/TargetRegistry.h"
using namespace llvm;
@@ -107,17 +108,6 @@ bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
return false; // we didn't modify anything.
}
-/// createPIC16CodePrinterPass - Returns a pass that prints the PIC16
-/// 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::createPIC16CodePrinterPass(formatted_raw_ostream &o,
- TargetMachine &tm,
- bool verbose) {
- return new PIC16AsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
-}
-
// printOperand - print operand of insn.
void PIC16AsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
@@ -435,3 +425,11 @@ void PIC16AsmPrinter::EmitRemainingAutos() {
}
}
+
+extern "C" void LLVMInitializePIC16Target() {
+ // Register the targets
+ RegisterTargetMachine<PIC16TargetMachine> A(ThePIC16Target);
+ RegisterTargetMachine<CooperTargetMachine> B(TheCooperTarget);
+ RegisterAsmPrinter<PIC16AsmPrinter> C(ThePIC16Target);
+ RegisterAsmPrinter<PIC16AsmPrinter> D(TheCooperTarget);
+}
diff --git a/llvm/lib/Target/PIC16/PIC16TargetMachine.cpp b/llvm/lib/Target/PIC16/PIC16TargetMachine.cpp
index dca6ade9384..6a4492c5484 100644
--- a/llvm/lib/Target/PIC16/PIC16TargetMachine.cpp
+++ b/llvm/lib/Target/PIC16/PIC16TargetMachine.cpp
@@ -18,25 +18,9 @@
#include "llvm/PassManager.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetMachineRegistry.h"
using namespace llvm;
-// Register the targets
-static RegisterTarget<PIC16TargetMachine>
-X(ThePIC16Target, "pic16", "PIC16 14-bit [experimental].");
-
-static RegisterTarget<CooperTargetMachine>
-Y(TheCooperTarget, "cooper", "PIC16 Cooper [experimental].");
-
-// Force static initialization.
-extern "C" void LLVMInitializePIC16Target() {
- TargetRegistry::RegisterAsmPrinter(ThePIC16Target,
- &createPIC16CodePrinterPass);
- TargetRegistry::RegisterAsmPrinter(TheCooperTarget,
- &createPIC16CodePrinterPass);
-}
-
// PIC16TargetMachine - Traditional PIC16 Machine.
PIC16TargetMachine::PIC16TargetMachine(const Target &T, const Module &M,
const std::string &FS, bool Cooper)
OpenPOWER on IntegriCloud