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/XCore/XCoreTargetMachine.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/Target/XCore/XCoreTargetMachine.cpp') diff --git a/lib/Target/XCore/XCoreTargetMachine.cpp b/lib/Target/XCore/XCoreTargetMachine.cpp index bc93880217..b3853044bb 100644 --- a/lib/Target/XCore/XCoreTargetMachine.cpp +++ b/lib/Target/XCore/XCoreTargetMachine.cpp @@ -18,6 +18,14 @@ #include "llvm/Target/TargetMachineRegistry.h" using namespace llvm; +/// XCoreTargetMachineModule - 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 XCoreTargetMachineModule; +int XCoreTargetMachineModule = 0; + namespace { // Register the target. RegisterTarget X("xcore", "XCore"); -- cgit v1.2.3-70-g09d2