LLVM  5.0.0
Public Types | Public Member Functions | Friends | List of all members
llvm::Target Class Reference

Target - Wrapper for Target specific information. More...

#include "llvm/Support/TargetRegistry.h"

Public Types

using ArchMatchFnTy = bool(*)(Triple::ArchType Arch)
 
using MCAsmInfoCtorFnTy = MCAsmInfo *(*)(const MCRegisterInfo &MRI, const Triple &TT)
 
using MCAdjustCodeGenOptsFnTy = void(*)(const Triple &TT, Reloc::Model RM, CodeModel::Model &CM)
 
using MCInstrInfoCtorFnTy ) = MCInstrInfo *(*)(
 
using MCInstrAnalysisCtorFnTy = MCInstrAnalysis *(*)(const MCInstrInfo *Info)
 
using MCRegInfoCtorFnTy = MCRegisterInfo *(*)(const Triple &TT)
 
using MCSubtargetInfoCtorFnTy = MCSubtargetInfo *(*)(const Triple &TT, StringRef CPU, StringRef Features)
 
using TargetMachineCtorTy = TargetMachine *(*)(const Target &T, const Triple &TT, StringRef CPU, StringRef Features, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL)
 
using AsmPrinterCtorTy = AsmPrinter *(*)(TargetMachine &TM, std::unique_ptr< MCStreamer > &&Streamer)
 
using MCAsmBackendCtorTy = MCAsmBackend *(*)(const Target &T, const MCRegisterInfo &MRI, const Triple &TT, StringRef CPU, const MCTargetOptions &Options)
 
using MCAsmParserCtorTy = MCTargetAsmParser *(*)(const MCSubtargetInfo &STI, MCAsmParser &P, const MCInstrInfo &MII, const MCTargetOptions &Options)
 
using MCDisassemblerCtorTy = MCDisassembler *(*)(const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx)
 
using MCInstPrinterCtorTy = MCInstPrinter *(*)(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
 
using MCCodeEmitterCtorTy = MCCodeEmitter *(*)(const MCInstrInfo &II, const MCRegisterInfo &MRI, MCContext &Ctx)
 
using ELFStreamerCtorTy = MCStreamer *(*)(const Triple &T, MCContext &Ctx, MCAsmBackend &TAB, raw_pwrite_stream &OS, MCCodeEmitter *Emitter, bool RelaxAll)
 
using MachOStreamerCtorTy = MCStreamer *(*)(MCContext &Ctx, MCAsmBackend &TAB, raw_pwrite_stream &OS, MCCodeEmitter *Emitter, bool RelaxAll, bool DWARFMustBeAtTheEnd)
 
using COFFStreamerCtorTy = MCStreamer *(*)(MCContext &Ctx, MCAsmBackend &TAB, raw_pwrite_stream &OS, MCCodeEmitter *Emitter, bool RelaxAll, bool IncrementalLinkerCompatible)
 
using WasmStreamerCtorTy = MCStreamer *(*)(const Triple &T, MCContext &Ctx, MCAsmBackend &TAB, raw_pwrite_stream &OS, MCCodeEmitter *Emitter, bool RelaxAll)
 
using NullTargetStreamerCtorTy = MCTargetStreamer *(*)(MCStreamer &S)
 
using AsmTargetStreamerCtorTy = MCTargetStreamer *(*)(MCStreamer &S, formatted_raw_ostream &OS, MCInstPrinter *InstPrint, bool IsVerboseAsm)
 
using ObjectTargetStreamerCtorTy = MCTargetStreamer *(*)(MCStreamer &S, const MCSubtargetInfo &STI)
 
using MCRelocationInfoCtorTy = MCRelocationInfo *(*)(const Triple &TT, MCContext &Ctx)
 
using MCSymbolizerCtorTy = MCSymbolizer *(*)(const Triple &TT, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp, void *DisInfo, MCContext *Ctx, std::unique_ptr< MCRelocationInfo > &&RelInfo)
 

Public Member Functions

 Target ()=default
 
Target Information
const Target * getNext () const
 
const char * getName () const
 getName - Get the target name. More...
 
const char * getShortDescription () const
 getShortDescription - Get a short description of the target. More...
 
Feature Predicates
bool hasJIT () const
 hasJIT - Check if this targets supports the just-in-time compilation. More...
 
bool hasTargetMachine () const
 hasTargetMachine - Check if this target supports code generation. More...
 
bool hasMCAsmBackend () const
 hasMCAsmBackend - Check if this target supports .o generation. More...
 
bool hasMCAsmParser () const
 hasMCAsmParser - Check if this target supports assembly parsing. More...
 
Feature Constructors
MCAsmInfo * createMCAsmInfo (const MCRegisterInfo &MRI, StringRef TheTriple) const
 createMCAsmInfo - Create a MCAsmInfo implementation for the specified target triple. More...
 
void adjustCodeGenOpts (const Triple &TT, Reloc::Model RM, CodeModel::Model &CM) const
 
MCInstrInfo * createMCInstrInfo () const
 createMCInstrInfo - Create a MCInstrInfo implementation. More...
 
MCInstrAnalysis * createMCInstrAnalysis (const MCInstrInfo *Info) const
 createMCInstrAnalysis - Create a MCInstrAnalysis implementation. More...
 
MCRegisterInfo * createMCRegInfo (StringRef TT) const
 createMCRegInfo - Create a MCRegisterInfo implementation. More...
 
MCSubtargetInfo * createMCSubtargetInfo (StringRef TheTriple, StringRef CPU, StringRef Features) const
 createMCSubtargetInfo - Create a MCSubtargetInfo implementation. More...
 
TargetMachine * createTargetMachine (StringRef TT, StringRef CPU, StringRef Features, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM=CodeModel::Default, CodeGenOpt::Level OL=CodeGenOpt::Default) const
 createTargetMachine - Create a target specific machine implementation for the specified Triple. More...
 
MCAsmBackend * createMCAsmBackend (const MCRegisterInfo &MRI, StringRef TheTriple, StringRef CPU, const MCTargetOptions &Options) const
 createMCAsmBackend - Create a target specific assembly parser. More...
 
MCTargetAsmParser * createMCAsmParser (const MCSubtargetInfo &STI, MCAsmParser &Parser, const MCInstrInfo &MII, const MCTargetOptions &Options) const
 createMCAsmParser - Create a target specific assembly parser. More...
 
AsmPrinter * createAsmPrinter (TargetMachine &TM, std::unique_ptr< MCStreamer > &&Streamer) const
 createAsmPrinter - Create a target specific assembly printer pass. More...
 
MCDisassembler * createMCDisassembler (const MCSubtargetInfo &STI, MCContext &Ctx) const
 
MCInstPrinter * createMCInstPrinter (const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI) const
 
MCCodeEmitter * createMCCodeEmitter (const MCInstrInfo &II, const MCRegisterInfo &MRI, MCContext &Ctx) const
 createMCCodeEmitter - Create a target specific code emitter. More...
 
MCStreamer * createMCObjectStreamer (const Triple &T, MCContext &Ctx, MCAsmBackend &TAB, raw_pwrite_stream &OS, MCCodeEmitter *Emitter, const MCSubtargetInfo &STI, bool RelaxAll, bool IncrementalLinkerCompatible, bool DWARFMustBeAtTheEnd) const
 Create a target specific MCStreamer. More...
 
MCStreamer * createAsmStreamer (MCContext &Ctx, std::unique_ptr< formatted_raw_ostream > OS, bool IsVerboseAsm, bool UseDwarfDirectory, MCInstPrinter *InstPrint, MCCodeEmitter *CE, MCAsmBackend *TAB, bool ShowInst) const
 
MCTargetStreamer * createAsmTargetStreamer (MCStreamer &S, formatted_raw_ostream &OS, MCInstPrinter *InstPrint, bool IsVerboseAsm) const
 
MCStreamer * createNullStreamer (MCContext &Ctx) const
 
MCTargetStreamer * createNullTargetStreamer (MCStreamer &S) const
 
MCRelocationInfo * createMCRelocationInfo (StringRef TT, MCContext &Ctx) const
 createMCRelocationInfo - Create a target specific MCRelocationInfo. More...
 
MCSymbolizer * createMCSymbolizer (StringRef TT, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp, void *DisInfo, MCContext *Ctx, std::unique_ptr< MCRelocationInfo > &&RelInfo) const
 createMCSymbolizer - Create a target specific MCSymbolizer. More...
 

Friends

struct TargetRegistry
 

Detailed Description

Target - Wrapper for Target specific information.

For registration purposes, this is a POD type so that targets can be registered without the use of static constructors.

Targets should implement a single global instance of this class (which will be zero initialized), and pass that instance to the TargetRegistry as part of their initialization.

Definition at line 96 of file TargetRegistry.h.

Member Typedef Documentation

Definition at line 100 of file TargetRegistry.h.

using llvm::Target::AsmPrinterCtorTy = AsmPrinter *(*)( TargetMachine &TM, std::unique_ptr<MCStreamer> &&Streamer)

Definition at line 121 of file TargetRegistry.h.

Definition at line 163 of file TargetRegistry.h.

Definition at line 154 of file TargetRegistry.h.

Definition at line 144 of file TargetRegistry.h.

Definition at line 149 of file TargetRegistry.h.

Definition at line 105 of file TargetRegistry.h.

Definition at line 125 of file TargetRegistry.h.

Definition at line 103 of file TargetRegistry.h.

Definition at line 128 of file TargetRegistry.h.

Definition at line 139 of file TargetRegistry.h.

Definition at line 131 of file TargetRegistry.h.

Definition at line 136 of file TargetRegistry.h.

Definition at line 108 of file TargetRegistry.h.

using llvm::Target::MCInstrInfoCtorFnTy = MCInstrInfo *(*)(

Definition at line 107 of file TargetRegistry.h.

Definition at line 109 of file TargetRegistry.h.

Definition at line 167 of file TargetRegistry.h.

Definition at line 112 of file TargetRegistry.h.

using llvm::Target::MCSymbolizerCtorTy = MCSymbolizer *(*)( const Triple &TT, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp, void *DisInfo, MCContext *Ctx, std::unique_ptr<MCRelocationInfo> &&RelInfo)

Definition at line 171 of file TargetRegistry.h.

Definition at line 160 of file TargetRegistry.h.

Definition at line 165 of file TargetRegistry.h.

Definition at line 116 of file TargetRegistry.h.

Definition at line 159 of file TargetRegistry.h.

Constructor & Destructor Documentation

llvm::Target::Target ( )
default

Member Function Documentation

void llvm::Target::adjustCodeGenOpts ( const Triple &  TT,
Reloc::Model  RM,
CodeModel::Model &  CM 
) const
inline

Definition at line 315 of file TargetRegistry.h.

Referenced by llvm::LLVMTargetMachine::LLVMTargetMachine().

AsmPrinter* llvm::Target::createAsmPrinter ( TargetMachine &  TM,
std::unique_ptr< MCStreamer > &&  Streamer 
) const
inline

createAsmPrinter - Create a target specific assembly printer pass.

This takes ownership of the MCStreamer object.

Definition at line 406 of file TargetRegistry.h.

Referenced by llvm::LLVMTargetMachine::addAsmPrinter(), and llvm::LLVMTargetMachine::addPassesToEmitMC().

MCStreamer* llvm::Target::createAsmStreamer ( MCContext &  Ctx,
std::unique_ptr< formatted_raw_ostream >  OS,
bool  IsVerboseAsm,
bool  UseDwarfDirectory,
MCInstPrinter *  InstPrint,
MCCodeEmitter *  CE,
MCAsmBackend *  TAB,
bool  ShowInst 
) const
inline
MCTargetStreamer* llvm::Target::createAsmTargetStreamer ( MCStreamer &  S,
formatted_raw_ostream &  OS,
MCInstPrinter *  InstPrint,
bool  IsVerboseAsm 
) const
inline

Definition at line 500 of file TargetRegistry.h.

Referenced by createAsmStreamer().

MCAsmBackend* llvm::Target::createMCAsmBackend ( const MCRegisterInfo &  MRI,
StringRef  TheTriple,
StringRef  CPU,
const MCTargetOptions &  Options 
) const
inline

createMCAsmBackend - Create a target specific assembly parser.

Parameters
TheTripleThe target triple string.

Definition at line 382 of file TargetRegistry.h.

Referenced by llvm::LLVMTargetMachine::addAsmPrinter(), and llvm::LLVMTargetMachine::addPassesToEmitMC().

MCAsmInfo* llvm::Target::createMCAsmInfo ( const MCRegisterInfo &  MRI,
StringRef  TheTriple 
) const
inline

createMCAsmInfo - Create a MCAsmInfo implementation for the specified target triple.

Parameters
TheTripleThis argument is used to determine the target machine feature set; it should always be provided. Generally this should be either the target triple from the module, or the target triple of the host if that does not exist.

Definition at line 308 of file TargetRegistry.h.

Referenced by llvm::LLVMTargetMachine::initAsmInfo(), and LLVMCreateDisasmCPUFeatures().

MCTargetAsmParser* llvm::Target::createMCAsmParser ( const MCSubtargetInfo &  STI,
MCAsmParser &  Parser,
const MCInstrInfo &  MII,
const MCTargetOptions &  Options 
) const
inline

createMCAsmParser - Create a target specific assembly parser.

Parameters
ParserThe target independent parser implementation to use for parsing and lexing.

Definition at line 395 of file TargetRegistry.h.

MCCodeEmitter* llvm::Target::createMCCodeEmitter ( const MCInstrInfo &  II,
const MCRegisterInfo &  MRI,
MCContext &  Ctx 
) const
inline

createMCCodeEmitter - Create a target specific code emitter.

Definition at line 430 of file TargetRegistry.h.

Referenced by llvm::LLVMTargetMachine::addAsmPrinter(), llvm::LLVMTargetMachine::addPassesToEmitMC(), and llvm::X86AsmPrinter::runOnMachineFunction().

MCDisassembler* llvm::Target::createMCDisassembler ( const MCSubtargetInfo &  STI,
MCContext &  Ctx 
) const
inline

Definition at line 413 of file TargetRegistry.h.

Referenced by LLVMCreateDisasmCPUFeatures().

MCInstPrinter* llvm::Target::createMCInstPrinter ( const Triple &  T,
unsigned  SyntaxVariant,
const MCAsmInfo &  MAI,
const MCInstrInfo &  MII,
const MCRegisterInfo &  MRI 
) const
inline
MCInstrAnalysis* llvm::Target::createMCInstrAnalysis ( const MCInstrInfo *  Info) const
inline

createMCInstrAnalysis - Create a MCInstrAnalysis implementation.

Definition at line 331 of file TargetRegistry.h.

MCInstrInfo* llvm::Target::createMCInstrInfo ( ) const
inline
MCStreamer* llvm::Target::createMCObjectStreamer ( const Triple &  T,
MCContext &  Ctx,
MCAsmBackend &  TAB,
raw_pwrite_stream &  OS,
MCCodeEmitter *  Emitter,
const MCSubtargetInfo &  STI,
bool  RelaxAll,
bool  IncrementalLinkerCompatible,
bool  DWARFMustBeAtTheEnd 
) const
inline

Create a target specific MCStreamer.

Parameters
TThe target triple.
CtxThe target context.
TABThe target assembler backend object. Takes ownership.
OSThe stream object.
EmitterThe target independent assembler object.Takes ownership.
RelaxAllRelax all fixups?

Definition at line 446 of file TargetRegistry.h.

References assert(), llvm::Triple::COFF, llvm::createELFStreamer(), llvm::createMachOStreamer(), llvm::createWasmStreamer(), llvm::Triple::ELF, llvm::Triple::getObjectFormat(), llvm::Triple::isOSWindows(), llvm_unreachable(), llvm::Triple::MachO, and llvm::Triple::Wasm.

MCRegisterInfo* llvm::Target::createMCRegInfo ( StringRef  TT) const
inline

createMCRegInfo - Create a MCRegisterInfo implementation.

Definition at line 339 of file TargetRegistry.h.

Referenced by llvm::LLVMTargetMachine::initAsmInfo(), and LLVMCreateDisasmCPUFeatures().

MCRelocationInfo* llvm::Target::createMCRelocationInfo ( StringRef  TT,
MCContext &  Ctx 
) const
inline

createMCRelocationInfo - Create a target specific MCRelocationInfo.

Parameters
TTThe target triple.
CtxThe target context.

Definition at line 525 of file TargetRegistry.h.

References llvm::createMCRelocationInfo().

Referenced by LLVMCreateDisasmCPUFeatures().

MCSubtargetInfo* llvm::Target::createMCSubtargetInfo ( StringRef  TheTriple,
StringRef  CPU,
StringRef  Features 
) const
inline

createMCSubtargetInfo - Create a MCSubtargetInfo implementation.

Parameters
TheTripleThis argument is used to determine the target machine feature set; it should always be provided. Generally this should be either the target triple from the module, or the target triple of the host if that does not exist.
CPUThis specifies the name of the target CPU.
FeaturesThis specifies the string representation of the additional target features.

Definition at line 354 of file TargetRegistry.h.

Referenced by llvm::AsmPrinter::doInitialization(), llvm::LLVMTargetMachine::initAsmInfo(), and LLVMCreateDisasmCPUFeatures().

MCSymbolizer* llvm::Target::createMCSymbolizer ( StringRef  TT,
LLVMOpInfoCallback  GetOpInfo,
LLVMSymbolLookupCallback  SymbolLookUp,
void *  DisInfo,
MCContext *  Ctx,
std::unique_ptr< MCRelocationInfo > &&  RelInfo 
) const
inline

createMCSymbolizer - Create a target specific MCSymbolizer.

Parameters
TTThe target triple.
GetOpInfoThe function to get the symbolic information for operands.
SymbolLookUpThe function to lookup a symbol name.
DisInfoThe pointer to the block of symbolic information for above call back.
CtxThe target context.
RelInfoThe relocation information for this target. Takes ownership.

Definition at line 545 of file TargetRegistry.h.

References llvm::createMCSymbolizer().

Referenced by LLVMCreateDisasmCPUFeatures().

MCStreamer* llvm::Target::createNullStreamer ( MCContext &  Ctx) const
inline

Definition at line 509 of file TargetRegistry.h.

References llvm::createNullStreamer(), and createNullTargetStreamer().

MCTargetStreamer* llvm::Target::createNullTargetStreamer ( MCStreamer &  S) const
inline

Definition at line 515 of file TargetRegistry.h.

Referenced by createNullStreamer().

TargetMachine* llvm::Target::createTargetMachine ( StringRef  TT,
StringRef  CPU,
StringRef  Features,
const TargetOptions &  Options,
Optional< Reloc::Model >  RM,
CodeModel::Model  CM = CodeModel::Default,
CodeGenOpt::Level  OL = CodeGenOpt::Default 
) const
inline

createTargetMachine - Create a target specific machine implementation for the specified Triple.

Parameters
TTThis argument is used to determine the target machine feature set; it should always be provided. Generally this should be either the target triple from the module, or the target triple of the host if that does not exist.

Definition at line 369 of file TargetRegistry.h.

Referenced by llvm::TargetMachineBuilder::create(), and llvm::EngineBuilder::selectTarget().

const char* llvm::Target::getName ( ) const
inline

getName - Get the target name.

Definition at line 276 of file TargetRegistry.h.

References Name.

Referenced by LLVMGetTargetFromName(), llvm::TargetRegistry::lookupTarget(), and llvm::EngineBuilder::selectTarget().

const Target* llvm::Target::getNext ( ) const
inline

Definition at line 273 of file TargetRegistry.h.

Referenced by llvm::TargetRegistry::iterator::operator++().

const char* llvm::Target::getShortDescription ( ) const
inline

getShortDescription - Get a short description of the target.

Definition at line 279 of file TargetRegistry.h.

bool llvm::Target::hasJIT ( ) const
inline

hasJIT - Check if this targets supports the just-in-time compilation.

Definition at line 286 of file TargetRegistry.h.

Referenced by llvm::EngineBuilder::create().

bool llvm::Target::hasMCAsmBackend ( ) const
inline

hasMCAsmBackend - Check if this target supports .o generation.

Definition at line 292 of file TargetRegistry.h.

bool llvm::Target::hasMCAsmParser ( ) const
inline

hasMCAsmParser - Check if this target supports assembly parsing.

Definition at line 295 of file TargetRegistry.h.

bool llvm::Target::hasTargetMachine ( ) const
inline

hasTargetMachine - Check if this target supports code generation.

Definition at line 289 of file TargetRegistry.h.

Friends And Related Function Documentation

friend struct TargetRegistry
friend

Definition at line 98 of file TargetRegistry.h.


The documentation for this class was generated from the following file: