Register Target's TargetMachine and AsmPrinter in the new registry.

- This abuses TargetMachineRegistry's constructor for now, this will get
   cleaned up in time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75762 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2009-07-15 09:22:31 +00:00
parent 7a46d7898e
commit 4246790aa8
37 changed files with 134 additions and 59 deletions

View File

@ -19,6 +19,7 @@
#include "llvm/Module.h"
#include "llvm/Support/Registry.h"
#include "llvm/Target/TargetRegistry.h"
namespace llvm {
class Module;
@ -76,12 +77,13 @@ namespace llvm {
template<class TargetMachineImpl>
struct RegisterTarget {
RegisterTarget(const char *Name, const char *ShortDesc)
RegisterTarget(Target &T, const char *Name, const char *ShortDesc)
: Entry(Name, ShortDesc, &Allocator,
&TargetMachineImpl::getModuleMatchQuality,
&TargetMachineImpl::getJITMatchQuality),
Node(Entry)
{}
Node(Entry) {
TargetRegistry::RegisterTargetMachine(T, &Allocator);
}
private:
TargetMachineRegistry::entry Entry;

View File

@ -94,7 +94,7 @@ inline static const char *ARMCondCodeToString(ARMCC::CondCodes CC) {
FunctionPass *createARMISelDag(ARMBaseTargetMachine &TM);
FunctionPass *createARMCodePrinterPass(formatted_raw_ostream &O,
ARMBaseTargetMachine &TM,
TargetMachine &TM,
bool Verbose);
FunctionPass *createARMCodeEmitterPass(ARMBaseTargetMachine &TM,
MachineCodeEmitter &MCE);

View File

@ -36,8 +36,11 @@ extern "C" int ARMTargetMachineModule;
int ARMTargetMachineModule = 0;
// Register the target.
static RegisterTarget<ARMTargetMachine> X("arm", "ARM");
static RegisterTarget<ThumbTargetMachine> Y("thumb", "Thumb");
extern Target TheARMTarget;
static RegisterTarget<ARMTargetMachine> X(TheARMTarget, "arm", "ARM");
extern Target TheThumbTarget;
static RegisterTarget<ThumbTargetMachine> Y(TheThumbTarget, "thumb", "Thumb");
// Force static initialization.
extern "C" void LLVMInitializeARMTarget() { }

View File

@ -42,7 +42,7 @@ protected:
// To avoid having target depend on the asmprinter stuff libraries, asmprinter
// set this functions to ctor pointer at startup time if they are linked in.
typedef FunctionPass *(*AsmPrinterCtorFn)(formatted_raw_ostream &o,
ARMBaseTargetMachine &tm,
TargetMachine &tm,
bool verbose);
static AsmPrinterCtorFn AsmPrinterCtor;

View File

@ -31,6 +31,7 @@
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSet.h"
@ -1287,7 +1288,7 @@ bool ARMAsmPrinter::doFinalization(Module &M) {
/// regardless of whether the function is in SSA form.
///
FunctionPass *llvm::createARMCodePrinterPass(formatted_raw_ostream &o,
ARMBaseTargetMachine &tm,
TargetMachine &tm,
bool verbose) {
return new ARMAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
}
@ -1301,4 +1302,8 @@ namespace {
}
// Force static initialization.
extern "C" void LLVMInitializeARMAsmPrinter() { }
extern "C" void LLVMInitializeARMAsmPrinter() {
extern Target TheARMTarget, TheThumbTarget;
TargetRegistry::RegisterAsmPrinter(TheARMTarget, createARMCodePrinterPass);
TargetRegistry::RegisterAsmPrinter(TheThumbTarget, createARMCodePrinterPass);
}

View File

@ -22,7 +22,9 @@
using namespace llvm;
// Register the targets
static RegisterTarget<AlphaTargetMachine> X("alpha", "Alpha [experimental]");
extern Target TheAlphaTarget;
static RegisterTarget<AlphaTargetMachine> X(TheAlphaTarget, "alpha",
"Alpha [experimental]");
// No assembler printer by default
AlphaTargetMachine::AsmPrinterCtorFn AlphaTargetMachine::AsmPrinterCtor = 0;

View File

@ -24,6 +24,7 @@
#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Mangler.h"
@ -292,9 +293,6 @@ bool AlphaAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
return false;
}
// Force static initialization.
extern "C" void LLVMInitializeAlphaAsmPrinter() { }
namespace {
static struct Register {
Register() {
@ -302,3 +300,10 @@ namespace {
}
} Registrator;
}
// Force static initialization.
extern "C" void LLVMInitializeAlphaAsmPrinter() {
extern Target TheAlphaTarget;
TargetRegistry::RegisterAsmPrinter(TheAlphaTarget,
createAlphaCodePrinterPass);
}

View File

@ -58,7 +58,8 @@ extern "C" int CBackendTargetMachineModule;
int CBackendTargetMachineModule = 0;
// Register the target.
static RegisterTarget<CTargetMachine> X("c", "C backend");
extern Target TheCBackendTarget;
static RegisterTarget<CTargetMachine> X(TheCBackendTarget, "c", "C backend");
// Force static initialization.
extern "C" void LLVMInitializeCBackendTarget() { }

View File

@ -37,6 +37,7 @@
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
#include <set>
@ -289,7 +290,7 @@ namespace {
class VISIBILITY_HIDDEN LinuxAsmPrinter : public SPUAsmPrinter {
DwarfWriter *DW;
public:
explicit LinuxAsmPrinter(formatted_raw_ostream &O, SPUTargetMachine &TM,
explicit LinuxAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *T, bool V)
: SPUAsmPrinter(O, TM, T, V), DW(0) {}
@ -599,14 +600,11 @@ bool LinuxAsmPrinter::doFinalization(Module &M) {
/// that the Linux SPU assembler can deal with.
///
FunctionPass *llvm::createSPUAsmPrinterPass(formatted_raw_ostream &o,
SPUTargetMachine &tm,
TargetMachine &tm,
bool verbose) {
return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
}
// Force static initialization.
extern "C" void LLVMInitializeCellSPUAsmPrinter() { }
namespace {
static struct Register {
Register() {
@ -614,3 +612,9 @@ namespace {
}
} Registrator;
}
// Force static initialization.
extern "C" void LLVMInitializeCellSPUAsmPrinter() {
extern Target TheCellSPUTarget;
TargetRegistry::RegisterAsmPrinter(TheCellSPUTarget, createSPUAsmPrinterPass);
}

View File

@ -25,7 +25,7 @@ namespace llvm {
FunctionPass *createSPUISelDag(SPUTargetMachine &TM);
FunctionPass *createSPUAsmPrinterPass(formatted_raw_ostream &o,
SPUTargetMachine &tm,
TargetMachine &tm,
bool verbose);
/*--== Utility functions/predicates/etc used all over the place: --==*/

View File

@ -23,10 +23,11 @@
using namespace llvm;
extern Target TheCellSPUTarget;
namespace {
// Register the targets
RegisterTarget<SPUTargetMachine>
CELLSPU("cellspu", "STI CBEA Cell SPU [experimental]");
CELLSPU(TheCellSPUTarget, "cellspu", "STI CBEA Cell SPU [experimental]");
}
// No assembler printer by default

View File

@ -42,7 +42,7 @@ protected:
// To avoid having target depend on the asmprinter stuff libraries, asmprinter
// set this functions to ctor pointer at startup time if they are linked in.
typedef FunctionPass *(*AsmPrinterCtorFn)(formatted_raw_ostream &o,
SPUTargetMachine &tm,
TargetMachine &tm,
bool verbose);
static AsmPrinterCtorFn AsmPrinterCtor;

View File

@ -81,7 +81,8 @@ extern "C" int CppBackendTargetMachineModule;
int CppBackendTargetMachineModule = 0;
// Register the target.
static RegisterTarget<CPPTargetMachine> X("cpp", "C++ backend");
extern Target TheCppBackendTarget;
static RegisterTarget<CPPTargetMachine> X(TheCppBackendTarget, "cpp", "C++ backend");
// Force static initialization.
extern "C" void LLVMInitializeCppBackendTarget() { }

View File

@ -26,6 +26,7 @@
#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Mangler.h"
@ -369,7 +370,7 @@ bool IA64AsmPrinter::doFinalization(Module &M) {
/// the given target machine description.
///
FunctionPass *llvm::createIA64CodePrinterPass(formatted_raw_ostream &o,
IA64TargetMachine &tm,
TargetMachine &tm,
bool verbose) {
return new IA64AsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
}
@ -384,4 +385,7 @@ namespace {
// Force static initialization.
extern "C" void LLVMInitializeIA64AsmPrinter() { }
extern "C" void LLVMInitializeIA64AsmPrinter() {
extern Target TheIA64Target;
TargetRegistry::RegisterAsmPrinter(TheIA64Target, createIA64CodePrinterPass);
}

View File

@ -38,7 +38,7 @@ FunctionPass *createIA64BundlingPass(IA64TargetMachine &TM);
/// regardless of whether the function is in SSA form.
///
FunctionPass *createIA64CodePrinterPass(formatted_raw_ostream &o,
IA64TargetMachine &tm,
TargetMachine &tm,
bool verbose);
} // End llvm namespace

View File

@ -20,7 +20,8 @@
using namespace llvm;
// Register the target
static RegisterTarget<IA64TargetMachine> X("ia64",
extern Target TheIA64Target;
static RegisterTarget<IA64TargetMachine> X(TheIA64Target, "ia64",
"IA-64 (Itanium) [experimental]");
// No assembler printer by default

View File

@ -37,7 +37,7 @@ protected:
// To avoid having target depend on the asmprinter stuff libraries, asmprinter
// set this functions to ctor pointer at startup time if they are linked in.
typedef FunctionPass *(*AsmPrinterCtorFn)(formatted_raw_ostream &o,
IA64TargetMachine &tm,
TargetMachine &tm,
bool verbose);
static AsmPrinterCtorFn AsmPrinterCtor;

View File

@ -55,7 +55,8 @@ namespace {
extern "C" int MSILTargetMachineModule;
int MSILTargetMachineModule = 0;
static RegisterTarget<MSILTarget> X("msil", "MSIL backend");
extern Target TheMSILTarget;
static RegisterTarget<MSILTarget> X(TheMSILTarget, "msil", "MSIL backend");
// Force static initialization.
extern "C" void LLVMInitializeMSILTarget() { }

View File

@ -32,8 +32,9 @@ int MSP430TargetMachineModule = 0;
// Register the targets
extern Target TheMSP430Target;
static RegisterTarget<MSP430TargetMachine>
X("msp430", "MSP430 [experimental]");
X(TheMSP430Target, "msp430", "MSP430 [experimental]");
// Force static initialization.
extern "C" void LLVMInitializeMSP430Target() { }

View File

@ -33,6 +33,7 @@
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Mangler.h"
#include "llvm/ADT/Statistic.h"
@ -51,7 +52,7 @@ namespace {
class VISIBILITY_HIDDEN MipsAsmPrinter : public AsmPrinter {
const MipsSubtarget *Subtarget;
public:
explicit MipsAsmPrinter(formatted_raw_ostream &O, MipsTargetMachine &TM,
explicit MipsAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *T, bool V)
: AsmPrinter(O, TM, T, V) {
Subtarget = &TM.getSubtarget<MipsSubtarget>();
@ -92,7 +93,7 @@ namespace {
/// using the given target machine description. This should work
/// regardless of whether the function is in SSA form.
FunctionPass *llvm::createMipsCodePrinterPass(formatted_raw_ostream &o,
MipsTargetMachine &tm,
TargetMachine &tm,
bool verbose) {
return new MipsAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
}
@ -584,4 +585,11 @@ namespace {
}
// Force static initialization.
extern "C" void LLVMInitializeMipsAsmPrinter() { }
extern "C" void LLVMInitializeMipsAsmPrinter() {
extern Target TheMipsTarget;
TargetRegistry::RegisterAsmPrinter(TheMipsTarget, createMipsCodePrinterPass);
extern Target TheMipselTarget;
TargetRegistry::RegisterAsmPrinter(TheMipselTarget,
createMipsCodePrinterPass);
}

View File

@ -26,7 +26,7 @@ namespace llvm {
FunctionPass *createMipsISelDag(MipsTargetMachine &TM);
FunctionPass *createMipsDelaySlotFillerPass(MipsTargetMachine &TM);
FunctionPass *createMipsCodePrinterPass(formatted_raw_ostream &OS,
MipsTargetMachine &TM,
TargetMachine &TM,
bool Verbose);
} // end namespace llvm;

View File

@ -28,8 +28,12 @@ extern "C" int MipsTargetMachineModule;
int MipsTargetMachineModule = 0;
// Register the target.
static RegisterTarget<MipsTargetMachine> X("mips", "Mips");
static RegisterTarget<MipselTargetMachine> Y("mipsel", "Mipsel");
extern Target TheMipsTarget;
static RegisterTarget<MipsTargetMachine> X(TheMipsTarget, "mips", "Mips");
extern Target TheMipselTarget;
static RegisterTarget<MipselTargetMachine> Y(TheMipselTarget, "mipsel",
"Mipsel");
MipsTargetMachine::AsmPrinterCtorFn MipsTargetMachine::AsmPrinterCtor = 0;

View File

@ -38,7 +38,7 @@ namespace llvm {
// asmprinter set this functions to ctor pointer at startup time if they are
// linked in.
typedef FunctionPass *(*AsmPrinterCtorFn)(formatted_raw_ostream &o,
MipsTargetMachine &tm,
TargetMachine &tm,
bool verbose);
static AsmPrinterCtorFn AsmPrinterCtor;

View File

@ -32,10 +32,13 @@ int PIC16TargetMachineModule = 0;
// Register the targets
extern Target ThePIC16Target;
static RegisterTarget<PIC16TargetMachine>
X("pic16", "PIC16 14-bit [experimental].");
X(ThePIC16Target, "pic16", "PIC16 14-bit [experimental].");
extern Target TheCooperTarget;
static RegisterTarget<CooperTargetMachine>
Y("cooper", "PIC16 Cooper [experimental].");
Y(TheCooperTarget, "cooper", "PIC16 Cooper [experimental].");
// Force static initialization.
extern "C" void LLVMInitializePIC16Target() { }

View File

@ -43,6 +43,7 @@
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSet.h"
@ -317,7 +318,7 @@ namespace {
/// PPCLinuxAsmPrinter - PowerPC assembly printer, customized for Linux
class VISIBILITY_HIDDEN PPCLinuxAsmPrinter : public PPCAsmPrinter {
public:
explicit PPCLinuxAsmPrinter(formatted_raw_ostream &O, PPCTargetMachine &TM,
explicit PPCLinuxAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *T, bool V)
: PPCAsmPrinter(O, TM, T, V){}
@ -343,7 +344,7 @@ namespace {
class VISIBILITY_HIDDEN PPCDarwinAsmPrinter : public PPCAsmPrinter {
formatted_raw_ostream &OS;
public:
explicit PPCDarwinAsmPrinter(formatted_raw_ostream &O, PPCTargetMachine &TM,
explicit PPCDarwinAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *T, bool V)
: PPCAsmPrinter(O, TM, T, V), OS(O) {}
@ -1080,7 +1081,7 @@ bool PPCDarwinAsmPrinter::doFinalization(Module &M) {
/// Darwin assembler can deal with.
///
FunctionPass *llvm::createPPCAsmPrinterPass(formatted_raw_ostream &o,
PPCTargetMachine &tm,
TargetMachine &tm,
bool verbose) {
const PPCSubtarget *Subtarget = &tm.getSubtarget<PPCSubtarget>();
@ -1103,4 +1104,10 @@ extern "C" int PowerPCAsmPrinterForceLink;
int PowerPCAsmPrinterForceLink = 0;
// Force static initialization.
extern "C" void LLVMInitializePowerPCAsmPrinter() { }
extern "C" void LLVMInitializePowerPCAsmPrinter() {
extern Target ThePPC32Target;
TargetRegistry::RegisterAsmPrinter(ThePPC32Target, createPPCAsmPrinterPass);
extern Target ThePPC64Target;
TargetRegistry::RegisterAsmPrinter(ThePPC64Target, createPPCAsmPrinterPass);
}

View File

@ -30,7 +30,7 @@ namespace llvm {
FunctionPass *createPPCBranchSelectionPass();
FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
FunctionPass *createPPCAsmPrinterPass(formatted_raw_ostream &OS,
PPCTargetMachine &TM,
TargetMachine &TM,
bool Verbose);
FunctionPass *createPPCCodeEmitterPass(PPCTargetMachine &TM,
MachineCodeEmitter &MCE);

View File

@ -30,10 +30,13 @@ extern "C" int PowerPCTargetMachineModule;
int PowerPCTargetMachineModule = 0;
// Register the targets
extern Target ThePPC32Target;
static RegisterTarget<PPC32TargetMachine>
X("ppc32", "PowerPC 32");
X(ThePPC32Target, "ppc32", "PowerPC 32");
extern Target ThePPC64Target;
static RegisterTarget<PPC64TargetMachine>
Y("ppc64", "PowerPC 64");
Y(ThePPC64Target, "ppc64", "PowerPC 64");
// Force static initialization.
extern "C" void LLVMInitializePowerPCTarget() { }

View File

@ -45,7 +45,7 @@ protected:
// To avoid having target depend on the asmprinter stuff libraries, asmprinter
// set this functions to ctor pointer at startup time if they are linked in.
typedef FunctionPass *(*AsmPrinterCtorFn)(formatted_raw_ostream &o,
PPCTargetMachine &tm,
TargetMachine &m,
bool verbose);
static AsmPrinterCtorFn AsmPrinterCtor;

View File

@ -26,6 +26,7 @@
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Mangler.h"
@ -359,4 +360,8 @@ namespace {
}
// Force static initialization.
extern "C" void LLVMInitializeSparcAsmPrinter() { }
extern "C" void LLVMInitializeSparcAsmPrinter() {
extern Target TheSparcTarget;
TargetRegistry::RegisterAsmPrinter(TheSparcTarget,
createSparcCodePrinterPass);
}

View File

@ -19,7 +19,8 @@
using namespace llvm;
// Register the target.
static RegisterTarget<SparcTargetMachine> X("sparc", "SPARC");
extern Target TheSparcTarget;
static RegisterTarget<SparcTargetMachine> X(TheSparcTarget, "sparc", "SPARC");
// No assembler printer by default
SparcTargetMachine::AsmPrinterCtorFn SparcTargetMachine::AsmPrinterCtor = 0;

View File

@ -37,7 +37,7 @@ class VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
MCContext *Context;
MCStreamer *Streamer;
public:
explicit X86ATTAsmPrinter(formatted_raw_ostream &O, X86TargetMachine &TM,
explicit X86ATTAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *T, bool V)
: AsmPrinter(O, TM, T, V) {
Subtarget = &TM.getSubtarget<X86Subtarget>();

View File

@ -17,6 +17,7 @@
#include "X86ATTAsmPrinter.h"
#include "X86IntelAsmPrinter.h"
#include "X86Subtarget.h"
#include "llvm/Target/TargetRegistry.h"
using namespace llvm;
/// createX86CodePrinterPass - Returns a pass that prints the X86 assembly code
@ -24,7 +25,7 @@ using namespace llvm;
/// machine description.
///
FunctionPass *llvm::createX86CodePrinterPass(formatted_raw_ostream &o,
X86TargetMachine &tm,
TargetMachine &tm,
bool verbose) {
const X86Subtarget *Subtarget = &tm.getSubtarget<X86Subtarget>();
@ -45,4 +46,10 @@ extern "C" int X86AsmPrinterForceLink;
int X86AsmPrinterForceLink = 0;
// Force static initialization.
extern "C" void LLVMInitializeX86AsmPrinter() { }
extern "C" void LLVMInitializeX86AsmPrinter() {
extern Target TheX86_32Target;
TargetRegistry::RegisterAsmPrinter(TheX86_32Target, createX86CodePrinterPass);
extern Target TheX86_64Target;
TargetRegistry::RegisterAsmPrinter(TheX86_64Target, createX86CodePrinterPass);
}

View File

@ -25,7 +25,7 @@
namespace llvm {
struct VISIBILITY_HIDDEN X86IntelAsmPrinter : public AsmPrinter {
explicit X86IntelAsmPrinter(formatted_raw_ostream &O, X86TargetMachine &TM,
explicit X86IntelAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *T, bool V)
: AsmPrinter(O, TM, T, V) {}

View File

@ -47,7 +47,7 @@ FunctionPass *createX87FPRegKillInserterPass();
/// using the given target machine description.
///
FunctionPass *createX86CodePrinterPass(formatted_raw_ostream &o,
X86TargetMachine &tm,
TargetMachine &tm,
bool Verbose);
/// createX86CodeEmitterPass - Return a pass that emits the collected X86 code

View File

@ -31,13 +31,18 @@ extern "C" int X86TargetMachineModule;
int X86TargetMachineModule = 0;
// Register the target.
extern Target TheX86_32Target;
static RegisterTarget<X86_32TargetMachine>
X("x86", "32-bit X86: Pentium-Pro and above");
X(TheX86_32Target, "x86", "32-bit X86: Pentium-Pro and above");
extern Target TheX86_64Target;
static RegisterTarget<X86_64TargetMachine>
Y("x86-64", "64-bit X86: EM64T and AMD64");
Y(TheX86_64Target, "x86-64", "64-bit X86: EM64T and AMD64");
// Force static initialization.
extern "C" void LLVMInitializeX86Target() { }
extern "C" void LLVMInitializeX86Target() {
}
// No assembler printer by default
X86TargetMachine::AsmPrinterCtorFn X86TargetMachine::AsmPrinterCtor = 0;

View File

@ -44,7 +44,7 @@ protected:
// To avoid having target depend on the asmprinter stuff libraries, asmprinter
// set this functions to ctor pointer at startup time if they are linked in.
typedef FunctionPass *(*AsmPrinterCtorFn)(formatted_raw_ostream &o,
X86TargetMachine &tm,
TargetMachine &tm,
bool verbose);
static AsmPrinterCtorFn AsmPrinterCtor;

View File

@ -26,9 +26,10 @@ using namespace llvm;
extern "C" int XCoreTargetMachineModule;
int XCoreTargetMachineModule = 0;
extern Target TheXCoreTarget;
namespace {
// Register the target.
RegisterTarget<XCoreTargetMachine> X("xcore", "XCore");
RegisterTarget<XCoreTargetMachine> X(TheXCoreTarget, "xcore", "XCore");
}
// Force static initialization.