Home | History | Annotate | Download | only in Support

Lines Matching defs:Target

1 //===- Support/TargetRegistry.h - Target Registration -----------*- C++ -*-===//
11 // the appropriate target specific classes (TargetMachine, AsmPrinter, etc.)
14 // Target specific class implementations should register themselves using the
94 /// Target - Wrapper for Target specific information.
102 class Target {
117 *(*)(const Target &T, const Triple &TT, StringRef CPU, StringRef Features,
125 using MCAsmBackendCtorTy = MCAsmBackend *(*)(const Target &T,
132 using MCDisassemblerCtorTy = MCDisassembler *(*)(const Target &T,
177 /// Next - The next registered target in the linked list, maintained by the
179 Target *Next;
181 /// The target function for checking if an architecture is supported.
184 /// Name - The target name.
187 /// ShortDesc - A short description of the target.
190 /// HasJIT - Whether this target supports the JIT.
193 /// MCAsmInfoCtorFn - Constructor function for this target's MCAsmInfo, if
197 /// MCInstrInfoCtorFn - Constructor function for this target's MCInstrInfo,
201 /// MCInstrAnalysisCtorFn - Constructor function for this target's
205 /// MCRegInfoCtorFn - Constructor function for this target's MCRegisterInfo,
209 /// MCSubtargetInfoCtorFn - Constructor function for this target's
213 /// TargetMachineCtorFn - Construction function for this target's
217 /// MCAsmBackendCtorFn - Construction function for this target's
221 /// MCAsmParserCtorFn - Construction function for this target's
225 /// AsmPrinterCtorFn - Construction function for this target's AsmPrinter,
229 /// MCDisassemblerCtorFn - Construction function for this target's
233 /// MCInstPrinterCtorFn - Construction function for this target's
237 /// MCCodeEmitterCtorFn - Construction function for this target's
247 /// Construction function for this target's null TargetStreamer, if
251 /// Construction function for this target's asm TargetStreamer, if
255 /// Construction function for this target's obj TargetStreamer, if
259 /// MCRelocationInfoCtorFn - Construction function for this target's
263 /// MCSymbolizerCtorFn - Construction function for this target's
268 Target() = default;
270 /// @name Target Information
273 // getNext - Return the next registered target.
274 const Target *getNext() const { return Next; }
276 /// getName - Get the target name.
279 /// getShortDescription - Get a short description of the target.
289 /// hasTargetMachine - Check if this target supports code generation.
292 /// hasMCAsmBackend - Check if this target supports .o generation.
295 /// hasMCAsmParser - Check if this target supports assembly parsing.
303 /// target triple.
305 /// \param TheTriple This argument is used to determine the target machine
307 /// either the target triple from the module, or the target triple of the
342 /// \param TheTriple This argument is used to determine the target machine
344 /// either the target triple from the module, or the target triple of the
346 /// \param CPU This specifies the name of the target CPU.
348 /// additional target features.
356 /// createTargetMachine - Create a target specific machine implementation
359 /// \param TT This argument is used to determine the target machine
361 /// either the target triple from the module, or the target triple of the
376 /// createMCAsmBackend - Create a target specific assembly parser.
378 /// \param TheTriple The target triple string.
388 /// createMCAsmParser - Create a target specific assembly parser.
390 /// \param Parser The target independent parser implementation to use for
401 /// createAsmPrinter - Create a target specific assembly printer pass. This
426 /// createMCCodeEmitter - Create a target specific code emitter.
435 /// Create a target specific MCStreamer.
437 /// \param T The target triple.
438 /// \param Ctx The target context.
439 /// \param TAB The target assembler backend object. Takes ownership.
441 /// \param Emitter The target independent assembler object.Takes ownership.
523 /// createMCRelocationInfo - Create a target specific MCRelocationInfo.
525 /// \param TT The target triple.
526 /// \param Ctx The target context.
534 /// createMCSymbolizer - Create a target specific MCSymbolizer.
536 /// \param TT The target triple.
543 /// \param Ctx The target context.
544 /// \param RelInfo The relocation information for this target. Takes
560 /// TargetRegistry - Generic interface to target specific features.
563 // functions into Target (currently they all just set members on the Target
564 // anyway, and Target friends this class so those functions can...
569 : public std::iterator<std::forward_iterator_tag, Target, ptrdiff_t> {
572 const Target *Current = nullptr;
574 explicit iterator(Target *T) : Current(T) {}
594 const Target &operator*() const {
599 const Target *operator->() const { return &operator*(); }
611 /// lookupTarget - Lookup a target based on a target triple.
613 /// \param Triple - The triple to use for finding a target.
614 /// \param Error - On failure, an error string describing why no target was
616 static const Target *lookupTarget(const std::string &Triple,
619 /// lookupTarget - Lookup a target based on an architecture name
620 /// and a target triple. If the architecture name is non-empty,
621 /// then the lookup is done by architecture. Otherwise, the target
624 /// \param ArchName - The architecture to use for finding a target.
625 /// \param TheTriple - The triple to use for finding a target. The
628 /// \param Error - On failure, an error string describing why no target was
630 static const Target *lookupTarget(const std::string &ArchName,
634 /// @name Target Registration
637 /// RegisterTarget - Register the given target. Attempts to register a
638 /// target which has already been registered will be ignored.
644 /// @param T - The target being registered.
645 /// @param Name - The target name. This should be a static string.
646 /// @param ShortDesc - A short target description. This should be a static
648 /// @param ArchMatchFn - The arch match checking function for this target.
649 /// @param HasJIT - Whether the target supports JIT code
651 static void RegisterTarget(Target &T, const char *Name, const char *ShortDesc,
652 Target::ArchMatchFnTy ArchMatchFn,
656 /// given target.
662 /// @param T - The target being registered.
663 /// @param Fn - A function to construct a MCAsmInfo for the target.
664 static void RegisterMCAsmInfo(Target &T, Target::MCAsmInfoCtorFnTy Fn) {
669 /// given target.
675 /// @param T - The target being registered.
676 /// @param Fn - A function to construct a MCInstrInfo for the target.
677 static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn) {
682 /// the given target.
683 static void RegisterMCInstrAnalysis(Target &T,
684 Target::MCInstrAnalysisCtorFnTy Fn) {
689 /// given target.
695 /// @param T - The target being registered.
696 /// @param Fn - A function to construct a MCRegisterInfo for the target.
697 static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn) {
702 /// the given target.
708 /// @param T - The target being registered.
709 /// @param Fn - A function to construct a MCSubtargetInfo for the target.
710 static void RegisterMCSubtargetInfo(Target &T,
711 Target::MCSubtargetInfoCtorFnTy Fn) {
716 /// given target.
722 /// @param T - The target being registered.
723 /// @param Fn - A function to construct a TargetMachine for the target.
724 static void RegisterTargetMachine(Target &T, Target::TargetMachineCtorTy Fn) {
729 /// given target.
735 /// @param T - The target being registered.
736 /// @param Fn - A function to construct an AsmBackend for the target.
737 static void RegisterMCAsmBackend(Target &T, Target::MCAsmBackendCtorTy Fn) {
742 /// the given target.
748 /// @param T - The target being registered.
749 /// @param Fn - A function to construct an MCTargetAsmParser for the target.
750 static void RegisterMCAsmParser(Target &T, Target::MCAsmParserCtorTy Fn) {
755 /// target.
761 /// @param T - The target being registered.
762 /// @param Fn - A function to construct an AsmPrinter for the target.
763 static void RegisterAsmPrinter(Target &T, Target::AsmPrinterCtorTy Fn) {
768 /// the given target.
774 /// @param T - The target being registered.
775 /// @param Fn - A function to construct an MCDisassembler for the target.
776 static void RegisterMCDisassembler(Target &T,
777 Target::MCDisassemblerCtorTy Fn) {
782 /// given target.
788 /// @param T - The target being registered.
789 /// @param Fn - A function to construct an MCInstPrinter for the target.
790 static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn) {
795 /// given target.
801 /// @param T - The target being registered.
802 /// @param Fn - A function to construct an MCCodeEmitter for the target.
803 static void RegisterMCCodeEmitter(Target &T, Target::MCCodeEmitterCtorTy Fn) {
807 static void RegisterCOFFStreamer(Target &T, Target::COFFStreamerCtorTy Fn) {
811 static void RegisterMachOStreamer(Target &T, Target::MachOStreamerCtorTy Fn) {
815 static void RegisterELFStreamer(Target &T, Target::ELFStreamerCtorTy Fn) {
819 static void RegisterWasmStreamer(Target &T, Target::WasmStreamerCtorTy Fn) {
823 static void RegisterNullTargetStreamer(Target &T,
824 Target::NullTargetStreamerCtorTy Fn) {
828 static void RegisterAsmTargetStreamer(Target &T,
829 Target::AsmTargetStreamerCtorTy Fn) {
834 RegisterObjectTargetStreamer(Target &T,
835 Target::ObjectTargetStreamerCtorTy Fn) {
840 /// implementation for the given target.
846 /// @param T - The target being registered.
847 /// @param Fn - A function to construct an MCRelocationInfo for the target.
848 static void RegisterMCRelocationInfo(Target &T,
849 Target::MCRelocationInfoCtorTy Fn) {
854 /// implementation for the given target.
860 /// @param T - The target being registered.
861 /// @param Fn - A function to construct an MCSymbolizer for the target.
862 static void RegisterMCSymbolizer(Target &T, Target::MCSymbolizerCtorTy Fn) {
871 /// RegisterTarget - Helper template for registering a target, for use in the
872 /// target's initialization function. Usage:
875 /// Target &getTheFooTarget() { // The global target instance.
876 /// static Target TheFooTarget;
886 RegisterTarget(Target &T, const char *Name, const char *Desc) {
895 /// RegisterMCAsmInfo - Helper template for registering a target assembly info
900 /// extern Target TheFooTarget;
904 RegisterMCAsmInfo(Target &T) {
915 /// RegisterMCAsmInfoFn - Helper template for registering a target assembly info
920 /// extern Target TheFooTarget;
924 RegisterMCAsmInfoFn(Target &T, Target::MCAsmInfoCtorFnTy Fn) {
929 /// RegisterMCInstrInfo - Helper template for registering a target instruction
934 /// extern Target TheFooTarget;
938 RegisterMCInstrInfo(Target &T) {
946 /// RegisterMCInstrInfoFn - Helper template for registering a target
951 /// extern Target TheFooTarget;
955 RegisterMCInstrInfoFn(Target &T, Target::MCInstrInfoCtorFnTy Fn) {
960 /// RegisterMCInstrAnalysis - Helper template for registering a target
965 /// extern Target TheFooTarget;
969 RegisterMCInstrAnalysis(Target &T) {
979 /// RegisterMCInstrAnalysisFn - Helper template for registering a target
984 /// extern Target TheFooTarget;
988 RegisterMCInstrAnalysisFn(Target &T, Target::MCInstrAnalysisCtorFnTy Fn) {
993 /// RegisterMCRegInfo - Helper template for registering a target register info
998 /// extern Target TheFooTarget;
1002 RegisterMCRegInfo(Target &T) {
1012 /// RegisterMCRegInfoFn - Helper template for registering a target register
1017 /// extern Target TheFooTarget;
1021 RegisterMCRegInfoFn(Target &T, Target::MCRegInfoCtorFnTy Fn) {
1026 /// RegisterMCSubtargetInfo - Helper template for registering a target
1031 /// extern Target TheFooTarget;
1035 RegisterMCSubtargetInfo(Target &T) {
1046 /// RegisterMCSubtargetInfoFn - Helper template for registering a target
1051 /// extern Target TheFooTarget;
1055 RegisterMCSubtargetInfoFn(Target &T, Target::MCSubtargetInfoCtorFnTy Fn) {
1060 /// RegisterTargetMachine - Helper template for registering a target machine
1061 /// implementation, for use in the target machine initialization
1065 /// extern Target TheFooTarget;
1069 RegisterTargetMachine(Target &T) {
1075 Allocator(const Target &T, const Triple &TT, StringRef CPU, StringRef FS,
1082 /// RegisterMCAsmBackend - Helper template for registering a target specific
1086 /// extern Target TheFooTarget;
1090 RegisterMCAsmBackend(Target &T) {
1095 static MCAsmBackend *Allocator(const Target &T, const MCRegisterInfo &MRI,
1102 /// RegisterMCAsmParser - Helper template for registering a target specific
1103 /// assembly parser, for use in the target machine initialization
1107 /// extern Target TheFooTarget;
1111 RegisterMCAsmParser(Target &T) {
1123 /// RegisterAsmPrinter - Helper template for registering a target specific
1124 /// assembly printer, for use in the target machine initialization
1128 /// extern Target TheFooTarget;
1132 RegisterAsmPrinter(Target &T) {
1143 /// RegisterMCCodeEmitter - Helper template for registering a target specific
1144 /// machine code emitter, for use in the target initialization
1148 /// extern Target TheFooTarget;
1152 RegisterMCCodeEmitter(Target &T) {