1//===- TargetSelect.h -----------------------------------------------------===// 2// 3// The MCLinker Project 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9#ifndef MCLD_SUPPORT_TARGETSELECT_H 10#define MCLD_SUPPORT_TARGETSELECT_H 11 12extern "C" { 13 // Declare all of the target-initialization functions that are available. 14#define MCLD_TARGET(TargetName) void MCLDInitialize##TargetName##LDTargetInfo(); 15#include "mcld/Config/Targets.def" 16 17 // Declare all of the target-dependent functions that are available. 18#define MCLD_TARGET(TargetName) void MCLDInitialize##TargetName##LDTarget(); 19#include "mcld/Config/Targets.def" 20 21 // Declare all of the target-depedent linker information 22#define MCLD_LINKER(TargetName) void MCLDInitialize##TargetName##LDInfo(); 23#include "mcld/Config/Linkers.def" 24 25 // Declare all of the available linker environment. 26#define MCLD_LINKER(TargetName) void MCLDInitialize##TargetName##MCLinker(); 27#include "mcld/Config/Linkers.def" 28 29 // Declare all of the available emulators. 30#define MCLD_TARGET(TargetName) void MCLDInitialize##TargetName##Emulation(); 31#include "mcld/Config/Targets.def" 32 33 // Declare all of the available target-specific linker 34#define MCLD_LINKER(TargetName) void MCLDInitialize##TargetName##LDBackend(); 35#include "mcld/Config/Linkers.def" 36 37 // Declare all of the available target-specific diagnostic line infomation 38#define MCLD_LINKER(TargetName) void MCLDInitialize##TargetName##DiagnosticLineInfo(); 39#include "mcld/Config/Linkers.def" 40 41} // extern "C" 42 43namespace mcld 44{ 45 /// InitializeAllTargetInfos - The main program should call this function if 46 /// it wants access to all available targets that MCLD is configured to 47 /// support, to make them available via the TargetRegistry. 48 /// 49 /// It is legal for a client to make multiple calls to this function. 50 inline void InitializeAllTargetInfos() { 51#define MCLD_TARGET(TargetName) MCLDInitialize##TargetName##LDTargetInfo(); 52#include "mcld/Config/Targets.def" 53 } 54 55 /// InitializeAllTargets - The main program should call this function if it 56 /// wants access to all available target machines that MCLD is configured to 57 /// support, to make them available via the TargetRegistry. 58 /// 59 /// It is legal for a client to make multiple calls to this function. 60 inline void InitializeAllTargets() { 61 mcld::InitializeAllTargetInfos(); 62 63#define MCLD_TARGET(TargetName) MCLDInitialize##TargetName##LDBackend(); 64#include "mcld/Config/Targets.def" 65 } 66 67 /// InitializeAllEmulations - The main program should call this function if 68 /// it wants all emulations to be configured to support. This function makes 69 /// all emulations available via the TargetRegistry. 70 inline void InitializeAllEmulations() { 71#define MCLD_TARGET(TargetName) MCLDInitialize##TargetName##Emulation(); 72#include "mcld/Config/Targets.def" 73 } 74 75 /// InitializeAllLinkers - The main program should call this function if it 76 /// wants all linkers that is configured to support, to make them 77 /// available via the TargetRegistry. 78 /// 79 /// It is legal for a client to make multiple calls to this function. 80 inline void InitializeAllLinkers() { 81#define MCLD_TARGET(TargetName) MCLDInitialize##TargetName##LDTarget(); 82#include "mcld/Config/Targets.def" 83 84#define MCLD_LINKER(TargetName) MCLDInitialize##TargetName##MCLinker(); 85#include "mcld/Config/Linkers.def" 86 } 87 88 /// InitializeMsgHandler - The main program should call this function if it 89 /// wants to print linker-specific messages. To make them available via the 90 /// TargetRegistry. 91 inline void InitializeAllDiagnostics() { 92#define MCLD_LINKER(TargetName) MCLDInitialize##TargetName##DiagnosticLineInfo(); 93#include "mcld/Config/Linkers.def" 94 } 95 96} // namespace of mcld 97 98#endif 99 100