diff --git a/lib/Target/ARM/ARM.h b/lib/Target/ARM/ARM.h index 1b5b828395a..5a3555a2532 100644 --- a/lib/Target/ARM/ARM.h +++ b/lib/Target/ARM/ARM.h @@ -111,6 +111,8 @@ FunctionPass *createARMConstantIslandPass(); FunctionPass *createThumb2ITBlockPass(); +extern Target TheARMTarget, TheThumbTarget; + } // end namespace llvm; // Defines symbolic names for ARM registers. This defines a mapping from diff --git a/lib/Target/ARM/ARMTargetMachine.cpp b/lib/Target/ARM/ARMTargetMachine.cpp index a207871a5db..08bb38215e3 100644 --- a/lib/Target/ARM/ARMTargetMachine.cpp +++ b/lib/Target/ARM/ARMTargetMachine.cpp @@ -29,11 +29,10 @@ static cl::opt DisableIfConversion("disable-arm-if-conversion",cl::Hidden, cl::desc("Disable if-conversion pass")); // Register the target. -extern Target TheARMTarget; -static RegisterTarget X(TheARMTarget, "arm", "ARM"); +static RegisterTarget X(llvm::TheARMTarget, "arm", "ARM"); -extern Target TheThumbTarget; -static RegisterTarget Y(TheThumbTarget, "thumb", "Thumb"); +static RegisterTarget Y(llvm::TheThumbTarget, "thumb", + "Thumb"); // Force static initialization. extern "C" void LLVMInitializeARMTarget() { } diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index 7270e37fa2b..e561929af5d 100644 --- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -1295,7 +1295,6 @@ FunctionPass *llvm::createARMCodePrinterPass(formatted_raw_ostream &o, // Force static initialization. extern "C" void LLVMInitializeARMAsmPrinter() { - extern Target TheARMTarget, TheThumbTarget; TargetRegistry::RegisterAsmPrinter(TheARMTarget, createARMCodePrinterPass); TargetRegistry::RegisterAsmPrinter(TheThumbTarget, createARMCodePrinterPass); } diff --git a/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp b/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp index a08c915bc6a..d709463a15f 100644 --- a/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp +++ b/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp @@ -7,11 +7,12 @@ // //===----------------------------------------------------------------------===// +#include "ARM.h" #include "llvm/Module.h" #include "llvm/Target/TargetRegistry.h" using namespace llvm; -Target TheARMTarget; +Target llvm::TheARMTarget; static unsigned ARM_JITMatchQuality() { #if defined(__arm__) @@ -47,7 +48,7 @@ static unsigned ARM_ModuleMatchQuality(const Module &M) { return ARM_JITMatchQuality()/2; } -Target TheThumbTarget; +Target llvm::TheThumbTarget; static unsigned Thumb_JITMatchQuality() { #if defined(__thumb__) diff --git a/lib/Target/Alpha/Alpha.h b/lib/Target/Alpha/Alpha.h index 9226a5590f4..93c4c702603 100644 --- a/lib/Target/Alpha/Alpha.h +++ b/lib/Target/Alpha/Alpha.h @@ -39,6 +39,8 @@ namespace llvm { FunctionPass *createAlphaLLRPPass(AlphaTargetMachine &tm); FunctionPass *createAlphaBranchSelectionPass(); + extern Target TheAlphaTarget; + } // end namespace llvm; // Defines symbolic names for Alpha registers. This defines a mapping from diff --git a/lib/Target/Alpha/AlphaTargetMachine.cpp b/lib/Target/Alpha/AlphaTargetMachine.cpp index c57d06f93c4..1947e656703 100644 --- a/lib/Target/Alpha/AlphaTargetMachine.cpp +++ b/lib/Target/Alpha/AlphaTargetMachine.cpp @@ -22,7 +22,6 @@ using namespace llvm; // Register the targets -extern Target TheAlphaTarget; static RegisterTarget X(TheAlphaTarget, "alpha", "Alpha [experimental]"); diff --git a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp index 0f5950ed2f4..b772c14892f 100644 --- a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp +++ b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp @@ -295,7 +295,6 @@ bool AlphaAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, // Force static initialization. extern "C" void LLVMInitializeAlphaAsmPrinter() { - extern Target TheAlphaTarget; TargetRegistry::RegisterAsmPrinter(TheAlphaTarget, createAlphaCodePrinterPass); } diff --git a/lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp b/lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp index df560b8c875..60f53e36167 100644 --- a/lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp +++ b/lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp @@ -7,11 +7,12 @@ // //===----------------------------------------------------------------------===// +#include "Alpha.h" #include "llvm/Module.h" #include "llvm/Target/TargetRegistry.h" using namespace llvm; -Target TheAlphaTarget; +llvm::Target llvm::TheAlphaTarget; static unsigned Alpha_JITMatchQuality() { #ifdef __alpha diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 58cc07d1bb1..96ed5d065ce 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -51,7 +51,6 @@ using namespace llvm; // Register the target. -extern Target TheCBackendTarget; static RegisterTarget X(TheCBackendTarget, "c", "C backend"); // Force static initialization. diff --git a/lib/Target/CBackend/CTargetMachine.h b/lib/Target/CBackend/CTargetMachine.h index b1d9e0775ea..a3052ab8259 100644 --- a/lib/Target/CBackend/CTargetMachine.h +++ b/lib/Target/CBackend/CTargetMachine.h @@ -34,6 +34,8 @@ struct CTargetMachine : public TargetMachine { virtual const TargetData *getTargetData() const { return &DataLayout; } }; +extern Target TheCBackendTarget; + } // End llvm namespace diff --git a/lib/Target/CBackend/TargetInfo/CBackendTargetInfo.cpp b/lib/Target/CBackend/TargetInfo/CBackendTargetInfo.cpp index 178c1dd8b4c..b86f4b2e4ba 100644 --- a/lib/Target/CBackend/TargetInfo/CBackendTargetInfo.cpp +++ b/lib/Target/CBackend/TargetInfo/CBackendTargetInfo.cpp @@ -7,11 +7,12 @@ // //===----------------------------------------------------------------------===// +#include "CTargetMachine.h" #include "llvm/Module.h" #include "llvm/Target/TargetRegistry.h" using namespace llvm; -Target TheCBackendTarget; +Target llvm::TheCBackendTarget; static unsigned CBackend_JITMatchQuality() { return 0; diff --git a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp index a1fe8ab8a05..3c677182153 100644 --- a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp +++ b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp @@ -607,6 +607,5 @@ FunctionPass *llvm::createSPUAsmPrinterPass(formatted_raw_ostream &o, // Force static initialization. extern "C" void LLVMInitializeCellSPUAsmPrinter() { - extern Target TheCellSPUTarget; TargetRegistry::RegisterAsmPrinter(TheCellSPUTarget, createSPUAsmPrinterPass); } diff --git a/lib/Target/CellSPU/SPU.h b/lib/Target/CellSPU/SPU.h index f76fc82e280..9fc36f657ae 100644 --- a/lib/Target/CellSPU/SPU.h +++ b/lib/Target/CellSPU/SPU.h @@ -92,6 +92,9 @@ namespace llvm { inline bool isU10Constant(uint64_t Value) { return (Value == (Value & 0x3ff)); } + + extern Target TheCellSPUTarget; + } // Defines symbolic names for the SPU instructions. diff --git a/lib/Target/CellSPU/SPUTargetMachine.cpp b/lib/Target/CellSPU/SPUTargetMachine.cpp index 181abcdd887..f1b1a742914 100644 --- a/lib/Target/CellSPU/SPUTargetMachine.cpp +++ b/lib/Target/CellSPU/SPUTargetMachine.cpp @@ -23,7 +23,6 @@ using namespace llvm; -extern Target TheCellSPUTarget; namespace { // Register the targets RegisterTarget diff --git a/lib/Target/CellSPU/TargetInfo/CellSPUTargetInfo.cpp b/lib/Target/CellSPU/TargetInfo/CellSPUTargetInfo.cpp index c5ad7b8fb46..9baec63c41c 100644 --- a/lib/Target/CellSPU/TargetInfo/CellSPUTargetInfo.cpp +++ b/lib/Target/CellSPU/TargetInfo/CellSPUTargetInfo.cpp @@ -11,7 +11,7 @@ #include "llvm/Target/TargetRegistry.h" using namespace llvm; -Target TheCellSPUTarget; +Target llvm::TheCellSPUTarget; static unsigned CellSPU_JITMatchQuality() { return 0; diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index 08e1540c1e1..d232a55cd79 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -73,7 +73,6 @@ static cl::opt NameToGenerate("cppfor", cl::Optional, cl::init("!bad!")); // Register the target. -extern Target TheCppBackendTarget; static RegisterTarget X(TheCppBackendTarget, "cpp", "C++ backend"); // Force static initialization. diff --git a/lib/Target/CppBackend/CPPTargetMachine.h b/lib/Target/CppBackend/CPPTargetMachine.h index 4d6d5fe35d8..0cf1fd40365 100644 --- a/lib/Target/CppBackend/CPPTargetMachine.h +++ b/lib/Target/CppBackend/CPPTargetMachine.h @@ -36,6 +36,8 @@ struct CPPTargetMachine : public TargetMachine { virtual const TargetData *getTargetData() const { return &DataLayout; } }; +extern Target TheCppBackendTarget; + } // End llvm namespace diff --git a/lib/Target/CppBackend/TargetInfo/CppBackendTargetInfo.cpp b/lib/Target/CppBackend/TargetInfo/CppBackendTargetInfo.cpp index 3c29070804a..67d022ea818 100644 --- a/lib/Target/CppBackend/TargetInfo/CppBackendTargetInfo.cpp +++ b/lib/Target/CppBackend/TargetInfo/CppBackendTargetInfo.cpp @@ -11,7 +11,7 @@ #include "llvm/Target/TargetRegistry.h" using namespace llvm; -Target TheCppBackendTarget; +Target llvm::TheCppBackendTarget; static unsigned CppBackend_JITMatchQuality() { return 0; diff --git a/lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp b/lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp index 819191e4c5d..c224c8a32c2 100644 --- a/lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp +++ b/lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp @@ -377,6 +377,5 @@ FunctionPass *llvm::createIA64CodePrinterPass(formatted_raw_ostream &o, // Force static initialization. extern "C" void LLVMInitializeIA64AsmPrinter() { - extern Target TheIA64Target; TargetRegistry::RegisterAsmPrinter(TheIA64Target, createIA64CodePrinterPass); } diff --git a/lib/Target/IA64/IA64.h b/lib/Target/IA64/IA64.h index e45aedaa731..2f986b3cfe2 100644 --- a/lib/Target/IA64/IA64.h +++ b/lib/Target/IA64/IA64.h @@ -41,6 +41,8 @@ FunctionPass *createIA64CodePrinterPass(formatted_raw_ostream &o, TargetMachine &tm, bool verbose); +extern Target TheIA64Target; + } // End llvm namespace // Defines symbolic names for IA64 registers. This defines a mapping from diff --git a/lib/Target/IA64/IA64TargetMachine.cpp b/lib/Target/IA64/IA64TargetMachine.cpp index 70aabde5f67..e366d6a560e 100644 --- a/lib/Target/IA64/IA64TargetMachine.cpp +++ b/lib/Target/IA64/IA64TargetMachine.cpp @@ -20,7 +20,6 @@ using namespace llvm; // Register the target -extern Target TheIA64Target; static RegisterTarget X(TheIA64Target, "ia64", "IA-64 (Itanium) [experimental]"); diff --git a/lib/Target/IA64/TargetInfo/IA64TargetInfo.cpp b/lib/Target/IA64/TargetInfo/IA64TargetInfo.cpp index 00bdb203b58..e8d9072bcef 100644 --- a/lib/Target/IA64/TargetInfo/IA64TargetInfo.cpp +++ b/lib/Target/IA64/TargetInfo/IA64TargetInfo.cpp @@ -7,11 +7,12 @@ // //===----------------------------------------------------------------------===// +#include "IA64.h" #include "llvm/Module.h" #include "llvm/Target/TargetRegistry.h" using namespace llvm; -Target TheIA64Target; +Target llvm::TheIA64Target; static unsigned IA64_JITMatchQuality() { return 0; diff --git a/lib/Target/MSIL/MSILWriter.cpp b/lib/Target/MSIL/MSILWriter.cpp index dbfcdb7207b..af5e722b90f 100644 --- a/lib/Target/MSIL/MSILWriter.cpp +++ b/lib/Target/MSIL/MSILWriter.cpp @@ -47,7 +47,6 @@ namespace { }; } -extern Target TheMSILTarget; static RegisterTarget X(TheMSILTarget, "msil", "MSIL backend"); // Force static initialization. diff --git a/lib/Target/MSIL/MSILWriter.h b/lib/Target/MSIL/MSILWriter.h index f1b6a696ada..0d0d0ff271f 100644 --- a/lib/Target/MSIL/MSILWriter.h +++ b/lib/Target/MSIL/MSILWriter.h @@ -30,6 +30,10 @@ #include using namespace llvm; +namespace llvm { + extern Target TheMSILTarget; +} + namespace { class MSILModule : public ModulePass { @@ -253,6 +257,7 @@ namespace { void printExternals(); }; + } #endif diff --git a/lib/Target/MSIL/TargetInfo/MSILTargetInfo.cpp b/lib/Target/MSIL/TargetInfo/MSILTargetInfo.cpp index 47e650be82a..79e9c207430 100644 --- a/lib/Target/MSIL/TargetInfo/MSILTargetInfo.cpp +++ b/lib/Target/MSIL/TargetInfo/MSILTargetInfo.cpp @@ -11,7 +11,7 @@ #include "llvm/Target/TargetRegistry.h" using namespace llvm; -Target TheMSILTarget; +Target llvm::TheMSILTarget; static unsigned MSIL_JITMatchQuality() { return 0; diff --git a/lib/Target/MSP430/MSP430.h b/lib/Target/MSP430/MSP430.h index 225fc17eaa1..6251a42f904 100644 --- a/lib/Target/MSP430/MSP430.h +++ b/lib/Target/MSP430/MSP430.h @@ -27,6 +27,9 @@ namespace llvm { FunctionPass *createMSP430CodePrinterPass(formatted_raw_ostream &o, TargetMachine &tm, bool verbose); + + extern Target TheMSP430Target; + } // end namespace llvm; // Defines symbolic names for MSP430 registers. diff --git a/lib/Target/MSP430/MSP430TargetMachine.cpp b/lib/Target/MSP430/MSP430TargetMachine.cpp index 133a0acf28c..ffd93da921a 100644 --- a/lib/Target/MSP430/MSP430TargetMachine.cpp +++ b/lib/Target/MSP430/MSP430TargetMachine.cpp @@ -23,7 +23,6 @@ using namespace llvm; // Register the targets -extern Target TheMSP430Target; static RegisterTarget X(TheMSP430Target, "msp430", "MSP430 [experimental]"); diff --git a/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp b/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp index 0bdf8823be8..8b3e1f42a24 100644 --- a/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp +++ b/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp @@ -7,11 +7,12 @@ // //===----------------------------------------------------------------------===// +#include "MSP430.h" #include "llvm/Module.h" #include "llvm/Target/TargetRegistry.h" using namespace llvm; -Target TheMSP430Target; +Target llvm::TheMSP430Target; static unsigned MSP430_JITMatchQuality() { return 0; diff --git a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp index 43da443c808..abdd5a3d1d4 100644 --- a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp +++ b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp @@ -578,10 +578,8 @@ doFinalization(Module &M) // Force static initialization. extern "C" void LLVMInitializeMipsAsmPrinter() { - extern Target TheMipsTarget; TargetRegistry::RegisterAsmPrinter(TheMipsTarget, createMipsCodePrinterPass); - extern Target TheMipselTarget; TargetRegistry::RegisterAsmPrinter(TheMipselTarget, createMipsCodePrinterPass); } diff --git a/lib/Target/Mips/Mips.h b/lib/Target/Mips/Mips.h index 1ff34fbcc76..09a80729a56 100644 --- a/lib/Target/Mips/Mips.h +++ b/lib/Target/Mips/Mips.h @@ -28,6 +28,10 @@ namespace llvm { FunctionPass *createMipsCodePrinterPass(formatted_raw_ostream &OS, TargetMachine &TM, bool Verbose); + + extern Target TheMipsTarget; + extern Target TheMipselTarget; + } // end namespace llvm; // Defines symbolic names for Mips registers. This defines a mapping from diff --git a/lib/Target/Mips/MipsTargetMachine.cpp b/lib/Target/Mips/MipsTargetMachine.cpp index e29a96def43..e82dcee6362 100644 --- a/lib/Target/Mips/MipsTargetMachine.cpp +++ b/lib/Target/Mips/MipsTargetMachine.cpp @@ -20,10 +20,8 @@ using namespace llvm; // Register the target. -extern Target TheMipsTarget; static RegisterTarget X(TheMipsTarget, "mips", "Mips"); -extern Target TheMipselTarget; static RegisterTarget Y(TheMipselTarget, "mipsel", "Mipsel"); diff --git a/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp b/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp index 1f4dc9e1223..1188a74f160 100644 --- a/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp +++ b/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp @@ -7,11 +7,12 @@ // //===----------------------------------------------------------------------===// +#include "Mips.h" #include "llvm/Module.h" #include "llvm/Target/TargetRegistry.h" using namespace llvm; -Target TheMipsTarget; +Target llvm::TheMipsTarget; static unsigned Mips_JITMatchQuality() { return 0; @@ -40,7 +41,7 @@ static unsigned Mips_ModuleMatchQuality(const Module &M) { return 0; } -Target TheMipselTarget; +Target llvm::TheMipselTarget; static unsigned Mipsel_JITMatchQuality() { return 0; diff --git a/lib/Target/PIC16/PIC16.h b/lib/Target/PIC16/PIC16.h index 39a5119aa8d..b1df058cb8e 100644 --- a/lib/Target/PIC16/PIC16.h +++ b/lib/Target/PIC16/PIC16.h @@ -348,6 +348,10 @@ namespace PIC16CC { bool Verbose); // Banksel optimzer pass. FunctionPass *createPIC16MemSelOptimizerPass(); + + extern Target ThePIC16Target; + extern Target TheCooperTarget; + } // end namespace llvm; // Defines symbolic names for PIC16 registers. This defines a mapping from diff --git a/lib/Target/PIC16/PIC16TargetMachine.cpp b/lib/Target/PIC16/PIC16TargetMachine.cpp index 9f6266c672c..dca6ade9384 100644 --- a/lib/Target/PIC16/PIC16TargetMachine.cpp +++ b/lib/Target/PIC16/PIC16TargetMachine.cpp @@ -23,11 +23,9 @@ using namespace llvm; // Register the targets -extern Target ThePIC16Target; static RegisterTarget X(ThePIC16Target, "pic16", "PIC16 14-bit [experimental]."); -extern Target TheCooperTarget; static RegisterTarget Y(TheCooperTarget, "cooper", "PIC16 Cooper [experimental]."); diff --git a/lib/Target/PIC16/TargetInfo/PIC16TargetInfo.cpp b/lib/Target/PIC16/TargetInfo/PIC16TargetInfo.cpp index 454f4259ff3..20bbba8a91c 100644 --- a/lib/Target/PIC16/TargetInfo/PIC16TargetInfo.cpp +++ b/lib/Target/PIC16/TargetInfo/PIC16TargetInfo.cpp @@ -7,11 +7,12 @@ // //===----------------------------------------------------------------------===// +#include "PIC16.h" #include "llvm/Module.h" #include "llvm/Target/TargetRegistry.h" using namespace llvm; -Target ThePIC16Target; +Target llvm::ThePIC16Target; static unsigned PIC16_JITMatchQuality() { return 0; @@ -25,7 +26,7 @@ static unsigned PIC16_ModuleMatchQuality(const Module &M) { return 0; } -Target TheCooperTarget; +Target llvm::TheCooperTarget; static unsigned Cooper_JITMatchQuality() { return 0; diff --git a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp index 19a1c47fe2c..a3526ccfea6 100644 --- a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp @@ -1095,9 +1095,7 @@ FunctionPass *llvm::createPPCAsmPrinterPass(formatted_raw_ostream &o, // Force static initialization. extern "C" void LLVMInitializePowerPCAsmPrinter() { - extern Target ThePPC32Target; TargetRegistry::RegisterAsmPrinter(ThePPC32Target, createPPCAsmPrinterPass); - extern Target ThePPC64Target; TargetRegistry::RegisterAsmPrinter(ThePPC64Target, createPPCAsmPrinterPass); } diff --git a/lib/Target/PowerPC/PPC.h b/lib/Target/PowerPC/PPC.h index 3aa313c73aa..6d8974f2e08 100644 --- a/lib/Target/PowerPC/PPC.h +++ b/lib/Target/PowerPC/PPC.h @@ -38,6 +38,10 @@ FunctionPass *createPPCJITCodeEmitterPass(PPCTargetMachine &TM, JITCodeEmitter &MCE); FunctionPass *createPPCObjectCodeEmitterPass(PPCTargetMachine &TM, ObjectCodeEmitter &OCE); + +extern Target ThePPC32Target; +extern Target ThePPC64Target; + } // end namespace llvm; // Defines symbolic names for PowerPC registers. This defines a mapping from diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp index f56167e3901..3d5ae5221af 100644 --- a/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -22,11 +22,9 @@ using namespace llvm; // Register the targets -extern Target ThePPC32Target; static RegisterTarget X(ThePPC32Target, "ppc32", "PowerPC 32"); -extern Target ThePPC64Target; static RegisterTarget Y(ThePPC64Target, "ppc64", "PowerPC 64"); diff --git a/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp b/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp index 0502e37f3fe..ca1f490b001 100644 --- a/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp +++ b/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp @@ -7,11 +7,12 @@ // //===----------------------------------------------------------------------===// +#include "PPC.h" #include "llvm/Module.h" #include "llvm/Target/TargetRegistry.h" using namespace llvm; -Target ThePPC32Target; +Target llvm::ThePPC32Target; static unsigned PPC32_JITMatchQuality() { #if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER) || defined(__PPC__) @@ -47,7 +48,7 @@ static unsigned PPC32_ModuleMatchQuality(const Module &M) { return PPC32_JITMatchQuality()/2; } -Target ThePPC64Target; +Target llvm::ThePPC64Target; static unsigned PPC64_JITMatchQuality() { #if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER) || defined(__PPC__) diff --git a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp index dce42e49191..f6a5e0b4362 100644 --- a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp +++ b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp @@ -353,7 +353,6 @@ bool SparcAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, // Force static initialization. extern "C" void LLVMInitializeSparcAsmPrinter() { - extern Target TheSparcTarget; TargetRegistry::RegisterAsmPrinter(TheSparcTarget, createSparcCodePrinterPass); } diff --git a/lib/Target/Sparc/Sparc.h b/lib/Target/Sparc/Sparc.h index b1981eb5f27..06ad1a4da35 100644 --- a/lib/Target/Sparc/Sparc.h +++ b/lib/Target/Sparc/Sparc.h @@ -30,6 +30,9 @@ namespace llvm { bool Verbose); FunctionPass *createSparcDelaySlotFillerPass(TargetMachine &TM); FunctionPass *createSparcFPMoverPass(TargetMachine &TM); + + extern Target TheSparcTarget; + } // end namespace llvm; // Defines symbolic names for Sparc registers. This defines a mapping from diff --git a/lib/Target/Sparc/SparcTargetMachine.cpp b/lib/Target/Sparc/SparcTargetMachine.cpp index d4e215ca74a..686cf910283 100644 --- a/lib/Target/Sparc/SparcTargetMachine.cpp +++ b/lib/Target/Sparc/SparcTargetMachine.cpp @@ -19,7 +19,6 @@ using namespace llvm; // Register the target. -extern Target TheSparcTarget; static RegisterTarget X(TheSparcTarget, "sparc", "SPARC"); // Force static initialization. diff --git a/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp b/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp index 71c72d94821..131bdcc35b4 100644 --- a/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp +++ b/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp @@ -7,11 +7,12 @@ // //===----------------------------------------------------------------------===// +#include "Sparc.h" #include "llvm/Module.h" #include "llvm/Target/TargetRegistry.h" using namespace llvm; -Target TheSparcTarget; +Target llvm::TheSparcTarget; static unsigned Sparc_JITMatchQuality() { return 0; diff --git a/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp b/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp index 07c8ed0f82f..1bb4d42590a 100644 --- a/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp +++ b/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp @@ -418,7 +418,6 @@ void SystemZAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) { // Force static initialization. extern "C" void LLVMInitializeSystemZAsmPrinter() { - extern Target TheSystemZTarget; TargetRegistry::RegisterAsmPrinter(TheSystemZTarget, createSystemZCodePrinterPass); } diff --git a/lib/Target/SystemZ/SystemZ.h b/lib/Target/SystemZ/SystemZ.h index 88b7b02db2d..466b44787c8 100644 --- a/lib/Target/SystemZ/SystemZ.h +++ b/lib/Target/SystemZ/SystemZ.h @@ -50,6 +50,8 @@ namespace llvm { TargetMachine &tm, bool verbose); + extern Target TheSystemZTarget; + } // end namespace llvm; // Defines symbolic names for SystemZ registers. diff --git a/lib/Target/SystemZ/SystemZTargetMachine.cpp b/lib/Target/SystemZ/SystemZTargetMachine.cpp index 01be4edf7d7..8799190e2e0 100644 --- a/lib/Target/SystemZ/SystemZTargetMachine.cpp +++ b/lib/Target/SystemZ/SystemZTargetMachine.cpp @@ -18,7 +18,6 @@ #include "llvm/Target/TargetMachineRegistry.h" using namespace llvm; -extern Target TheSystemZTarget; namespace { // Register the target. RegisterTarget X(TheSystemZTarget, diff --git a/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp b/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp index c464039aaca..09cb9c3f40f 100644 --- a/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp +++ b/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp @@ -7,11 +7,12 @@ // //===----------------------------------------------------------------------===// +#include "SystemZ.h" #include "llvm/Module.h" #include "llvm/Target/TargetRegistry.h" using namespace llvm; -Target TheSystemZTarget; +Target llvm::TheSystemZTarget; static unsigned SystemZ_JITMatchQuality() { return 0; diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp index 0871148c4cf..e548391e4cc 100644 --- a/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +#include "X86.h" #include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetAsmParser.h" using namespace llvm; @@ -33,8 +34,6 @@ namespace { // Force static initialization. extern "C" void LLVMInitializeX86AsmParser() { - extern Target TheX86_32Target; TargetRegistry::RegisterAsmParser(TheX86_32Target, &createAsmParser); - extern Target TheX86_64Target; TargetRegistry::RegisterAsmParser(TheX86_64Target, &createAsmParser); } diff --git a/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp index adb242882a0..b6caf30c791 100644 --- a/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp @@ -14,6 +14,7 @@ // //===----------------------------------------------------------------------===// +#include "X86.h" #include "X86ATTAsmPrinter.h" #include "X86IntelAsmPrinter.h" #include "X86Subtarget.h" @@ -36,9 +37,6 @@ FunctionPass *llvm::createX86CodePrinterPass(formatted_raw_ostream &o, // Force static initialization. extern "C" void LLVMInitializeX86AsmPrinter() { - extern Target TheX86_32Target; TargetRegistry::RegisterAsmPrinter(TheX86_32Target, createX86CodePrinterPass); - - extern Target TheX86_64Target; TargetRegistry::RegisterAsmPrinter(TheX86_64Target, createX86CodePrinterPass); } diff --git a/lib/Target/X86/TargetInfo/X86TargetInfo.cpp b/lib/Target/X86/TargetInfo/X86TargetInfo.cpp index 9d811ab8434..a31f412a936 100644 --- a/lib/Target/X86/TargetInfo/X86TargetInfo.cpp +++ b/lib/Target/X86/TargetInfo/X86TargetInfo.cpp @@ -11,7 +11,7 @@ #include "llvm/Target/TargetRegistry.h" using namespace llvm; -Target TheX86_32Target; +Target llvm::TheX86_32Target; static unsigned X86_32_JITMatchQuality() { #if defined(i386) || defined(__i386__) || defined(__x86__) || defined(_M_IX86) @@ -47,7 +47,7 @@ static unsigned X86_32_ModuleMatchQuality(const Module &M) { return X86_32_JITMatchQuality()/2; } -Target TheX86_64Target; +Target llvm::TheX86_64Target; static unsigned X86_64_JITMatchQuality() { #if defined(__x86_64__) || defined(_M_AMD64) diff --git a/lib/Target/X86/X86.h b/lib/Target/X86/X86.h index 457e18ab0f3..0c3bc3977cc 100644 --- a/lib/Target/X86/X86.h +++ b/lib/Target/X86/X86.h @@ -71,6 +71,8 @@ FunctionPass *createEmitX86CodeToMemory(); /// FunctionPass *createX86MaxStackAlignmentCalculatorPass(); +extern Target TheX86_32Target, TheX86_64Target; + } // End llvm namespace // Defines symbolic names for X86 registers. This defines a mapping from diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index 29f38a38597..fa3ec6904de 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -24,11 +24,9 @@ using namespace llvm; // Register the target. -extern Target TheX86_32Target; static RegisterTarget X(TheX86_32Target, "x86", "32-bit X86: Pentium-Pro and above"); -extern Target TheX86_64Target; static RegisterTarget Y(TheX86_64Target, "x86-64", "64-bit X86: EM64T and AMD64"); diff --git a/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp b/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp index ce664e1b384..9dec7929932 100644 --- a/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp +++ b/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp @@ -7,11 +7,12 @@ // //===----------------------------------------------------------------------===// +#include "XCore.h" #include "llvm/Module.h" #include "llvm/Target/TargetRegistry.h" using namespace llvm; -Target TheXCoreTarget; +Target llvm::TheXCoreTarget; static unsigned XCore_JITMatchQuality() { return 0; diff --git a/lib/Target/XCore/XCore.h b/lib/Target/XCore/XCore.h index 75aa4fd9719..b7b86304b10 100644 --- a/lib/Target/XCore/XCore.h +++ b/lib/Target/XCore/XCore.h @@ -27,6 +27,9 @@ namespace llvm { FunctionPass *createXCoreCodePrinterPass(formatted_raw_ostream &OS, TargetMachine &TM, bool Verbose); + + extern Target TheXCoreTarget; + } // end namespace llvm; // Defines symbolic names for XCore registers. This defines a mapping from diff --git a/lib/Target/XCore/XCoreTargetMachine.cpp b/lib/Target/XCore/XCoreTargetMachine.cpp index 83a870f64f1..edc437b5e30 100644 --- a/lib/Target/XCore/XCoreTargetMachine.cpp +++ b/lib/Target/XCore/XCoreTargetMachine.cpp @@ -18,7 +18,6 @@ #include "llvm/Target/TargetMachineRegistry.h" using namespace llvm; -extern Target TheXCoreTarget; namespace { // Register the target. RegisterTarget X(TheXCoreTarget, "xcore", "XCore");