llvm.org GIT mirror llvm / 4cb1e13
Put Target definitions inside Target specific header, and llvm namespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76344 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 11 years ago
55 changed file(s) with 79 addition(s) and 57 deletion(s). Raw diff Collapse all Expand all
110110
111111 FunctionPass *createThumb2ITBlockPass();
112112
113 extern Target TheARMTarget, TheThumbTarget;
114
113115 } // end namespace llvm;
114116
115117 // Defines symbolic names for ARM registers. This defines a mapping from
2828 cl::desc("Disable if-conversion pass"));
2929
3030 // Register the target.
31 extern Target TheARMTarget;
32 static RegisterTarget X(TheARMTarget, "arm", "ARM");
31 static RegisterTarget X(llvm::TheARMTarget, "arm", "ARM");
3332
34 extern Target TheThumbTarget;
35 static RegisterTarget Y(TheThumbTarget, "thumb", "Thumb");
33 static RegisterTarget Y(llvm::TheThumbTarget, "thumb",
34 "Thumb");
3635
3736 // Force static initialization.
3837 extern "C" void LLVMInitializeARMTarget() { }
12941294
12951295 // Force static initialization.
12961296 extern "C" void LLVMInitializeARMAsmPrinter() {
1297 extern Target TheARMTarget, TheThumbTarget;
12981297 TargetRegistry::RegisterAsmPrinter(TheARMTarget, createARMCodePrinterPass);
12991298 TargetRegistry::RegisterAsmPrinter(TheThumbTarget, createARMCodePrinterPass);
13001299 }
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "ARM.h"
910 #include "llvm/Module.h"
1011 #include "llvm/Target/TargetRegistry.h"
1112 using namespace llvm;
1213
13 Target TheARMTarget;
14 Target llvm::TheARMTarget;
1415
1516 static unsigned ARM_JITMatchQuality() {
1617 #if defined(__arm__)
4647 return ARM_JITMatchQuality()/2;
4748 }
4849
49 Target TheThumbTarget;
50 Target llvm::TheThumbTarget;
5051
5152 static unsigned Thumb_JITMatchQuality() {
5253 #if defined(__thumb__)
3838 FunctionPass *createAlphaLLRPPass(AlphaTargetMachine &tm);
3939 FunctionPass *createAlphaBranchSelectionPass();
4040
41 extern Target TheAlphaTarget;
42
4143 } // end namespace llvm;
4244
4345 // Defines symbolic names for Alpha registers. This defines a mapping from
2121 using namespace llvm;
2222
2323 // Register the targets
24 extern Target TheAlphaTarget;
2524 static RegisterTarget X(TheAlphaTarget, "alpha",
2625 "Alpha [experimental]");
2726
294294
295295 // Force static initialization.
296296 extern "C" void LLVMInitializeAlphaAsmPrinter() {
297 extern Target TheAlphaTarget;
298297 TargetRegistry::RegisterAsmPrinter(TheAlphaTarget,
299298 createAlphaCodePrinterPass);
300299 }
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "Alpha.h"
910 #include "llvm/Module.h"
1011 #include "llvm/Target/TargetRegistry.h"
1112 using namespace llvm;
1213
13 Target TheAlphaTarget;
14 llvm::Target llvm::TheAlphaTarget;
1415
1516 static unsigned Alpha_JITMatchQuality() {
1617 #ifdef __alpha
5050 using namespace llvm;
5151
5252 // Register the target.
53 extern Target TheCBackendTarget;
5453 static RegisterTarget X(TheCBackendTarget, "c", "C backend");
5554
5655 // Force static initialization.
3333 virtual const TargetData *getTargetData() const { return &DataLayout; }
3434 };
3535
36 extern Target TheCBackendTarget;
37
3638 } // End llvm namespace
3739
3840
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "CTargetMachine.h"
910 #include "llvm/Module.h"
1011 #include "llvm/Target/TargetRegistry.h"
1112 using namespace llvm;
1213
13 Target TheCBackendTarget;
14 Target llvm::TheCBackendTarget;
1415
1516 static unsigned CBackend_JITMatchQuality() {
1617 return 0;
606606
607607 // Force static initialization.
608608 extern "C" void LLVMInitializeCellSPUAsmPrinter() {
609 extern Target TheCellSPUTarget;
610609 TargetRegistry::RegisterAsmPrinter(TheCellSPUTarget, createSPUAsmPrinterPass);
611610 }
9191 inline bool isU10Constant(uint64_t Value) {
9292 return (Value == (Value & 0x3ff));
9393 }
94
95 extern Target TheCellSPUTarget;
96
9497 }
9598
9699 // Defines symbolic names for the SPU instructions.
2222
2323 using namespace llvm;
2424
25 extern Target TheCellSPUTarget;
2625 namespace {
2726 // Register the targets
2827 RegisterTarget
1010 #include "llvm/Target/TargetRegistry.h"
1111 using namespace llvm;
1212
13 Target TheCellSPUTarget;
13 Target llvm::TheCellSPUTarget;
1414
1515 static unsigned CellSPU_JITMatchQuality() {
1616 return 0;
7272 cl::init("!bad!"));
7373
7474 // Register the target.
75 extern Target TheCppBackendTarget;
7675 static RegisterTarget X(TheCppBackendTarget, "cpp", "C++ backend");
7776
7877 // Force static initialization.
3535 virtual const TargetData *getTargetData() const { return &DataLayout; }
3636 };
3737
38 extern Target TheCppBackendTarget;
39
3840 } // End llvm namespace
3941
4042
1010 #include "llvm/Target/TargetRegistry.h"
1111 using namespace llvm;
1212
13 Target TheCppBackendTarget;
13 Target llvm::TheCppBackendTarget;
1414
1515 static unsigned CppBackend_JITMatchQuality() {
1616 return 0;
376376
377377 // Force static initialization.
378378 extern "C" void LLVMInitializeIA64AsmPrinter() {
379 extern Target TheIA64Target;
380379 TargetRegistry::RegisterAsmPrinter(TheIA64Target, createIA64CodePrinterPass);
381380 }
4040 TargetMachine &tm,
4141 bool verbose);
4242
43 extern Target TheIA64Target;
44
4345 } // End llvm namespace
4446
4547 // Defines symbolic names for IA64 registers. This defines a mapping from
1919 using namespace llvm;
2020
2121 // Register the target
22 extern Target TheIA64Target;
2322 static RegisterTarget X(TheIA64Target, "ia64",
2423 "IA-64 (Itanium) [experimental]");
2524
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "IA64.h"
910 #include "llvm/Module.h"
1011 #include "llvm/Target/TargetRegistry.h"
1112 using namespace llvm;
1213
13 Target TheIA64Target;
14 Target llvm::TheIA64Target;
1415
1516 static unsigned IA64_JITMatchQuality() {
1617 return 0;
4646 };
4747 }
4848
49 extern Target TheMSILTarget;
5049 static RegisterTarget X(TheMSILTarget, "msil", "MSIL backend");
5150
5251 // Force static initialization.
2929 #include
3030 using namespace llvm;
3131
32 namespace llvm {
33 extern Target TheMSILTarget;
34 }
35
3236 namespace {
3337
3438 class MSILModule : public ModulePass {
252256
253257 void printExternals();
254258 };
259
255260 }
256261
257262 #endif
1010 #include "llvm/Target/TargetRegistry.h"
1111 using namespace llvm;
1212
13 Target TheMSILTarget;
13 Target llvm::TheMSILTarget;
1414
1515 static unsigned MSIL_JITMatchQuality() {
1616 return 0;
2626 FunctionPass *createMSP430CodePrinterPass(formatted_raw_ostream &o,
2727 TargetMachine &tm,
2828 bool verbose);
29
30 extern Target TheMSP430Target;
31
2932 } // end namespace llvm;
3033
3134 // Defines symbolic names for MSP430 registers.
2222 using namespace llvm;
2323
2424 // Register the targets
25 extern Target TheMSP430Target;
2625 static RegisterTarget
2726 X(TheMSP430Target, "msp430", "MSP430 [experimental]");
2827
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "MSP430.h"
910 #include "llvm/Module.h"
1011 #include "llvm/Target/TargetRegistry.h"
1112 using namespace llvm;
1213
13 Target TheMSP430Target;
14 Target llvm::TheMSP430Target;
1415
1516 static unsigned MSP430_JITMatchQuality() {
1617 return 0;
577577
578578 // Force static initialization.
579579 extern "C" void LLVMInitializeMipsAsmPrinter() {
580 extern Target TheMipsTarget;
581580 TargetRegistry::RegisterAsmPrinter(TheMipsTarget, createMipsCodePrinterPass);
582581
583 extern Target TheMipselTarget;
584582 TargetRegistry::RegisterAsmPrinter(TheMipselTarget,
585583 createMipsCodePrinterPass);
586584 }
2727 FunctionPass *createMipsCodePrinterPass(formatted_raw_ostream &OS,
2828 TargetMachine &TM,
2929 bool Verbose);
30
31 extern Target TheMipsTarget;
32 extern Target TheMipselTarget;
33
3034 } // end namespace llvm;
3135
3236 // Defines symbolic names for Mips registers. This defines a mapping from
1919 using namespace llvm;
2020
2121 // Register the target.
22 extern Target TheMipsTarget;
2322 static RegisterTarget X(TheMipsTarget, "mips", "Mips");
2423
25 extern Target TheMipselTarget;
2624 static RegisterTarget Y(TheMipselTarget, "mipsel",
2725 "Mipsel");
2826
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "Mips.h"
910 #include "llvm/Module.h"
1011 #include "llvm/Target/TargetRegistry.h"
1112 using namespace llvm;
1213
13 Target TheMipsTarget;
14 Target llvm::TheMipsTarget;
1415
1516 static unsigned Mips_JITMatchQuality() {
1617 return 0;
3940 return 0;
4041 }
4142
42 Target TheMipselTarget;
43 Target llvm::TheMipselTarget;
4344
4445 static unsigned Mipsel_JITMatchQuality() {
4546 return 0;
347347 bool Verbose);
348348 // Banksel optimzer pass.
349349 FunctionPass *createPIC16MemSelOptimizerPass();
350
351 extern Target ThePIC16Target;
352 extern Target TheCooperTarget;
353
350354 } // end namespace llvm;
351355
352356 // Defines symbolic names for PIC16 registers. This defines a mapping from
2222 using namespace llvm;
2323
2424 // Register the targets
25 extern Target ThePIC16Target;
2625 static RegisterTarget
2726 X(ThePIC16Target, "pic16", "PIC16 14-bit [experimental].");
2827
29 extern Target TheCooperTarget;
3028 static RegisterTarget
3129 Y(TheCooperTarget, "cooper", "PIC16 Cooper [experimental].");
3230
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "PIC16.h"
910 #include "llvm/Module.h"
1011 #include "llvm/Target/TargetRegistry.h"
1112 using namespace llvm;
1213
13 Target ThePIC16Target;
14 Target llvm::ThePIC16Target;
1415
1516 static unsigned PIC16_JITMatchQuality() {
1617 return 0;
2425 return 0;
2526 }
2627
27 Target TheCooperTarget;
28 Target llvm::TheCooperTarget;
2829
2930 static unsigned Cooper_JITMatchQuality() {
3031 return 0;
10941094
10951095 // Force static initialization.
10961096 extern "C" void LLVMInitializePowerPCAsmPrinter() {
1097 extern Target ThePPC32Target;
10981097 TargetRegistry::RegisterAsmPrinter(ThePPC32Target, createPPCAsmPrinterPass);
10991098
1100 extern Target ThePPC64Target;
11011099 TargetRegistry::RegisterAsmPrinter(ThePPC64Target, createPPCAsmPrinterPass);
11021100 }
3737 JITCodeEmitter &MCE);
3838 FunctionPass *createPPCObjectCodeEmitterPass(PPCTargetMachine &TM,
3939 ObjectCodeEmitter &OCE);
40
41 extern Target ThePPC32Target;
42 extern Target ThePPC64Target;
43
4044 } // end namespace llvm;
4145
4246 // Defines symbolic names for PowerPC registers. This defines a mapping from
2121 using namespace llvm;
2222
2323 // Register the targets
24 extern Target ThePPC32Target;
2524 static RegisterTarget
2625 X(ThePPC32Target, "ppc32", "PowerPC 32");
2726
28 extern Target ThePPC64Target;
2927 static RegisterTarget
3028 Y(ThePPC64Target, "ppc64", "PowerPC 64");
3129
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "PPC.h"
910 #include "llvm/Module.h"
1011 #include "llvm/Target/TargetRegistry.h"
1112 using namespace llvm;
1213
13 Target ThePPC32Target;
14 Target llvm::ThePPC32Target;
1415
1516 static unsigned PPC32_JITMatchQuality() {
1617 #if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER) || defined(__PPC__)
4647 return PPC32_JITMatchQuality()/2;
4748 }
4849
49 Target ThePPC64Target;
50 Target llvm::ThePPC64Target;
5051
5152 static unsigned PPC64_JITMatchQuality() {
5253 #if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER) || defined(__PPC__)
352352
353353 // Force static initialization.
354354 extern "C" void LLVMInitializeSparcAsmPrinter() {
355 extern Target TheSparcTarget;
356355 TargetRegistry::RegisterAsmPrinter(TheSparcTarget,
357356 createSparcCodePrinterPass);
358357 }
2929 bool Verbose);
3030 FunctionPass *createSparcDelaySlotFillerPass(TargetMachine &TM);
3131 FunctionPass *createSparcFPMoverPass(TargetMachine &TM);
32
33 extern Target TheSparcTarget;
34
3235 } // end namespace llvm;
3336
3437 // Defines symbolic names for Sparc registers. This defines a mapping from
1818 using namespace llvm;
1919
2020 // Register the target.
21 extern Target TheSparcTarget;
2221 static RegisterTarget X(TheSparcTarget, "sparc", "SPARC");
2322
2423 // Force static initialization.
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "Sparc.h"
910 #include "llvm/Module.h"
1011 #include "llvm/Target/TargetRegistry.h"
1112 using namespace llvm;
1213
13 Target TheSparcTarget;
14 Target llvm::TheSparcTarget;
1415
1516 static unsigned Sparc_JITMatchQuality() {
1617 return 0;
417417
418418 // Force static initialization.
419419 extern "C" void LLVMInitializeSystemZAsmPrinter() {
420 extern Target TheSystemZTarget;
421420 TargetRegistry::RegisterAsmPrinter(TheSystemZTarget,
422421 createSystemZCodePrinterPass);
423422 }
4949 TargetMachine &tm,
5050 bool verbose);
5151
52 extern Target TheSystemZTarget;
53
5254 } // end namespace llvm;
5355
5456 // Defines symbolic names for SystemZ registers.
1717 #include "llvm/Target/TargetMachineRegistry.h"
1818 using namespace llvm;
1919
20 extern Target TheSystemZTarget;
2120 namespace {
2221 // Register the target.
2322 RegisterTarget X(TheSystemZTarget,
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "SystemZ.h"
910 #include "llvm/Module.h"
1011 #include "llvm/Target/TargetRegistry.h"
1112 using namespace llvm;
1213
13 Target TheSystemZTarget;
14 Target llvm::TheSystemZTarget;
1415
1516 static unsigned SystemZ_JITMatchQuality() {
1617 return 0;
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "X86.h"
910 #include "llvm/Target/TargetRegistry.h"
1011 #include "llvm/Target/TargetAsmParser.h"
1112 using namespace llvm;
3233
3334 // Force static initialization.
3435 extern "C" void LLVMInitializeX86AsmParser() {
35 extern Target TheX86_32Target;
3636 TargetRegistry::RegisterAsmParser(TheX86_32Target, &createAsmParser);
37 extern Target TheX86_64Target;
3837 TargetRegistry::RegisterAsmParser(TheX86_64Target, &createAsmParser);
3938 }
1313 //
1414 //===----------------------------------------------------------------------===//
1515
16 #include "X86.h"
1617 #include "X86ATTAsmPrinter.h"
1718 #include "X86IntelAsmPrinter.h"
1819 #include "X86Subtarget.h"
3536
3637 // Force static initialization.
3738 extern "C" void LLVMInitializeX86AsmPrinter() {
38 extern Target TheX86_32Target;
3939 TargetRegistry::RegisterAsmPrinter(TheX86_32Target, createX86CodePrinterPass);
40
41 extern Target TheX86_64Target;
4240 TargetRegistry::RegisterAsmPrinter(TheX86_64Target, createX86CodePrinterPass);
4341 }
1010 #include "llvm/Target/TargetRegistry.h"
1111 using namespace llvm;
1212
13 Target TheX86_32Target;
13 Target llvm::TheX86_32Target;
1414
1515 static unsigned X86_32_JITMatchQuality() {
1616 #if defined(i386) || defined(__i386__) || defined(__x86__) || defined(_M_IX86)
4646 return X86_32_JITMatchQuality()/2;
4747 }
4848
49 Target TheX86_64Target;
49 Target llvm::TheX86_64Target;
5050
5151 static unsigned X86_64_JITMatchQuality() {
5252 #if defined(__x86_64__) || defined(_M_AMD64)
7070 ///
7171 FunctionPass *createX86MaxStackAlignmentCalculatorPass();
7272
73 extern Target TheX86_32Target, TheX86_64Target;
74
7375 } // End llvm namespace
7476
7577 // Defines symbolic names for X86 registers. This defines a mapping from
2323 using namespace llvm;
2424
2525 // Register the target.
26 extern Target TheX86_32Target;
2726 static RegisterTarget
2827 X(TheX86_32Target, "x86", "32-bit X86: Pentium-Pro and above");
2928
30 extern Target TheX86_64Target;
3129 static RegisterTarget
3230 Y(TheX86_64Target, "x86-64", "64-bit X86: EM64T and AMD64");
3331
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "XCore.h"
910 #include "llvm/Module.h"
1011 #include "llvm/Target/TargetRegistry.h"
1112 using namespace llvm;
1213
13 Target TheXCoreTarget;
14 Target llvm::TheXCoreTarget;
1415
1516 static unsigned XCore_JITMatchQuality() {
1617 return 0;
2626 FunctionPass *createXCoreCodePrinterPass(formatted_raw_ostream &OS,
2727 TargetMachine &TM,
2828 bool Verbose);
29
30 extern Target TheXCoreTarget;
31
2932 } // end namespace llvm;
3033
3134 // Defines symbolic names for XCore registers. This defines a mapping from
1717 #include "llvm/Target/TargetMachineRegistry.h"
1818 using namespace llvm;
1919
20 extern Target TheXCoreTarget;
2120 namespace {
2221 // Register the target.
2322 RegisterTarget X(TheXCoreTarget, "xcore", "XCore");