llvm.org GIT mirror llvm / 92adc19
Adds extern "C" ints to the .cpp files that use RegisterTarget, as well as 2 files that use "Registrator"s. These are to be used by the MSVC builds, as the Win32 linker does not include libs that are otherwise unreferenced, even if global constructors in the lib have side-effects. Patch by Scott Graham! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59378 91177308-0d34-0410-b5e6-96231b3b80d8 Oscar Fuentes 12 years ago
13 changed file(s) with 91 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
2626 cl::desc("Disable load store optimization pass"));
2727 static cl::opt DisableIfConversion("disable-arm-if-conversion",cl::Hidden,
2828 cl::desc("Disable if-conversion pass"));
29
30 /// ARMTargetMachineModule - Note that this is used on hosts that cannot link
31 /// in a library unless there are references into the library. In particular,
32 /// it seems that it is not possible to get things to work on Win32 without
33 /// this. Though it is unused, do not remove it.
34 extern "C" int ARMTargetMachineModule;
35 int ARMTargetMachineModule = 0;
2936
3037 // Register the target.
3138 static RegisterTarget X("arm", "ARM");
1919 #include "llvm/Support/raw_ostream.h"
2020
2121 using namespace llvm;
22
23 /// AlphaTargetMachineModule - Note that this is used on hosts that cannot link
24 /// in a library unless there are references into the library. In particular,
25 /// it seems that it is not possible to get things to work on Win32 without
26 /// this. Though it is unused, do not remove it.
27 extern "C" int AlphaTargetMachineModule;
28 int AlphaTargetMachineModule = 0;
2229
2330 // Register the targets
2431 static RegisterTarget X("alpha", "Alpha [experimental]");
4646 #include
4747 #include
4848 using namespace llvm;
49
50 /// CBackendTargetMachineModule - Note that this is used on hosts that
51 /// cannot link in a library unless there are references into the
52 /// library. In particular, it seems that it is not possible to get
53 /// things to work on Win32 without this. Though it is unused, do not
54 /// remove it.
55 extern "C" int CBackendTargetMachineModule;
56 int CBackendTargetMachineModule = 0;
4957
5058 // Register the target.
5159 static RegisterTarget X("c", "C backend");
1919 #include "llvm/Target/TargetMachineRegistry.h"
2020
2121 using namespace llvm;
22
23 /// CellSPUTargetMachineModule - Note that this is used on hosts that
24 /// cannot link in a library unless there are references into the
25 /// library. In particular, it seems that it is not possible to get
26 /// things to work on Win32 without this. Though it is unused, do not
27 /// remove it.
28 extern "C" int CellSPUTargetMachineModule;
29 int CellSPUTargetMachineModule = 0;
2230
2331 namespace {
2432 // Register the targets
6969 static cl::opt NameToGenerate("cppfor", cl::Optional,
7070 cl::desc("Specify the name of the thing to generate"),
7171 cl::init("!bad!"));
72
73 /// CppBackendTargetMachineModule - Note that this is used on hosts
74 /// that cannot link in a library unless there are references into the
75 /// library. In particular, it seems that it is not possible to get
76 /// things to work on Win32 without this. Though it is unused, do not
77 /// remove it.
78 extern "C" int CppBackendTargetMachineModule;
79 int CppBackendTargetMachineModule = 0;
7280
7381 // Register the target.
7482 static RegisterTarget X("cpp", "C++ backend");
4343 };
4444 }
4545
46 /// MSILTargetMachineModule - Note that this is used on hosts that
47 /// cannot link in a library unless there are references into the
48 /// library. In particular, it seems that it is not possible to get
49 /// things to work on Win32 without this. Though it is unused, do not
50 /// remove it.
51 extern "C" int MSILTargetMachineModule;
52 int MSILTargetMachineModule = 0;
4653
4754 static RegisterTarget X("msil", "MSIL backend");
4855
1717 #include "llvm/PassManager.h"
1818 #include "llvm/Target/TargetMachineRegistry.h"
1919 using namespace llvm;
20
21 /// MipsTargetMachineModule - Note that this is used on hosts that
22 /// cannot link in a library unless there are references into the
23 /// library. In particular, it seems that it is not possible to get
24 /// things to work on Win32 without this. Though it is unused, do not
25 /// remove it.
26 extern "C" int MipsTargetMachineModule;
27 int MipsTargetMachineModule = 0;
2028
2129 // Register the target.
2230 static RegisterTarget X("mips", "Mips");
1919 #include "llvm/Target/TargetMachineRegistry.h"
2020
2121 using namespace llvm;
22
23 /// PIC16TargetMachineModule - Note that this is used on hosts that
24 /// cannot link in a library unless there are references into the
25 /// library. In particular, it seems that it is not possible to get
26 /// things to work on Win32 without this. Though it is unused, do not
27 /// remove it.
28 extern "C" int PIC16TargetMachineModule;
29 int PIC16TargetMachineModule = 0;
2230
2331 namespace {
2432 // Register the targets
11111111 }
11121112 } Registrator;
11131113 }
1114
1115 extern "C" int PowerPCAsmPrinterForceLink;
1116 int PowerPCAsmPrinterForceLink = 0;
1919 #include "llvm/Target/TargetOptions.h"
2020 #include "llvm/Support/raw_ostream.h"
2121 using namespace llvm;
22
23 /// PowerPCTargetMachineModule - Note that this is used on hosts that
24 /// cannot link in a library unless there are references into the
25 /// library. In particular, it seems that it is not possible to get
26 /// things to work on Win32 without this. Though it is unused, do not
27 /// remove it.
28 extern "C" int PowerPCTargetMachineModule;
29 int PowerPCTargetMachineModule = 0;
2230
2331 // Register the targets
2432 static RegisterTarget
1616 #include "llvm/PassManager.h"
1717 #include "llvm/Target/TargetMachineRegistry.h"
1818 using namespace llvm;
19
20 /// SparcTargetMachineModule - Note that this is used on hosts that
21 /// cannot link in a library unless there are references into the
22 /// library. In particular, it seems that it is not possible to get
23 /// things to work on Win32 without this. Though it is unused, do not
24 /// remove it.
25 extern "C" int SparcTargetMachineModule;
26 int SparcTargetMachineModule = 0;
1927
2028 // Register the target.
2129 static RegisterTarget X("sparc", "SPARC");
4040 }
4141 } Registrator;
4242 }
43
44 extern "C" int X86AsmPrinterForceLink;
45 int X86AsmPrinterForceLink = 0;
1616 #include "llvm/PassManager.h"
1717 #include "llvm/Target/TargetMachineRegistry.h"
1818 using namespace llvm;
19
20 /// XCoreTargetMachineModule - Note that this is used on hosts that
21 /// cannot link in a library unless there are references into the
22 /// library. In particular, it seems that it is not possible to get
23 /// things to work on Win32 without this. Though it is unused, do not
24 /// remove it.
25 extern "C" int XCoreTargetMachineModule;
26 int XCoreTargetMachineModule = 0;
1927
2028 namespace {
2129 // Register the target.