aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2009-08-14 19:06:50 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2009-08-14 19:06:50 +0000
commit9b9014f2a088356e4ba814d7f0fd422af721f32d (patch)
treee9c873997bd0f336c3473e65235ed2d2d4212ce0
parent9a0b165cb58cb5cf49cb3a143c302029f389acb2 (diff)
downloadexternal_llvm-9b9014f2a088356e4ba814d7f0fd422af721f32d.zip
external_llvm-9b9014f2a088356e4ba814d7f0fd422af721f32d.tar.gz
external_llvm-9b9014f2a088356e4ba814d7f0fd422af721f32d.tar.bz2
Cleanup the mess in msp430 target registration and hopefully unbreak the build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79024 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp8
-rw-r--r--lib/Target/MSP430/MSP430TargetMachine.cpp7
2 files changed, 10 insertions, 5 deletions
diff --git a/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp b/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp
index fd8c7d1..c746385 100644
--- a/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp
+++ b/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp
@@ -242,9 +242,7 @@ void MSP430AsmPrinter::printCCOperand(const MachineInstr *MI, int OpNum) {
}
}
-extern "C" void LLVMInitializeMSP430Target() {
- // Register the target.
- RegisterTargetMachine<MSP430TargetMachine> X(TheMSP430Target);
- RegisterAsmPrinter<MSP430AsmPrinter> Y(TheMSP430Target);
- RegisterAsmInfo<MSP430TargetAsmInfo> Z(TheMSP430Target);
+// Force static initialization.
+extern "C" void LLVMInitializeMSP430AsmPrinter() {
+ RegisterAsmPrinter<MSP430AsmPrinter> X(TheMSP430Target);
}
diff --git a/lib/Target/MSP430/MSP430TargetMachine.cpp b/lib/Target/MSP430/MSP430TargetMachine.cpp
index 56495e6..08190aa 100644
--- a/lib/Target/MSP430/MSP430TargetMachine.cpp
+++ b/lib/Target/MSP430/MSP430TargetMachine.cpp
@@ -17,8 +17,15 @@
#include "llvm/PassManager.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Target/TargetAsmInfo.h"
+#include "llvm/Target/TargetRegistry.h"
using namespace llvm;
+extern "C" void LLVMInitializeMSP430Target() {
+ // Register the target.
+ RegisterTargetMachine<MSP430TargetMachine> X(TheMSP430Target);
+ RegisterAsmInfo<MSP430TargetAsmInfo> Z(TheMSP430Target);
+}
+
MSP430TargetMachine::MSP430TargetMachine(const Target &T,
const std::string &TT,
const std::string &FS) :