LLVM  14.0.0git
Classes | Public Member Functions | Static Public Member Functions | List of all members
llvm::TargetRegistry Struct Reference

TargetRegistry - Generic interface to target specific features. More...

#include "llvm/Support/TargetRegistry.h"

Classes

class  iterator
 

Public Member Functions

 TargetRegistry ()=delete
 

Static Public Member Functions

static void printRegisteredTargetsForVersion (raw_ostream &OS)
 printRegisteredTargetsForVersion - Print the registered targets appropriately for inclusion in a tool's version output. More...
 
Registry Access
static iterator_range< iteratortargets ()
 
static const TargetlookupTarget (const std::string &Triple, std::string &Error)
 lookupTarget - Lookup a target based on a target triple. More...
 
static const TargetlookupTarget (const std::string &ArchName, Triple &TheTriple, std::string &Error)
 lookupTarget - Lookup a target based on an architecture name and a target triple. More...
 
Target Registration
static void RegisterTarget (Target &T, const char *Name, const char *ShortDesc, const char *BackendName, Target::ArchMatchFnTy ArchMatchFn, bool HasJIT=false)
 RegisterTarget - Register the given target. More...
 
static void RegisterMCAsmInfo (Target &T, Target::MCAsmInfoCtorFnTy Fn)
 RegisterMCAsmInfo - Register a MCAsmInfo implementation for the given target. More...
 
static void RegisterMCObjectFileInfo (Target &T, Target::MCObjectFileInfoCtorFnTy Fn)
 Register a MCObjectFileInfo implementation for the given target. More...
 
static void RegisterMCInstrInfo (Target &T, Target::MCInstrInfoCtorFnTy Fn)
 RegisterMCInstrInfo - Register a MCInstrInfo implementation for the given target. More...
 
static void RegisterMCInstrAnalysis (Target &T, Target::MCInstrAnalysisCtorFnTy Fn)
 RegisterMCInstrAnalysis - Register a MCInstrAnalysis implementation for the given target. More...
 
static void RegisterMCRegInfo (Target &T, Target::MCRegInfoCtorFnTy Fn)
 RegisterMCRegInfo - Register a MCRegisterInfo implementation for the given target. More...
 
