aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/CppBackend
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2008-11-15 21:36:30 +0000
committerOscar Fuentes <ofv@wanadoo.es>2008-11-15 21:36:30 +0000
commit92adc19be95347225f713db8cc1b5e22ac08bb5e (patch)
tree3c71e3bd9d9a4dc91657ed0b6e33f1be30d72774 /lib/Target/CppBackend
parent232ed2d3733b497f3a1b7a392eb0c9e60cfed228 (diff)
downloadexternal_llvm-92adc19be95347225f713db8cc1b5e22ac08bb5e.zip
external_llvm-92adc19be95347225f713db8cc1b5e22ac08bb5e.tar.gz
external_llvm-92adc19be95347225f713db8cc1b5e22ac08bb5e.tar.bz2
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
Diffstat (limited to 'lib/Target/CppBackend')
-rw-r--r--lib/Target/CppBackend/CPPBackend.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp
index b51621d..5b646ba 100644
--- a/lib/Target/CppBackend/CPPBackend.cpp
+++ b/lib/Target/CppBackend/CPPBackend.cpp
@@ -71,6 +71,14 @@ static cl::opt<std::string> NameToGenerate("cppfor", cl::Optional,
cl::desc("Specify the name of the thing to generate"),
cl::init("!bad!"));
+/// CppBackendTargetMachineModule - Note that this is used on hosts
+/// that cannot link in a library unless there are references into the
+/// library. In particular, it seems that it is not possible to get
+/// things to work on Win32 without this. Though it is unused, do not
+/// remove it.
+extern "C" int CppBackendTargetMachineModule;
+int CppBackendTargetMachineModule = 0;
+
// Register the target.
static RegisterTarget<CPPTargetMachine> X("cpp", "C++ backend");