Cleanup the mess in msp430 target registration and hopefully unbreak the build
authorAnton Korobeynikov <asl@math.spbu.ru>
Fri, 14 Aug 2009 19:06:50 +0000 (19:06 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Fri, 14 Aug 2009 19:06:50 +0000 (19:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79024 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp
lib/Target/MSP430/MSP430TargetMachine.cpp

index fd8c7d1715ee51ad399466f280f67fd7d8069f2c..c746385b9a0699b1de2352f44c57e441896a615a 100644 (file)
@@ -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);
 }
index 56495e6b21b55c1305fe4869c06cf2ab6356cf81..08190aa7cc8b2b9b46bc0cad4ccb98f95b0dab97 100644 (file)
 #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) :