From 9b9014f2a088356e4ba814d7f0fd422af721f32d Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Fri, 14 Aug 2009 19:06:50 +0000 Subject: 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 --- lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp | 8 +++----- lib/Target/MSP430/MSP430TargetMachine.cpp | 7 +++++++ 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 X(TheMSP430Target); - RegisterAsmPrinter Y(TheMSP430Target); - RegisterAsmInfo Z(TheMSP430Target); +// Force static initialization. +extern "C" void LLVMInitializeMSP430AsmPrinter() { + RegisterAsmPrinter 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 X(TheMSP430Target); + RegisterAsmInfo Z(TheMSP430Target); +} + MSP430TargetMachine::MSP430TargetMachine(const Target &T, const std::string &TT, const std::string &FS) : -- cgit v1.1