summaryrefslogtreecommitdiff
path: root/lib/Target/Alpha
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-25 06:49:55 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-25 06:49:55 +0000
commit0c795d61878156817cedbac51ec2921f2634c1a5 (patch)
tree368d6bec69dc60fd9d6fcf8201a1a76500a7546f /lib/Target/Alpha
parent92ccf70ad448eb02f9f273d2c70ae4708b3bd0f2 (diff)
downloadllvm-0c795d61878156817cedbac51ec2921f2634c1a5.tar.gz
llvm-0c795d61878156817cedbac51ec2921f2634c1a5.tar.bz2
llvm-0c795d61878156817cedbac51ec2921f2634c1a5.tar.xz
Add new helpers for registering targets.
- Less boilerplate == good. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77052 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Alpha')
-rw-r--r--lib/Target/Alpha/Alpha.h3
-rw-r--r--lib/Target/Alpha/AlphaTargetMachine.cpp12
-rw-r--r--lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp14
3 files changed, 6 insertions, 23 deletions
diff --git a/lib/Target/Alpha/Alpha.h b/lib/Target/Alpha/Alpha.h
index 93c4c70260..b8a06459e1 100644
--- a/lib/Target/Alpha/Alpha.h
+++ b/lib/Target/Alpha/Alpha.h
@@ -26,9 +26,6 @@ namespace llvm {
class formatted_raw_ostream;
FunctionPass *createAlphaISelDag(AlphaTargetMachine &TM);
- FunctionPass *createAlphaCodePrinterPass(formatted_raw_ostream &OS,
- TargetMachine &TM,
- bool Verbose);
FunctionPass *createAlphaPatternInstructionSelector(TargetMachine &TM);
FunctionPass *createAlphaCodeEmitterPass(AlphaTargetMachine &TM,
MachineCodeEmitter &MCE);
diff --git a/lib/Target/Alpha/AlphaTargetMachine.cpp b/lib/Target/Alpha/AlphaTargetMachine.cpp
index 1947e65670..70d7b15248 100644
--- a/lib/Target/Alpha/AlphaTargetMachine.cpp
+++ b/lib/Target/Alpha/AlphaTargetMachine.cpp
@@ -16,17 +16,15 @@
#include "AlphaTargetMachine.h"
#include "llvm/Module.h"
#include "llvm/PassManager.h"
-#include "llvm/Target/TargetMachineRegistry.h"
#include "llvm/Support/FormattedStream.h"
+#include "llvm/Target/TargetRegistry.h"
using namespace llvm;
-// Register the targets
-static RegisterTarget<AlphaTargetMachine> X(TheAlphaTarget, "alpha",
- "Alpha [experimental]");
-
-// Force static initialization.
-extern "C" void LLVMInitializeAlphaTarget() { }
+extern "C" void LLVMInitializeAlphaTarget() {
+ // Register the target.
+ RegisterTargetMachine<AlphaTargetMachine> X(TheAlphaTarget);
+}
const TargetAsmInfo *AlphaTargetMachine::createTargetAsmInfo() const {
return new AlphaTargetAsmInfo(*this);
diff --git a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
index e6cc53a072..08a2c3430e 100644
--- a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
+++ b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
@@ -63,17 +63,6 @@ namespace {
};
} // end of anonymous namespace
-/// createAlphaCodePrinterPass - Returns a pass that prints the Alpha
-/// 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::createAlphaCodePrinterPass(formatted_raw_ostream &o,
- TargetMachine &tm,
- bool verbose) {
- return new AlphaAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
-}
-
#include "AlphaGenAsmWriter.inc"
void AlphaAsmPrinter::printOperand(const MachineInstr *MI, int opNum)
@@ -288,6 +277,5 @@ bool AlphaAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
// Force static initialization.
extern "C" void LLVMInitializeAlphaAsmPrinter() {
- TargetRegistry::RegisterAsmPrinter(TheAlphaTarget,
- createAlphaCodePrinterPass);
+ RegisterAsmPrinter<AlphaAsmPrinter> X(TheAlphaTarget);
}