From 92adc19be95347225f713db8cc1b5e22ac08bb5e Mon Sep 17 00:00:00 2001 From: Oscar Fuentes Date: Sat, 15 Nov 2008 21:36:30 +0000 Subject: 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 --- lib/Target/Mips/MipsTargetMachine.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/Target/Mips/MipsTargetMachine.cpp') diff --git a/lib/Target/Mips/MipsTargetMachine.cpp b/lib/Target/Mips/MipsTargetMachine.cpp index 25a0eaa857..ff2e5b8158 100644 --- a/lib/Target/Mips/MipsTargetMachine.cpp +++ b/lib/Target/Mips/MipsTargetMachine.cpp @@ -19,6 +19,14 @@ #include "llvm/Target/TargetMachineRegistry.h" using namespace llvm; +/// MipsTargetMachineModule - 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 MipsTargetMachineModule; +int MipsTargetMachineModule = 0; + // Register the target. static RegisterTarget X("mips", "Mips"); static RegisterTarget Y("mipsel", "Mipsel"); -- cgit v1.2.3-70-g09d2