[llvm-commits] [llvm] r74026 - in /llvm/trunk: include/llvm-c/ include/llvm/Config/ include/llvm/Target/ lib/Target/ARM/ lib/Target/ARM/AsmPrinter/ lib/Target/Alpha/ lib/Target/Alpha/AsmPrinter/ lib/Target/CBackend/ lib/Target/CellSPU/ lib/Target/CellSPU/AsmPrinter/ lib/Target/CppBackend/ lib/Target/IA64/ lib/Target/IA64/AsmPrinter/ lib/Target/MSIL/ lib/Target/MSP430/ lib/Target/Mips/ lib/Target/Mips/AsmPrinter/ lib/Target/PIC16/ lib/Target/PowerPC/ lib/Target/PowerPC/AsmPrinter/ lib/Target/Sparc/ lib/Target/Sparc/AsmP...
Evan Cheng
evan.cheng at apple.com
Tue Jun 23 19:35:56 PDT 2009
Bob, I think this is breaking the llvm-gcc build:
llvm::InitializeARMAsmPrinter()", referenced from:
"llvm::InitializePowerPCTarget()", referenced from:
"llvm::InitializeX86Target()", referenced from:
"llvm::InitializeARMTarget()", referenced from:
"llvm::InitializeX86AsmPrinter()", referenced from:
"llvm::InitializePowerPCAsmPrinter()", referenced from:
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[4]: *** [libllvmgcc.dylib] Error 1
Evan
On Jun 23, 2009, at 4:59 PM, Bob Wilson wrote:
> Author: bwilson
> Date: Tue Jun 23 18:59:40 2009
> New Revision: 74026
>
> URL: http://llvm.org/viewvc/llvm-project?rev=74026&view=rev
> Log:
> Provide InitializeAllTargets and InitializeNativeTarget functions in
> the
> C bindings. Change all the backend "Initialize" functions to have C
> linkage.
> Change the "llvm/Config/Targets.def" header to use C-style comments
> to avoid
> compile warnings.
>
> Modified:
> llvm/trunk/include/llvm-c/Target.h
> llvm/trunk/include/llvm/Config/Targets.def.in
> llvm/trunk/include/llvm/Target/TargetSelect.h
> llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp
> llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
> llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp
> llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
> llvm/trunk/lib/Target/CBackend/CBackend.cpp
> llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
> llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp
> llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp
> llvm/trunk/lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp
> llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp
> llvm/trunk/lib/Target/MSIL/MSILWriter.cpp
> llvm/trunk/lib/Target/MSP430/MSP430TargetMachine.cpp
> llvm/trunk/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
> llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp
> llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp
> llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
> llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp
> llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
> llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp
> llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
> llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
> llvm/trunk/lib/Target/XCore/XCoreTargetMachine.cpp
>
> Modified: llvm/trunk/include/llvm-c/Target.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Target.h?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm-c/Target.h (original)
> +++ llvm/trunk/include/llvm-c/Target.h Tue Jun 23 18:59:40 2009
> @@ -20,6 +20,7 @@
> #define LLVM_C_TARGET_H
>
> #include "llvm-c/Core.h"
> +#include "llvm/Config/config.h"
>
> #ifdef __cplusplus
> extern "C" {
> @@ -31,6 +32,34 @@
> typedef struct LLVMOpaqueTargetData *LLVMTargetDataRef;
> typedef struct LLVMStructLayout *LLVMStructLayoutRef;
>
> +/* Declare all of the target-initialization functions that are
> available. */
> +#define LLVM_TARGET(TargetName) void
> LLVMInitialize##TargetName##Target();
> +#include "llvm/Config/Targets.def"
> +
> +/** LLVMInitializeAllTargets - The main program should call this
> function if it
> + wants to link in all available targets that LLVM is configured to
> + support. */
> +static inline void LLVMInitializeAllTargets() {
> +#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##Target();
> +#include "llvm/Config/Targets.def"
> +}
> +
> +/** LLVMInitializeNativeTarget - The main program should call this
> function to
> + initialize the native target corresponding to the host. This
> is useful
> + for JIT applications to ensure that the target gets linked in
> correctly. */
> +static inline int LLVMInitializeNativeTarget() {
> + /* If we have a native target, initialize it to ensure it is
> linked in. */
> +#ifdef LLVM_NATIVE_ARCH
> +#define DoInit2(TARG) LLVMInitialize ## TARG ()
> +#define DoInit(T) DoInit2(T)
> + DoInit(LLVM_NATIVE_ARCH);
> + return 0;
> +#undef DoInit
> +#undef DoInit2
> +#else
> + return 1;
> +#endif
> +}
>
> /*===-- Target Data
> -------------------------------------------------------===*/
>
>
> Modified: llvm/trunk/include/llvm/Config/Targets.def.in
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/Targets.def.in?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/Config/Targets.def.in (original)
> +++ llvm/trunk/include/llvm/Config/Targets.def.in Tue Jun 23
> 18:59:40 2009
> @@ -1,23 +1,23 @@
> -//===- llvm/Config/Targets.def - LLVM Target Architectures ------*-
> C++ -*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open
> Source
> -// License. See LICENSE.TXT for details.
> -//
> -//
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
> -//
> -// This file enumerates all of the target architectures supported by
> -// this build of LLVM. Clients of this file should define the
> -// LLVM_TARGET macro to be a function-like macro with a single
> -// parameter (the name of the target); including this file will then
> -// enumerate all of the targets.
> -//
> -// The set of targets supported by LLVM is generated at configuration
> -// time, at which point this header is generated. Do not modify this
> -// header directly.
> -//
> -//
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
> +/*===- llvm/Config/Targets.def - LLVM Target Architectures ------*-
> C++ -*-===*\
> +|
> * *|
> +|* The LLVM Compiler
> Infrastructure *|
> +|
> * *|
> +|* This file is distributed under the University of Illinois Open
> Source *|
> +|* License. See LICENSE.TXT for
> details. *|
> +|
> * *|
> +|
> *=
> =
> =
> ----------------------------------------------------------------------=
> ==*|
> +|
> * *|
> +|* This file enumerates all of the target architectures supported
> by *|
> +|* this build of LLVM. Clients of this file should define
> the *|
> +|* LLVM_TARGET macro to be a function-like macro with a
> single *|
> +|* parameter (the name of the target); including this file will
> then *|
> +|* enumerate all of the
> targets. *|
> +|
> * *|
> +|* The set of targets supported by LLVM is generated at
> configuration *|
> +|* time, at which point this header is generated. Do not modify
> this *|
> +|* header
> directly. *|
> +|
> * *|
> +
> \*=
> =
> =
> ----------------------------------------------------------------------=
> ==*/
>
> #ifndef LLVM_TARGET
> # error Please define the macro LLVM_TARGET(TargetName)
>
> Modified: llvm/trunk/include/llvm/Target/TargetSelect.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetSelect.h?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/Target/TargetSelect.h (original)
> +++ llvm/trunk/include/llvm/Target/TargetSelect.h Tue Jun 23
> 18:59:40 2009
> @@ -18,20 +18,21 @@
>
> #include "llvm/Config/config.h"
>
> -namespace llvm {
> +extern "C" {
> // Declare all of the target-initialization functions that are
> available.
> -#define LLVM_TARGET(TargetName) void
> Initialize##TargetName##Target();
> +#define LLVM_TARGET(TargetName) void
> LLVMInitialize##TargetName##Target();
> #include "llvm/Config/Targets.def"
>
> // Declare all of the available asm-printer initialization
> functions.
> - // Declare all of the target-initialization functions.
> -#define LLVM_ASM_PRINTER(TargetName) void
> Initialize##TargetName##AsmPrinter();
> +#define LLVM_ASM_PRINTER(TargetName) void
> LLVMInitialize##TargetName##AsmPrinter();
> #include "llvm/Config/AsmPrinters.def"
> -
> +}
> +
> +namespace llvm {
> /// InitializeAllTargets - The main program should call this
> function if it
> /// wants to link in all available targets that LLVM is configured
> to support.
> inline void InitializeAllTargets() {
> -#define LLVM_TARGET(TargetName)
> llvm::Initialize##TargetName##Target();
> +#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##Target();
> #include "llvm/Config/Targets.def"
> }
>
> @@ -39,18 +40,17 @@
> /// it wants all asm printers that LLVM is configured to support.
> This will
> /// cause them to be linked into its executable.
> inline void InitializeAllAsmPrinters() {
> -#define LLVM_ASM_PRINTER(TargetName)
> Initialize##TargetName##AsmPrinter();
> +#define LLVM_ASM_PRINTER(TargetName)
> LLVMInitialize##TargetName##AsmPrinter();
> #include "llvm/Config/AsmPrinters.def"
> }
>
> -
> /// InitializeNativeTarget - The main program should call this
> function to
> /// initialize the native target corresponding to the host. This
> is useful
> /// for JIT applications to ensure that the target gets linked in
> correctly.
> inline bool InitializeNativeTarget() {
> // If we have a native target, initialize it to ensure it is
> linked in.
> #ifdef LLVM_NATIVE_ARCH
> -#define DoInit2(TARG) llvm::Initialize ## TARG ()
> +#define DoInit2(TARG) LLVMInitialize ## TARG ()
> #define DoInit(T) DoInit2(T)
> DoInit(LLVM_NATIVE_ARCH);
> return false;
>
> Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp Tue Jun 23
> 18:59:40 2009
> @@ -39,10 +39,8 @@
> static RegisterTarget<ARMTargetMachine> X("arm", "ARM");
> static RegisterTarget<ThumbTargetMachine> Y("thumb", "Thumb");
>
> -// Force static initialization when called from llvm/
> InitializeAllTargets.h
> -namespace llvm {
> - void InitializeARMTarget() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeARMTarget() { }
>
> // No assembler printer by default
> ARMTargetMachine::AsmPrinterCtorFn ARMTargetMachine::AsmPrinterCtor
> = 0;
>
> Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Tue Jun
> 23 18:59:40 2009
> @@ -1172,8 +1172,5 @@
> } Registrator;
> }
>
> -// Force static initialization when called from
> -// llvm/InitializeAllAsmPrinters.h
> -namespace llvm {
> - void InitializeARMAsmPrinter() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeARMAsmPrinter() { }
>
> Modified: llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp (original)
> +++ llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp Tue Jun 23
> 18:59:40 2009
> @@ -27,10 +27,8 @@
> // No assembler printer by default
> AlphaTargetMachine::AsmPrinterCtorFn
> AlphaTargetMachine::AsmPrinterCtor = 0;
>
> -// Force static initialization when called from llvm/
> InitializeAllTargets.h
> -namespace llvm {
> - void InitializeAlphaTarget() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeAlphaTarget() { }
>
> const TargetAsmInfo *AlphaTargetMachine::createTargetAsmInfo() const {
> return new AlphaTargetAsmInfo(*this);
>
> Modified: llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
> (original)
> +++ llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp Tue
> Jun 23 18:59:40 2009
> @@ -304,11 +304,8 @@
> return false;
> }
>
> -// Force static initialization when called from
> -// llvm/InitializeAllAsmPrinters.h
> -namespace llvm {
> - void InitializeAlphaAsmPrinter() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeAlphaAsmPrinter() { }
>
> namespace {
> static struct Register {
>
> Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original)
> +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Tue Jun 23 18:59:40
> 2009
> @@ -59,10 +59,8 @@
> // Register the target.
> static RegisterTarget<CTargetMachine> X("c", "C backend");
>
> -// Force static initialization when called from llvm/
> InitializeAllTargets.h
> -namespace llvm {
> - void InitializeCBackendTarget() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeCBackendTarget() { }
>
> namespace {
> /// CBackendNameAllUsedStructsAndMergeFunctions - This pass
> inserts names for
>
> Modified: llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
> (original)
> +++ llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp Tue
> Jun 23 18:59:40 2009
> @@ -617,11 +617,8 @@
> return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), OptLevel,
> verbose);
> }
>
> -// Force static initialization when called from
> -// llvm/InitializeAllAsmPrinters.h
> -namespace llvm {
> - void InitializeCellSPUAsmPrinter() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeCellSPUAsmPrinter() { }
>
> namespace {
> static struct Register {
>
> Modified: llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp (original)
> +++ llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp Tue Jun 23
> 18:59:40 2009
> @@ -32,10 +32,8 @@
> // No assembler printer by default
> SPUTargetMachine::AsmPrinterCtorFn SPUTargetMachine::AsmPrinterCtor
> = 0;
>
> -// Force static initialization when called from llvm/
> InitializeAllTargets.h
> -namespace llvm {
> - void InitializeCellSPUTarget() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeCellSPUTarget() { }
>
> const std::pair<unsigned, int> *
> SPUFrameInfo::getCalleeSaveSpillSlots(unsigned &NumEntries) const {
>
> Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original)
> +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Tue Jun 23
> 18:59:40 2009
> @@ -82,10 +82,8 @@
> // Register the target.
> static RegisterTarget<CPPTargetMachine> X("cpp", "C++ backend");
>
> -// Force static initialization when called from llvm/
> InitializeAllTargets.h
> -namespace llvm {
> - void InitializeCppBackendTarget() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeCppBackendTarget() { }
>
> namespace {
> typedef std::vector<const Type*> TypeList;
>
> Modified: llvm/trunk/lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp
> (original)
> +++ llvm/trunk/lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp Tue Jun
> 23 18:59:40 2009
> @@ -384,8 +384,5 @@
> }
>
>
> -// Force static initialization when called from
> -// llvm/InitializeAllAsmPrinters.h
> -namespace llvm {
> - void InitializeIA64AsmPrinter() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeIA64AsmPrinter() { }
>
> Modified: llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp (original)
> +++ llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp Tue Jun 23
> 18:59:40 2009
> @@ -26,10 +26,8 @@
> // No assembler printer by default
> IA64TargetMachine::AsmPrinterCtorFn
> IA64TargetMachine::AsmPrinterCtor = 0;
>
> -// Force static initialization when called from llvm/
> InitializeAllTargets.h
> -namespace llvm {
> - void InitializeIA64Target() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeIA64Target() { }
>
> const TargetAsmInfo *IA64TargetMachine::createTargetAsmInfo() const {
> return new IA64TargetAsmInfo(*this);
>
> Modified: llvm/trunk/lib/Target/MSIL/MSILWriter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSIL/MSILWriter.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/MSIL/MSILWriter.cpp (original)
> +++ llvm/trunk/lib/Target/MSIL/MSILWriter.cpp Tue Jun 23 18:59:40 2009
> @@ -55,10 +55,8 @@
>
> static RegisterTarget<MSILTarget> X("msil", "MSIL backend");
>
> -// Force static initialization when called from llvm/
> InitializeAllTargets.h
> -namespace llvm {
> - void InitializeMSILTarget() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeMSILTarget() { }
>
> bool MSILModule::runOnModule(Module &M) {
> ModulePtr = &M;
>
> Modified: llvm/trunk/lib/Target/MSP430/MSP430TargetMachine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430TargetMachine.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/MSP430/MSP430TargetMachine.cpp (original)
> +++ llvm/trunk/lib/Target/MSP430/MSP430TargetMachine.cpp Tue Jun 23
> 18:59:40 2009
> @@ -35,10 +35,8 @@
> static RegisterTarget<MSP430TargetMachine>
> X("msp430", "MSP430 [experimental]");
>
> -// Force static initialization when called from llvm/
> InitializeAllTargets.h
> -namespace llvm {
> - void InitializeMSP430Target() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeMSP430Target() { }
>
> MSP430TargetMachine::MSP430TargetMachine(const Module &M,
> const std::string &FS) :
>
> Modified: llvm/trunk/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
> (original)
> +++ llvm/trunk/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp Tue Jun
> 23 18:59:40 2009
> @@ -587,8 +587,5 @@
> } Registrator;
> }
>
> -// Force static initialization when called from
> -// llvm/InitializeAllAsmPrinters.h
> -namespace llvm {
> - void InitializeMipsAsmPrinter() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeMipsAsmPrinter() { }
>
> Modified: llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp (original)
> +++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp Tue Jun 23
> 18:59:40 2009
> @@ -34,10 +34,8 @@
> MipsTargetMachine::AsmPrinterCtorFn
> MipsTargetMachine::AsmPrinterCtor = 0;
>
>
> -// Force static initialization when called from llvm/
> InitializeAllTargets.h
> -namespace llvm {
> - void InitializeMipsTarget() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeMipsTarget() { }
>
> const TargetAsmInfo *MipsTargetMachine::
> createTargetAsmInfo() const
>
> Modified: llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp (original)
> +++ llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp Tue Jun 23
> 18:59:40 2009
> @@ -37,10 +37,8 @@
> static RegisterTarget<CooperTargetMachine>
> Y("cooper", "PIC16 Cooper [experimental].");
>
> -// Force static initialization when called from llvm/
> InitializeAllTargets.h
> -namespace llvm {
> - void InitializePIC16Target() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializePIC16Target() { }
>
> // PIC16TargetMachine - Traditional PIC16 Machine.
> PIC16TargetMachine::PIC16TargetMachine(const Module &M, const
> std::string &FS,
>
> Modified: llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
> (original)
> +++ llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Tue
> Jun 23 18:59:40 2009
> @@ -1185,8 +1185,5 @@
> extern "C" int PowerPCAsmPrinterForceLink;
> int PowerPCAsmPrinterForceLink = 0;
>
> -// Force static initialization when called from
> -// llvm/InitializeAllAsmPrinters.h
> -namespace llvm {
> - void InitializePowerPCAsmPrinter() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializePowerPCAsmPrinter() { }
>
> Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp (original)
> +++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp Tue Jun 23
> 18:59:40 2009
> @@ -35,10 +35,8 @@
> static RegisterTarget<PPC64TargetMachine>
> Y("ppc64", "PowerPC 64");
>
> -// Force static initialization when called from llvm/
> InitializeAllTargets.h
> -namespace llvm {
> - void InitializePowerPCTarget() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializePowerPCTarget() { }
>
> // No assembler printer by default
> PPCTargetMachine::AsmPrinterCtorFn PPCTargetMachine::AsmPrinterCtor
> = 0;
>
> Modified: llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
> (original)
> +++ llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp Tue
> Jun 23 18:59:40 2009
> @@ -362,8 +362,5 @@
> } Registrator;
> }
>
> -// Force static initialization when called from
> -// llvm/InitializeAllAsmPrinters.h
> -namespace llvm {
> - void InitializeSparcAsmPrinter() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeSparcAsmPrinter() { }
>
> Modified: llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp (original)
> +++ llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp Tue Jun 23
> 18:59:40 2009
> @@ -25,10 +25,8 @@
> SparcTargetMachine::AsmPrinterCtorFn
> SparcTargetMachine::AsmPrinterCtor = 0;
>
>
> -// Force static initialization when called from llvm/
> InitializeAllTargets.h
> -namespace llvm {
> - void InitializeSparcTarget() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeSparcTarget() { }
>
> const TargetAsmInfo *SparcTargetMachine::createTargetAsmInfo() const {
> // FIXME: Handle Solaris subtarget someday :)
>
> Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp (original)
> +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp Tue Jun
> 23 18:59:40 2009
> @@ -47,8 +47,5 @@
> extern "C" int X86AsmPrinterForceLink;
> int X86AsmPrinterForceLink = 0;
>
> -// Force static initialization when called from
> -// llvm/InitializeAllAsmPrinters.h
> -namespace llvm {
> - void InitializeX86AsmPrinter() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeX86AsmPrinter() { }
>
> Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original)
> +++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Tue Jun 23
> 18:59:40 2009
> @@ -36,10 +36,8 @@
> static RegisterTarget<X86_64TargetMachine>
> Y("x86-64", "64-bit X86: EM64T and AMD64");
>
> -// Force static initialization when called from llvm/
> InitializeAllTargets.h
> -namespace llvm {
> - void InitializeX86Target() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeX86Target() { }
>
> // No assembler printer by default
> X86TargetMachine::AsmPrinterCtorFn X86TargetMachine::AsmPrinterCtor
> = 0;
>
> Modified: llvm/trunk/lib/Target/XCore/XCoreTargetMachine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreTargetMachine.cpp?rev=74026&r1=74025&r2=74026&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/XCore/XCoreTargetMachine.cpp (original)
> +++ llvm/trunk/lib/Target/XCore/XCoreTargetMachine.cpp Tue Jun 23
> 18:59:40 2009
> @@ -31,10 +31,8 @@
> RegisterTarget<XCoreTargetMachine> X("xcore", "XCore");
> }
>
> -// Force static initialization when called from llvm/
> InitializeAllTargets.h
> -namespace llvm {
> - void InitializeXCoreTarget() { }
> -}
> +// Force static initialization.
> +extern "C" void LLVMInitializeXCoreTarget() { }
>
> const TargetAsmInfo *XCoreTargetMachine::createTargetAsmInfo() const {
> return new XCoreTargetAsmInfo(*this);
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list