static void RegisterMCSubtargetInfo (Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
 RegisterMCSubtargetInfo - Register a MCSubtargetInfo implementation for the given target. More...
 
static void RegisterTargetMachine (Target &T, Target::TargetMachineCtorTy Fn)
 RegisterTargetMachine - Register a TargetMachine implementation for the given target. More...
 
static void RegisterMCAsmBackend (Target &T, Target::MCAsmBackendCtorTy Fn)
 RegisterMCAsmBackend - Register a MCAsmBackend implementation for the given target. More...
 
static void RegisterMCAsmParser (Target &T, Target::MCAsmParserCtorTy Fn)
 RegisterMCAsmParser - Register a MCTargetAsmParser implementation for the given target. More...
 
static void RegisterAsmPrinter (Target &T, Target::AsmPrinterCtorTy Fn)
 RegisterAsmPrinter - Register an AsmPrinter implementation for the given target. More...
 
static void RegisterMCDisassembler (Target &T, Target::MCDisassemblerCtorTy Fn)
 RegisterMCDisassembler - Register a MCDisassembler implementation for the given target. More...
 
static void RegisterMCInstPrinter (Target &T, Target::MCInstPrinterCtorTy Fn)
 RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target. More...
 
static void RegisterMCCodeEmitter (Target &T, Target::MCCodeEmitterCtorTy Fn)
 RegisterMCCodeEmitter - Register a MCCodeEmitter implementation for the given target. More...
 
static void RegisterCOFFStreamer (Target &T, Target::COFFStreamerCtorTy Fn)
 
static void RegisterMachOStreamer (Target &T, Target::MachOStreamerCtorTy Fn)
 
static void RegisterELFStreamer (Target &T, Target::ELFStreamerCtorTy Fn)
 
static void RegisterWasmStreamer (Target &T, Target::WasmStreamerCtorTy Fn)
 
static void RegisterXCOFFStreamer (Target &T, Target::XCOFFStreamerCtorTy Fn)
 
static void RegisterNullTargetStreamer (Target &T, Target::NullTargetStreamerCtorTy Fn)
 
static void RegisterAsmTargetStreamer (Target &T, Target::AsmTargetStreamerCtorTy Fn)
 
static void RegisterObjectTargetStreamer (Target &T, Target::ObjectTargetStreamerCtorTy Fn)
 
static void RegisterMCRelocationInfo (Target &T, Target::MCRelocationInfoCtorTy Fn)
 RegisterMCRelocationInfo - Register an MCRelocationInfo implementation for the given target. More...
 
static void RegisterMCSymbolizer (Target &T, Target::MCSymbolizerCtorTy Fn)
 RegisterMCSymbolizer - Register an MCSymbolizer implementation for the given target. More...
 
static void RegisterCustomBehaviour (Target &T, Target::CustomBehaviourCtorTy Fn)
 RegisterCustomBehaviour - Register a CustomBehaviour implementation for the given target. More...
 
static void RegisterInstrPostProcess (Target &T, Target::InstrPostProcessCtorTy Fn)
 RegisterInstrPostProcess - Register an InstrPostProcess implementation for the given target. More...
 

Detailed Description

TargetRegistry - Generic interface to target specific features.

Definition at line 678 of file TargetRegistry.h.

Constructor & Destructor Documentation

◆ TargetRegistry()

llvm::TargetRegistry::TargetRegistry ( )
delete

Member Function Documentation

◆ lookupTarget() [1/2]

const Target * TargetRegistry::lookupTarget ( const std::string &  ArchName,
Triple TheTriple,
std::string &  Error 
)
static

lookupTarget - Lookup a target based on an architecture name and a target triple.

If the architecture name is non-empty, then the lookup is done by architecture. Otherwise, the target triple is used.

Parameters
ArchName- The architecture to use for finding a target.
TheTriple- The triple to use for finding a target. The triple is updated with canonical architecture name if a lookup by architecture is done.
Error- On failure, an error string describing why no target was found.

Definition at line 24 of file TargetRegistry.cpp.

References llvm::sys::path::end(), llvm::find_if(), llvm::Triple::getArchTypeForLLVMName(), llvm::Triple::getTriple(), I, lookupTarget(), llvm::Triple::setArch(), T, targets(), and llvm::Triple::UnknownArch.

◆ lookupTarget() [2/2]

const Target * TargetRegistry::lookupTarget ( const std::string &  Triple,
std::string &  Error 
)
static

lookupTarget - Lookup a target based on a target triple.

Parameters
Triple- The triple to use for finding a target.
Error- On failure, an error string describing why no target was found.

Definition at line 62 of file TargetRegistry.cpp.

References llvm::sys::path::begin(), llvm::sys::path::end(), llvm::find_if(), llvm::Triple::getArch(), I, T, and targets().

Referenced by llvm::TargetMachineBuilder::create(), llvm::orc::JITTargetMachineBuilder::createTargetMachine(), llvm::DwarfStreamer::init(), initAndLookupTarget(), LLVMCreateDisasmCPUFeatures(), LLVMGetTargetFromTriple(), llvm::DWARFContext::loadRegisterInfo(), lookupTarget(), and llvm::EngineBuilder::selectTarget().

◆ printRegisteredTargetsForVersion()

void TargetRegistry::printRegisteredTargetsForVersion ( raw_ostream OS)
static

printRegisteredTargetsForVersion - Print the registered targets appropriately for inclusion in a tool's version output.

Definition at line 117 of file TargetRegistry.cpp.

References llvm::array_pod_sort(), llvm::numbers::e, i, llvm::raw_ostream::indent(), llvm::max(), T, TargetArraySortFn(), and targets().

◆ RegisterAsmPrinter()

static void llvm::TargetRegistry::RegisterAsmPrinter ( Target T,
Target::AsmPrinterCtorTy  Fn 
)
inlinestatic

RegisterAsmPrinter - Register an AsmPrinter implementation for the given target.

Clients are responsible for ensuring that registration doesn't occur while another thread is attempting to access the registry. Typically this is done by initializing all targets at program startup.

Parameters
T- The target being registered.
Fn- A function to construct an AsmPrinter for the target.

Definition at line 903 of file TargetRegistry.h.

References T.

Referenced by LLVMInitializeAMDGPUAsmPrinter(), LLVMInitializePowerPCAsmPrinter(), and llvm::RegisterAsmPrinter< AsmPrinterImpl >::RegisterAsmPrinter().

◆ RegisterAsmTargetStreamer()

static void llvm::TargetRegistry::RegisterAsmTargetStreamer ( Target T,
Target::AsmTargetStreamerCtorTy  Fn 
)
inlinestatic

◆ RegisterCOFFStreamer()

static void llvm::TargetRegistry::RegisterCOFFStreamer ( Target T,
Target::COFFStreamerCtorTy  Fn 
)
inlinestatic

Definition at line 947 of file TargetRegistry.h.

References T.

Referenced by LLVMInitializeAArch64TargetMC(), and LLVMInitializeARMTargetMC().

◆ RegisterCustomBehaviour()

static void llvm::TargetRegistry::RegisterCustomBehaviour ( Target T,
Target::CustomBehaviourCtorTy  Fn 
)
inlinestatic

RegisterCustomBehaviour - Register a CustomBehaviour implementation for the given target.

Clients are responsible for ensuring that registration doesn't occur while another thread is attempting to access the registry. Typically this is done by initializing all targets at program startup.

Parameters
T- The target being registered.
Fn- A function to construct a CustomBehaviour for the target.

Definition at line 1019 of file TargetRegistry.h.

References T.

Referenced by LLVMInitializeAMDGPUTargetMCA().

◆ RegisterELFStreamer()

static void llvm::TargetRegistry::RegisterELFStreamer ( Target T,
Target::ELFStreamerCtorTy  Fn 
)
inlinestatic

◆ RegisterInstrPostProcess()

static void llvm::TargetRegistry::RegisterInstrPostProcess ( Target T,
Target::InstrPostProcessCtorTy  Fn 
)
inlinestatic

RegisterInstrPostProcess - Register an InstrPostProcess implementation for the given target.

Clients are responsible for ensuring that registration doesn't occur while another thread is attempting to access the registry. Typically this is done by initializing all targets at program startup.

Parameters
T- The target being registered.
Fn- A function to construct an InstrPostProcess for the target.

Definition at line 1033 of file TargetRegistry.h.

References T.

Referenced by LLVMInitializeAMDGPUTargetMCA().

◆ RegisterMachOStreamer()

static void llvm::TargetRegistry::RegisterMachOStreamer ( Target T,
Target::MachOStreamerCtorTy  Fn 
)
inlinestatic

Definition at line 951 of file TargetRegistry.h.

References T.

Referenced by LLVMInitializeAArch64TargetMC(), and LLVMInitializeARMTargetMC().

◆ RegisterMCAsmBackend()

static void llvm::TargetRegistry::RegisterMCAsmBackend ( Target T,
Target::MCAsmBackendCtorTy  Fn 
)
inlinestatic

RegisterMCAsmBackend - Register a MCAsmBackend implementation for the given target.

Clients are responsible for ensuring that registration doesn't occur while another thread is attempting to access the registry. Typically this is done by initializing all targets at program startup.

Parameters
T- The target being registered.
Fn- A function to construct an AsmBackend for the target.

Definition at line 877 of file TargetRegistry.h.

References T.

Referenced by LLVMInitializeAArch64TargetMC(), LLVMInitializeAMDGPUTargetMC(), LLVMInitializeARMTargetMC(), LLVMInitializeAVRTargetMC(), LLVMInitializeBPFTargetMC(), LLVMInitializeCSKYTargetMC(), LLVMInitializeHexagonTargetMC(), LLVMInitializeLanaiTargetMC(), LLVMInitializeM68kTargetMC(), LLVMInitializeMipsTargetMC(), LLVMInitializeMSP430TargetMC(), LLVMInitializePowerPCTargetMC(), LLVMInitializeRISCVTargetMC(), LLVMInitializeSparcTargetMC(), LLVMInitializeSystemZTargetMC(), LLVMInitializeVETargetMC(), LLVMInitializeWebAssemblyTargetMC(), and llvm::RegisterMCAsmBackend< MCAsmBackendImpl >::RegisterMCAsmBackend().

◆ RegisterMCAsmInfo()

static void llvm::TargetRegistry::RegisterMCAsmInfo ( Target T,
Target::MCAsmInfoCtorFnTy  Fn 
)
inlinestatic

RegisterMCAsmInfo - Register a MCAsmInfo implementation for the given target.

Clients are responsible for ensuring that registration doesn't occur while another thread is attempting to access the registry. Typically this is done by initializing all targets at program startup.

Parameters
T- The target being registered.
Fn- A function to construct a MCAsmInfo for the target.

Definition at line 791 of file TargetRegistry.h.

References T.

Referenced by LLVMInitializeCSKYTargetMC(), LLVMInitializeRISCVTargetMC(), LLVMInitializeSystemZTargetMC(), llvm::RegisterMCAsmInfo< MCAsmInfoImpl >::RegisterMCAsmInfo(), and llvm::RegisterMCAsmInfoFn::RegisterMCAsmInfoFn().

◆ RegisterMCAsmParser()

static void llvm::TargetRegistry::RegisterMCAsmParser ( Target T,
Target::MCAsmParserCtorTy  Fn 
)
inlinestatic

RegisterMCAsmParser - Register a MCTargetAsmParser implementation for the given target.

Clients are responsible for ensuring that registration doesn't occur while another thread is attempting to access the registry. Typically this is done by initializing all targets at program startup.

Parameters
T- The target being registered.
Fn- A function to construct an MCTargetAsmParser for the target.

Definition at line 890 of file TargetRegistry.h.

References T.

Referenced by llvm::RegisterMCAsmParser< MCAsmParserImpl >::RegisterMCAsmParser().

◆ RegisterMCCodeEmitter()

static void llvm::TargetRegistry::RegisterMCCodeEmitter ( Target T,
Target::MCCodeEmitterCtorTy  Fn 
)
inlinestatic

RegisterMCCodeEmitter - Register a MCCodeEmitter implementation for the given target.

Clients are responsible for ensuring that registration doesn't occur while another thread is attempting to access the registry. Typically this is done by initializing all targets at program startup.

Parameters
T- The target being registered.
Fn- A function to construct an MCCodeEmitter for the target.

Definition at line 943 of file TargetRegistry.h.

References T.

Referenced by LLVMInitializeAArch64TargetMC(), LLVMInitializeAMDGPUTargetMC(), LLVMInitializeARMTargetMC(), LLVMInitializeAVRTargetMC(), LLVMInitializeBPFTargetMC(), LLVMInitializeCSKYTargetMC(), LLVMInitializeHexagonTargetMC(), LLVMInitializeLanaiTargetMC(), LLVMInitializeM68kTargetMC(), LLVMInitializeMipsTargetMC(), LLVMInitializeMSP430TargetMC(), LLVMInitializePowerPCTargetMC(), LLVMInitializeRISCVTargetMC(), LLVMInitializeSparcTargetMC(), LLVMInitializeSystemZTargetMC(), LLVMInitializeVETargetMC(), LLVMInitializeWebAssemblyTargetMC(), and llvm::RegisterMCCodeEmitter< MCCodeEmitterImpl >::RegisterMCCodeEmitter().

◆ RegisterMCDisassembler()

static void llvm::TargetRegistry::RegisterMCDisassembler ( Target T,
Target::MCDisassemblerCtorTy  Fn 
)
inlinestatic

RegisterMCDisassembler - Register a MCDisassembler implementation for the given target.

Clients are responsible for ensuring that registration doesn't occur while another thread is attempting to access the registry. Typically this is done by initializing all targets at program startup.

Parameters
T- The target being registered.
Fn- A function to construct an MCDisassembler for the target.

Definition at line 916 of file TargetRegistry.h.

References T.

Referenced by LLVMInitializeAArch64Disassembler(), LLVMInitializeAMDGPUDisassembler(), LLVMInitializeARCDisassembler(), LLVMInitializeARMDisassembler(), LLVMInitializeAVRDisassembler(), LLVMInitializeBPFDisassembler(), LLVMInitializeHexagonDisassembler(), LLVMInitializeLanaiDisassembler(), LLVMInitializeM68kDisassembler(), LLVMInitializeMipsDisassembler(), LLVMInitializeMSP430Disassembler(), LLVMInitializePowerPCDisassembler(), LLVMInitializeRISCVDisassembler(), LLVMInitializeSparcDisassembler(), LLVMInitializeSystemZDisassembler(), LLVMInitializeVEDisassembler(), LLVMInitializeWebAssemblyDisassembler(), LLVMInitializeX86Disassembler(), and LLVMInitializeXCoreDisassembler().

◆ RegisterMCInstPrinter()

static void llvm::TargetRegistry::RegisterMCInstPrinter ( Target T,
Target::MCInstPrinterCtorTy  Fn 
)
inlinestatic

RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target.

Clients are responsible for ensuring that registration doesn't occur while another thread is attempting to access the registry. Typically this is done by initializing all targets at program startup.

Parameters
T- The target being registered.
Fn- A function to construct an MCInstPrinter for the target.

Definition at line 930 of file TargetRegistry.h.

References T.

Referenced by LLVMInitializeAArch64TargetMC(), LLVMInitializeAMDGPUTargetMC(), LLVMInitializeARCTargetMC(), LLVMInitializeARMTargetMC(), LLVMInitializeAVRTargetMC(), LLVMInitializeBPFTargetMC(), LLVMInitializeCSKYTargetMC(), LLVMInitializeHexagonTargetMC(), LLVMInitializeLanaiTargetMC(), LLVMInitializeM68kTargetMC(), LLVMInitializeMipsTargetMC(), LLVMInitializeMSP430TargetMC(), LLVMInitializeNVPTXTargetMC(), LLVMInitializePowerPCTargetMC(), LLVMInitializeRISCVTargetMC(), LLVMInitializeSparcTargetMC(), LLVMInitializeSystemZTargetMC(), LLVMInitializeVETargetMC(), LLVMInitializeWebAssemblyTargetMC(), and LLVMInitializeXCoreTargetMC().

◆ RegisterMCInstrAnalysis()

static void llvm::TargetRegistry::RegisterMCInstrAnalysis ( Target T,
Target::MCInstrAnalysisCtorFnTy  Fn 
)
inlinestatic

◆ RegisterMCInstrInfo()

static void llvm::TargetRegistry::RegisterMCInstrInfo ( Target T,
Target::MCInstrInfoCtorFnTy  Fn 
)
inlinestatic

◆ RegisterMCObjectFileInfo()

static void llvm::TargetRegistry::RegisterMCObjectFileInfo ( Target T,
Target::MCObjectFileInfoCtorFnTy  Fn 
)
inlinestatic

Register a MCObjectFileInfo implementation for the given target.

Clients are responsible for ensuring that registration doesn't occur while another thread is attempting to access the registry. Typically this is done by initializing all targets at program startup.

Parameters
T- The target being registered.
Fn- A function to construct a MCObjectFileInfo for the target.

Definition at line 803 of file TargetRegistry.h.

References T.

Referenced by llvm::RegisterMCObjectFileInfo< MCObjectFileInfoImpl >::RegisterMCObjectFileInfo(), and llvm::RegisterMCObjectFileInfoFn::RegisterMCObjectFileInfoFn().

◆ RegisterMCRegInfo()

static void llvm::TargetRegistry::RegisterMCRegInfo ( Target T,
Target::MCRegInfoCtorFnTy  Fn 
)
inlinestatic

◆ RegisterMCRelocationInfo()

static void llvm::TargetRegistry::RegisterMCRelocationInfo ( Target T,
Target::MCRelocationInfoCtorTy  Fn 
)
inlinestatic

RegisterMCRelocationInfo - Register an MCRelocationInfo implementation for the given target.

Clients are responsible for ensuring that registration doesn't occur while another thread is attempting to access the registry. Typically this is done by initializing all targets at program startup.

Parameters
T- The target being registered.
Fn- A function to construct an MCRelocationInfo for the target.

Definition at line 992 of file TargetRegistry.h.

References T.

Referenced by LLVMInitializeARMTargetMC(), LLVMInitializeLanaiTargetMC(), and LLVMInitializeM68kTargetMC().

◆ RegisterMCSubtargetInfo()

static void llvm::TargetRegistry::RegisterMCSubtargetInfo ( Target T,
Target::MCSubtargetInfoCtorFnTy  Fn 
)
inlinestatic

◆ RegisterMCSymbolizer()

static void llvm::TargetRegistry::RegisterMCSymbolizer ( Target T,
Target::MCSymbolizerCtorTy  Fn 
)
inlinestatic

RegisterMCSymbolizer - Register an MCSymbolizer implementation for the given target.

Clients are responsible for ensuring that registration doesn't occur while another thread is attempting to access the registry. Typically this is done by initializing all targets at program startup.

Parameters
T- The target being registered.
Fn- A function to construct an MCSymbolizer for the target.

Definition at line 1006 of file TargetRegistry.h.

References T.

Referenced by LLVMInitializeAArch64Disassembler(), and LLVMInitializeAMDGPUDisassembler().

◆ RegisterNullTargetStreamer()

static void llvm::TargetRegistry::RegisterNullTargetStreamer ( Target T,
Target::NullTargetStreamerCtorTy  Fn 
)
inlinestatic

◆ RegisterObjectTargetStreamer()

static void llvm::TargetRegistry::RegisterObjectTargetStreamer ( Target T,
Target::ObjectTargetStreamerCtorTy  Fn 
)
inlinestatic

◆ RegisterTarget()

void TargetRegistry::RegisterTarget ( Target T,
const char *  Name,
const char *  ShortDesc,
const char *  BackendName,
Target::ArchMatchFnTy  ArchMatchFn,
bool  HasJIT = false 
)
static

RegisterTarget - Register the given target.

Attempts to register a target which has already been registered will be ignored.

Clients are responsible for ensuring that registration doesn't occur while another thread is attempting to access the registry. Typically this is done by initializing all targets at program startup.

Parameters
T- The target being registered.
Name- The target name. This should be a static string.
ShortDesc- A short target description. This should be a static string.
BackendName- The name of the backend. This should be a static string that is the same for all targets that share a backend implementation and must match the name used in the 'def X : Target ...' in TableGen.
ArchMatchFn- The arch match checking function for this target.
HasJIT- Whether the target supports JIT code generation.

Definition at line 88 of file TargetRegistry.cpp.

References assert(), FirstTarget, and T.

Referenced by LLVMInitializeAArch64TargetInfo(), LLVMInitializeBPFTargetInfo(), and llvm::RegisterTarget< TargetArchType, HasJIT >::RegisterTarget().

◆ RegisterTargetMachine()

static void llvm::TargetRegistry::RegisterTargetMachine ( Target T,
Target::TargetMachineCtorTy  Fn 
)
inlinestatic

RegisterTargetMachine - Register a TargetMachine implementation for the given target.

Clients are responsible for ensuring that registration doesn't occur while another thread is attempting to access the registry. Typically this is done by initializing all targets at program startup.

Parameters
T- The target being registered.
Fn- A function to construct a TargetMachine for the target.

Definition at line 864 of file TargetRegistry.h.

References T.

Referenced by llvm::RegisterTargetMachine< TargetMachineImpl >::RegisterTargetMachine().

◆ RegisterWasmStreamer()

static void llvm::TargetRegistry::RegisterWasmStreamer ( Target T,
Target::WasmStreamerCtorTy  Fn 
)
inlinestatic

Definition at line 959 of file TargetRegistry.h.

References T.

◆ RegisterXCOFFStreamer()

static void llvm::TargetRegistry::RegisterXCOFFStreamer ( Target T,
Target::XCOFFStreamerCtorTy  Fn 
)
inlinestatic

Definition at line 963 of file TargetRegistry.h.

References T.

Referenced by LLVMInitializePowerPCTargetMC().

◆ targets()

iterator_range< TargetRegistry::iterator > TargetRegistry::targets ( )
static

The documentation for this struct was generated from the following files: