aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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) :