LLVM  13.0.0git
TargetRegistry.h
Go to the documentation of this file.
1 //===- Support/TargetRegistry.h - Target Registration -----------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file exposes the TargetRegistry interface, which tools can use to access
10 // the appropriate target specific classes (TargetMachine, AsmPrinter, etc.)
11 // which have been registered.
12 //
13 // Target specific class implementations should register themselves using the
14 // appropriate TargetRegistry interfaces.
15 //
16 //===----------------------------------------------------------------------===//
17 
18 #ifndef LLVM_SUPPORT_TARGETREGISTRY_H
19 #define LLVM_SUPPORT_TARGETREGISTRY_H
20 
22 #include "llvm/ADT/Optional.h"
23 #include "llvm/ADT/StringRef.h"
24 #include "llvm/ADT/Triple.h"
26 #include "llvm/Support/CodeGen.h"
29 #include <algorithm>
30 #include <cassert>
31 #include <cstddef>
32 #include <iterator>
33 #include <memory>
34 #include <string>
35 
36 namespace llvm {
37 
38 class AsmPrinter;
39 class MCAsmBackend;
40 class MCAsmInfo;
41 class MCAsmParser;
42 class MCCodeEmitter;
43 class MCContext;
44 class MCDisassembler;
45 class MCInstPrinter;
46 class MCInstrAnalysis;
47 class MCInstrInfo;
48 class MCObjectWriter;
49 class MCRegisterInfo;
50 class MCRelocationInfo;
51 class MCStreamer;
52 class MCSubtargetInfo;
53 class MCSymbolizer;
54 class MCTargetAsmParser;
55 class MCTargetOptions;
56 class MCTargetStreamer;
57 class raw_ostream;
58 class raw_pwrite_stream;
59 class TargetMachine;
60 class TargetOptions;
61 
62 MCStreamer *createNullStreamer(MCContext &Ctx);
63 // Takes ownership of \p TAB and \p CE.
64 
65 /// Create a machine code streamer which will print out assembly for the native
66 /// target, suitable for compiling with a native assembler.
67 ///
68 /// \param InstPrint - If given, the instruction printer to use. If not given
69 /// the MCInst representation will be printed. This method takes ownership of
70 /// InstPrint.
71 ///
72 /// \param CE - If given, a code emitter to use to show the instruction
73 /// encoding inline with the assembly. This method takes ownership of \p CE.
74 ///
75 /// \param TAB - If given, a target asm backend to use to show the fixup
76 /// information in conjunction with encoding information. This method takes
77 /// ownership of \p TAB.
78 ///
79 /// \param ShowInst - Whether to show the MCInst representation inline with
80 /// the assembly.
81 MCStreamer *
82 createAsmStreamer(MCContext &Ctx, std::unique_ptr<formatted_raw_ostream> OS,
83  bool isVerboseAsm, bool useDwarfDirectory,
84  MCInstPrinter *InstPrint, std::unique_ptr<MCCodeEmitter> &&CE,
85  std::unique_ptr<MCAsmBackend> &&TAB, bool ShowInst);
86 
87 MCStreamer *createELFStreamer(MCContext &Ctx,
88  std::unique_ptr<MCAsmBackend> &&TAB,
89  std::unique_ptr<MCObjectWriter> &&OW,
90  std::unique_ptr<MCCodeEmitter> &&CE,
91  bool RelaxAll);
92 MCStreamer *createMachOStreamer(MCContext &Ctx,
93  std::unique_ptr<MCAsmBackend> &&TAB,
94  std::unique_ptr<MCObjectWriter> &&OW,
95  std::unique_ptr<MCCodeEmitter> &&CE,
96  bool RelaxAll, bool DWARFMustBeAtTheEnd,
97  bool LabelSections = false);
98 MCStreamer *createWasmStreamer(MCContext &Ctx,
99  std::unique_ptr<MCAsmBackend> &&TAB,
100  std::unique_ptr<MCObjectWriter> &&OW,
101  std::unique_ptr<MCCodeEmitter> &&CE,
102  bool RelaxAll);
103 MCStreamer *createXCOFFStreamer(MCContext &Ctx,
104  std::unique_ptr<MCAsmBackend> &&TAB,
105  std::unique_ptr<MCObjectWriter> &&OW,
106  std::unique_ptr<MCCodeEmitter> &&CE,
107  bool RelaxAll);
108 
109 MCRelocationInfo *createMCRelocationInfo(const Triple &TT, MCContext &Ctx);
110 
111 MCSymbolizer *createMCSymbolizer(const Triple &TT, LLVMOpInfoCallback GetOpInfo,
112  LLVMSymbolLookupCallback SymbolLookUp,
113  void *DisInfo, MCContext *Ctx,
114  std::unique_ptr<MCRelocationInfo> &&RelInfo);
115 
116 /// Target - Wrapper for Target specific information.
117 ///
118 /// For registration purposes, this is a POD type so that targets can be
119 /// registered without the use of static constructors.
120 ///
121 /// Targets should implement a single global instance of this class (which
122 /// will be zero initialized), and pass that instance to the TargetRegistry as
123 /// part of their initialization.
124 class Target {
125 public:
126  friend struct TargetRegistry;
127 
128  using ArchMatchFnTy = bool (*)(Triple::ArchType Arch);
129 
130  using MCAsmInfoCtorFnTy = MCAsmInfo *(*)(const MCRegisterInfo &MRI,
131  const Triple &TT,
132  const MCTargetOptions &Options);
135  using MCRegInfoCtorFnTy = MCRegisterInfo *(*)(const Triple &TT);
136  using MCSubtargetInfoCtorFnTy = MCSubtargetInfo *(*)(const Triple &TT,
137  StringRef CPU,
138  StringRef Features);
140  *(*)(const Target &T, const Triple &TT, StringRef CPU, StringRef Features,
141  const TargetOptions &Options, Optional<Reloc::Model> RM,
143  // If it weren't for layering issues (this header is in llvm/Support, but
144  // depends on MC?) this should take the Streamer by value rather than rvalue
145  // reference.
146  using AsmPrinterCtorTy = AsmPrinter *(*)(
147  TargetMachine &TM, std::unique_ptr<MCStreamer> &&Streamer);
148  using MCAsmBackendCtorTy = MCAsmBackend *(*)(const Target &T,
149  const MCSubtargetInfo &STI,
150  const MCRegisterInfo &MRI,
151  const MCTargetOptions &Options);
153  const MCSubtargetInfo &STI, MCAsmParser &P, const MCInstrInfo &MII,
154  const MCTargetOptions &Options);
155  using MCDisassemblerCtorTy = MCDisassembler *(*)(const Target &T,
156  const MCSubtargetInfo &STI,
157  MCContext &Ctx);
158  using MCInstPrinterCtorTy = MCInstPrinter *(*)(const Triple &T,
159  unsigned SyntaxVariant,
160  const MCAsmInfo &MAI,
161  const MCInstrInfo &MII,
163  using MCCodeEmitterCtorTy = MCCodeEmitter *(*)(const MCInstrInfo &II,
164  const MCRegisterInfo &MRI,
165  MCContext &Ctx);
166  using ELFStreamerCtorTy =
167  MCStreamer *(*)(const Triple &T, MCContext &Ctx,
168  std::unique_ptr<MCAsmBackend> &&TAB,
169  std::unique_ptr<MCObjectWriter> &&OW,
170  std::unique_ptr<MCCodeEmitter> &&Emitter, bool RelaxAll);
171  using MachOStreamerCtorTy =
172  MCStreamer *(*)(MCContext &Ctx, std::unique_ptr<MCAsmBackend> &&TAB,
173  std::unique_ptr<MCObjectWriter> &&OW,
174  std::unique_ptr<MCCodeEmitter> &&Emitter, bool RelaxAll,
175  bool DWARFMustBeAtTheEnd);
176  using COFFStreamerCtorTy =
177  MCStreamer *(*)(MCContext &Ctx, std::unique_ptr<MCAsmBackend> &&TAB,
178  std::unique_ptr<MCObjectWriter> &&OW,
179  std::unique_ptr<MCCodeEmitter> &&Emitter, bool RelaxAll,
180  bool IncrementalLinkerCompatible);
181  using WasmStreamerCtorTy =
182  MCStreamer *(*)(const Triple &T, MCContext &Ctx,
183  std::unique_ptr<MCAsmBackend> &&TAB,
184  std::unique_ptr<MCObjectWriter> &&OW,
185  std::unique_ptr<MCCodeEmitter> &&Emitter, bool RelaxAll);
189  bool IsVerboseAsm);
191  MCStreamer &S, const MCSubtargetInfo &STI);
192  using MCRelocationInfoCtorTy = MCRelocationInfo *(*)(const Triple &TT,
193  MCContext &Ctx);
194  using MCSymbolizerCtorTy = MCSymbolizer *(*)(
195  const Triple &TT, LLVMOpInfoCallback GetOpInfo,
196  LLVMSymbolLookupCallback SymbolLookUp, void *DisInfo, MCContext *Ctx,
197  std::unique_ptr<MCRelocationInfo> &&RelInfo);
198 
199 private:
200  /// Next - The next registered target in the linked list, maintained by the
201  /// TargetRegistry.
202  Target *Next;
203 
204  /// The target function for checking if an architecture is supported.
205  ArchMatchFnTy ArchMatchFn;
206 
207  /// Name - The target name.
208  const char *Name;
209 
210  /// ShortDesc - A short description of the target.
211  const char *ShortDesc;
212 
213  /// BackendName - The name of the backend implementation. This must match the
214  /// name of the 'def X : Target ...' in TableGen.
215  const char *BackendName;
216 
217  /// HasJIT - Whether this target supports the JIT.
218  bool HasJIT;
219 
220  /// MCAsmInfoCtorFn - Constructor function for this target's MCAsmInfo, if
221  /// registered.
222  MCAsmInfoCtorFnTy MCAsmInfoCtorFn;
223 
224  /// MCInstrInfoCtorFn - Constructor function for this target's MCInstrInfo,
225  /// if registered.
226  MCInstrInfoCtorFnTy MCInstrInfoCtorFn;
227 
228  /// MCInstrAnalysisCtorFn - Constructor function for this target's
229  /// MCInstrAnalysis, if registered.
230  MCInstrAnalysisCtorFnTy MCInstrAnalysisCtorFn;
231 
232  /// MCRegInfoCtorFn - Constructor function for this target's MCRegisterInfo,
233  /// if registered.
234  MCRegInfoCtorFnTy MCRegInfoCtorFn;
235 
236  /// MCSubtargetInfoCtorFn - Constructor function for this target's
237  /// MCSubtargetInfo, if registered.
238  MCSubtargetInfoCtorFnTy MCSubtargetInfoCtorFn;
239 
240  /// TargetMachineCtorFn - Construction function for this target's
241  /// TargetMachine, if registered.
242  TargetMachineCtorTy TargetMachineCtorFn;
243 
244  /// MCAsmBackendCtorFn - Construction function for this target's
245  /// MCAsmBackend, if registered.
246  MCAsmBackendCtorTy MCAsmBackendCtorFn;
247 
248  /// MCAsmParserCtorFn - Construction function for this target's
249  /// MCTargetAsmParser, if registered.
250  MCAsmParserCtorTy MCAsmParserCtorFn;
251 
252  /// AsmPrinterCtorFn - Construction function for this target's AsmPrinter,
253  /// if registered.
254  AsmPrinterCtorTy AsmPrinterCtorFn;
255 
256  /// MCDisassemblerCtorFn - Construction function for this target's
257  /// MCDisassembler, if registered.
258  MCDisassemblerCtorTy MCDisassemblerCtorFn;
259 
260  /// MCInstPrinterCtorFn - Construction function for this target's
261  /// MCInstPrinter, if registered.
262  MCInstPrinterCtorTy MCInstPrinterCtorFn;
263 
264  /// MCCodeEmitterCtorFn - Construction function for this target's
265  /// CodeEmitter, if registered.
266  MCCodeEmitterCtorTy MCCodeEmitterCtorFn;
267 
268  // Construction functions for the various object formats, if registered.
269  COFFStreamerCtorTy COFFStreamerCtorFn = nullptr;
270  MachOStreamerCtorTy MachOStreamerCtorFn = nullptr;
271  ELFStreamerCtorTy ELFStreamerCtorFn = nullptr;
272  WasmStreamerCtorTy WasmStreamerCtorFn = nullptr;
273 
274  /// Construction function for this target's null TargetStreamer, if
275  /// registered (default = nullptr).
276  NullTargetStreamerCtorTy NullTargetStreamerCtorFn = nullptr;
277 
278  /// Construction function for this target's asm TargetStreamer, if
279  /// registered (default = nullptr).
280  AsmTargetStreamerCtorTy AsmTargetStreamerCtorFn = nullptr;
281 
282  /// Construction function for this target's obj TargetStreamer, if
283  /// registered (default = nullptr).
284  ObjectTargetStreamerCtorTy ObjectTargetStreamerCtorFn = nullptr;
285 
286  /// MCRelocationInfoCtorFn - Construction function for this target's
287  /// MCRelocationInfo, if registered (default = llvm::createMCRelocationInfo)
288  MCRelocationInfoCtorTy MCRelocationInfoCtorFn = nullptr;
289 
290  /// MCSymbolizerCtorFn - Construction function for this target's
291  /// MCSymbolizer, if registered (default = llvm::createMCSymbolizer)
292  MCSymbolizerCtorTy MCSymbolizerCtorFn = nullptr;
293 
294 public:
295  Target() = default;
296 
297  /// @name Target Information
298  /// @{
299 
300  // getNext - Return the next registered target.
301  const Target *getNext() const { return Next; }
302 
303  /// getName - Get the target name.
304  const char *getName() const { return Name; }
305 
306  /// getShortDescription - Get a short description of the target.
307  const char *getShortDescription() const { return ShortDesc; }
308 
309  /// getBackendName - Get the backend name.
310  const char *getBackendName() const { return BackendName; }
311 
312  /// @}
313  /// @name Feature Predicates
314  /// @{
315 
316  /// hasJIT - Check if this targets supports the just-in-time compilation.
317  bool hasJIT() const { return HasJIT; }
318 
319  /// hasTargetMachine - Check if this target supports code generation.
320  bool hasTargetMachine() const { return TargetMachineCtorFn != nullptr; }
321 
322  /// hasMCAsmBackend - Check if this target supports .o generation.
323  bool hasMCAsmBackend() const { return MCAsmBackendCtorFn != nullptr; }
324 
325  /// hasMCAsmParser - Check if this target supports assembly parsing.
326  bool hasMCAsmParser() const { return MCAsmParserCtorFn != nullptr; }
327 
328  /// @}
329  /// @name Feature Constructors
330  /// @{
331 
332  /// createMCAsmInfo - Create a MCAsmInfo implementation for the specified
333  /// target triple.
334  ///
335  /// \param TheTriple This argument is used to determine the target machine
336  /// feature set; it should always be provided. Generally this should be
337  /// either the target triple from the module, or the target triple of the
338  /// host if that does not exist.
340  const MCTargetOptions &Options) const {
341  if (!MCAsmInfoCtorFn)
342  return nullptr;
343  return MCAsmInfoCtorFn(MRI, Triple(TheTriple), Options);
344  }
345 
346  /// createMCInstrInfo - Create a MCInstrInfo implementation.
347  ///
349  if (!MCInstrInfoCtorFn)
350  return nullptr;
351  return MCInstrInfoCtorFn();
352  }
353 
354  /// createMCInstrAnalysis - Create a MCInstrAnalysis implementation.
355  ///
357  if (!MCInstrAnalysisCtorFn)
358  return nullptr;
359  return MCInstrAnalysisCtorFn(Info);
360  }
361 
362  /// createMCRegInfo - Create a MCRegisterInfo implementation.
363  ///
365  if (!MCRegInfoCtorFn)
366  return nullptr;
367  return MCRegInfoCtorFn(Triple(TT));
368  }
369 
370  /// createMCSubtargetInfo - Create a MCSubtargetInfo implementation.
371  ///
372  /// \param TheTriple This argument is used to determine the target machine
373  /// feature set; it should always be provided. Generally this should be
374  /// either the target triple from the module, or the target triple of the
375  /// host if that does not exist.
376  /// \param CPU This specifies the name of the target CPU.
377  /// \param Features This specifies the string representation of the
378  /// additional target features.
380  StringRef Features) const {
381  if (!MCSubtargetInfoCtorFn)
382  return nullptr;
383  return MCSubtargetInfoCtorFn(Triple(TheTriple), CPU, Features);
384  }
385 
386  /// createTargetMachine - Create a target specific machine implementation
387  /// for the specified \p Triple.
388  ///
389  /// \param TT This argument is used to determine the target machine
390  /// feature set; it should always be provided. Generally this should be
391  /// either the target triple from the module, or the target triple of the
392  /// host if that does not exist.
394  StringRef Features,
395  const TargetOptions &Options,
399  bool JIT = false) const {
400  if (!TargetMachineCtorFn)
401  return nullptr;
402  return TargetMachineCtorFn(*this, Triple(TT), CPU, Features, Options, RM,
403  CM, OL, JIT);
404  }
405 
406  /// createMCAsmBackend - Create a target specific assembly parser.
408  const MCRegisterInfo &MRI,
409  const MCTargetOptions &Options) const {
410  if (!MCAsmBackendCtorFn)
411  return nullptr;
412  return MCAsmBackendCtorFn(*this, STI, MRI, Options);
413  }
414 
415  /// createMCAsmParser - Create a target specific assembly parser.
416  ///
417  /// \param Parser The target independent parser implementation to use for
418  /// parsing and lexing.
420  MCAsmParser &Parser,
421  const MCInstrInfo &MII,
422  const MCTargetOptions &Options) const {
423  if (!MCAsmParserCtorFn)
424  return nullptr;
425  return MCAsmParserCtorFn(STI, Parser, MII, Options);
426  }
427 
428  /// createAsmPrinter - Create a target specific assembly printer pass. This
429  /// takes ownership of the MCStreamer object.
431  std::unique_ptr<MCStreamer> &&Streamer) const {
432  if (!AsmPrinterCtorFn)
433  return nullptr;
434  return AsmPrinterCtorFn(TM, std::move(Streamer));
435  }
436 
438  MCContext &Ctx) const {
439  if (!MCDisassemblerCtorFn)
440  return nullptr;
441  return MCDisassemblerCtorFn(*this, STI, Ctx);
442  }
443 
444  MCInstPrinter *createMCInstPrinter(const Triple &T, unsigned SyntaxVariant,
445  const MCAsmInfo &MAI,
446  const MCInstrInfo &MII,
447  const MCRegisterInfo &MRI) const {
448  if (!MCInstPrinterCtorFn)
449  return nullptr;
450  return MCInstPrinterCtorFn(T, SyntaxVariant, MAI, MII, MRI);
451  }
452 
453  /// createMCCodeEmitter - Create a target specific code emitter.
455  const MCRegisterInfo &MRI,
456  MCContext &Ctx) const {
457  if (!MCCodeEmitterCtorFn)
458  return nullptr;
459  return MCCodeEmitterCtorFn(II, MRI, Ctx);
460  }
461 
462  /// Create a target specific MCStreamer.
463  ///
464  /// \param T The target triple.
465  /// \param Ctx The target context.
466  /// \param TAB The target assembler backend object. Takes ownership.
467  /// \param OW The stream object.
468  /// \param Emitter The target independent assembler object.Takes ownership.
469  /// \param RelaxAll Relax all fixups?
471  std::unique_ptr<MCAsmBackend> &&TAB,
472  std::unique_ptr<MCObjectWriter> &&OW,
473  std::unique_ptr<MCCodeEmitter> &&Emitter,
474  const MCSubtargetInfo &STI, bool RelaxAll,
475  bool IncrementalLinkerCompatible,
476  bool DWARFMustBeAtTheEnd) const {
477  MCStreamer *S = nullptr;
478  switch (T.getObjectFormat()) {
480  llvm_unreachable("Unknown object format");
481  case Triple::COFF:
482  assert(T.isOSWindows() && "only Windows COFF is supported");
483  S = COFFStreamerCtorFn(Ctx, std::move(TAB), std::move(OW),
484  std::move(Emitter), RelaxAll,
485  IncrementalLinkerCompatible);
486  break;
487  case Triple::MachO:
488  if (MachOStreamerCtorFn)
489  S = MachOStreamerCtorFn(Ctx, std::move(TAB), std::move(OW),
490  std::move(Emitter), RelaxAll,
491  DWARFMustBeAtTheEnd);
492  else
493  S = createMachOStreamer(Ctx, std::move(TAB), std::move(OW),
494  std::move(Emitter), RelaxAll,
495  DWARFMustBeAtTheEnd);
496  break;
497  case Triple::ELF:
498  if (ELFStreamerCtorFn)
499  S = ELFStreamerCtorFn(T, Ctx, std::move(TAB), std::move(OW),
500  std::move(Emitter), RelaxAll);
501  else
502  S = createELFStreamer(Ctx, std::move(TAB), std::move(OW),
503  std::move(Emitter), RelaxAll);
504  break;
505  case Triple::Wasm:
506  if (WasmStreamerCtorFn)
507  S = WasmStreamerCtorFn(T, Ctx, std::move(TAB), std::move(OW),
508  std::move(Emitter), RelaxAll);
509  else
510  S = createWasmStreamer(Ctx, std::move(TAB), std::move(OW),
511  std::move(Emitter), RelaxAll);
512  break;
513  case Triple::GOFF:
514  report_fatal_error("GOFF MCObjectStreamer not implemented yet");
515  case Triple::XCOFF:
516  S = createXCOFFStreamer(Ctx, std::move(TAB), std::move(OW),
517  std::move(Emitter), RelaxAll);
518  break;
519  }
520  if (ObjectTargetStreamerCtorFn)
521  ObjectTargetStreamerCtorFn(*S, STI);
522  return S;
523  }
524 
526  std::unique_ptr<formatted_raw_ostream> OS,
527  bool IsVerboseAsm, bool UseDwarfDirectory,
528  MCInstPrinter *InstPrint,
529  std::unique_ptr<MCCodeEmitter> &&CE,
530  std::unique_ptr<MCAsmBackend> &&TAB,
531  bool ShowInst) const {
532  formatted_raw_ostream &OSRef = *OS;
534  Ctx, std::move(OS), IsVerboseAsm, UseDwarfDirectory, InstPrint,
535  std::move(CE), std::move(TAB), ShowInst);
536  createAsmTargetStreamer(*S, OSRef, InstPrint, IsVerboseAsm);
537  return S;
538  }
539 
542  MCInstPrinter *InstPrint,
543  bool IsVerboseAsm) const {
544  if (AsmTargetStreamerCtorFn)
545  return AsmTargetStreamerCtorFn(S, OS, InstPrint, IsVerboseAsm);
546  return nullptr;
547  }
548 
552  return S;
553  }
554 
556  if (NullTargetStreamerCtorFn)
557  return NullTargetStreamerCtorFn(S);
558  return nullptr;
559  }
560 
561  /// createMCRelocationInfo - Create a target specific MCRelocationInfo.
562  ///
563  /// \param TT The target triple.
564  /// \param Ctx The target context.
566  MCRelocationInfoCtorTy Fn = MCRelocationInfoCtorFn
567  ? MCRelocationInfoCtorFn
569  return Fn(Triple(TT), Ctx);
570  }
571 
572  /// createMCSymbolizer - Create a target specific MCSymbolizer.
573  ///
574  /// \param TT The target triple.
575  /// \param GetOpInfo The function to get the symbolic information for
576  /// operands.
577  /// \param SymbolLookUp The function to lookup a symbol name.
578  /// \param DisInfo The pointer to the block of symbolic information for above
579  /// call
580  /// back.
581  /// \param Ctx The target context.
582  /// \param RelInfo The relocation information for this target. Takes
583  /// ownership.
584  MCSymbolizer *
586  LLVMSymbolLookupCallback SymbolLookUp, void *DisInfo,
587  MCContext *Ctx,
588  std::unique_ptr<MCRelocationInfo> &&RelInfo) const {
589  MCSymbolizerCtorTy Fn =
590  MCSymbolizerCtorFn ? MCSymbolizerCtorFn : llvm::createMCSymbolizer;
591  return Fn(Triple(TT), GetOpInfo, SymbolLookUp, DisInfo, Ctx,
592  std::move(RelInfo));
593  }
594 
595  /// @}
596 };
597 
598 /// TargetRegistry - Generic interface to target specific features.
600  // FIXME: Make this a namespace, probably just move all the Register*
601  // functions into Target (currently they all just set members on the Target
602  // anyway, and Target friends this class so those functions can...
603  // function).
604  TargetRegistry() = delete;
605 
606  class iterator {
607  friend struct TargetRegistry;
608 
609  const Target *Current = nullptr;
610 
611  explicit iterator(Target *T) : Current(T) {}
612 
613  public:
614  using iterator_category = std::forward_iterator_tag;
616  using difference_type = std::ptrdiff_t;
617  using pointer = value_type *;
619 
620  iterator() = default;
621 
622  bool operator==(const iterator &x) const { return Current == x.Current; }
623  bool operator!=(const iterator &x) const { return !operator==(x); }
624 
625  // Iterator traversal: forward iteration only
626  iterator &operator++() { // Preincrement
627  assert(Current && "Cannot increment end iterator!");
628  Current = Current->getNext();
629  return *this;
630  }
631  iterator operator++(int) { // Postincrement
632  iterator tmp = *this;
633  ++*this;
634  return tmp;
635  }
636 
637  const Target &operator*() const {
638  assert(Current && "Cannot dereference end iterator!");
639  return *Current;
640  }
641 
642  const Target *operator->() const { return &operator*(); }
643  };
644 
645  /// printRegisteredTargetsForVersion - Print the registered targets
646  /// appropriately for inclusion in a tool's version output.
648 
649  /// @name Registry Access
650  /// @{
651 
653 
654  /// lookupTarget - Lookup a target based on a target triple.
655  ///
656  /// \param Triple - The triple to use for finding a target.
657  /// \param Error - On failure, an error string describing why no target was
658  /// found.
659  static const Target *lookupTarget(const std::string &Triple,
660  std::string &Error);
661 
662  /// lookupTarget - Lookup a target based on an architecture name
663  /// and a target triple. If the architecture name is non-empty,
664  /// then the lookup is done by architecture. Otherwise, the target
665  /// triple is used.
666  ///
667  /// \param ArchName - The architecture to use for finding a target.
668  /// \param TheTriple - The triple to use for finding a target. The
669  /// triple is updated with canonical architecture name if a lookup
670  /// by architecture is done.
671  /// \param Error - On failure, an error string describing why no target was
672  /// found.
673  static const Target *lookupTarget(const std::string &ArchName,
674  Triple &TheTriple, std::string &Error);
675 
676  /// @}
677  /// @name Target Registration
678  /// @{
679 
680  /// RegisterTarget - Register the given target. Attempts to register a
681  /// target which has already been registered will be ignored.
682  ///
683  /// Clients are responsible for ensuring that registration doesn't occur
684  /// while another thread is attempting to access the registry. Typically
685  /// this is done by initializing all targets at program startup.
686  ///
687  /// @param T - The target being registered.
688  /// @param Name - The target name. This should be a static string.
689  /// @param ShortDesc - A short target description. This should be a static
690  /// string.
691  /// @param BackendName - The name of the backend. This should be a static
692  /// string that is the same for all targets that share a backend
693  /// implementation and must match the name used in the 'def X : Target ...' in
694  /// TableGen.
695  /// @param ArchMatchFn - The arch match checking function for this target.
696  /// @param HasJIT - Whether the target supports JIT code
697  /// generation.
698  static void RegisterTarget(Target &T, const char *Name, const char *ShortDesc,
699  const char *BackendName,
700  Target::ArchMatchFnTy ArchMatchFn,
701  bool HasJIT = false);
702 
703  /// RegisterMCAsmInfo - Register a MCAsmInfo implementation for the
704  /// given target.
705  ///
706  /// Clients are responsible for ensuring that registration doesn't occur
707  /// while another thread is attempting to access the registry. Typically
708  /// this is done by initializing all targets at program startup.
709  ///
710  /// @param T - The target being registered.
711  /// @param Fn - A function to construct a MCAsmInfo for the target.
713  T.MCAsmInfoCtorFn = Fn;
714  }
715 
716  /// RegisterMCInstrInfo - Register a MCInstrInfo implementation for the
717  /// given target.
718  ///
719  /// Clients are responsible for ensuring that registration doesn't occur
720  /// while another thread is attempting to access the registry. Typically
721  /// this is done by initializing all targets at program startup.
722  ///
723  /// @param T - The target being registered.
724  /// @param Fn - A function to construct a MCInstrInfo for the target.
726  T.MCInstrInfoCtorFn = Fn;
727  }
728 
729  /// RegisterMCInstrAnalysis - Register a MCInstrAnalysis implementation for
730  /// the given target.
733  T.MCInstrAnalysisCtorFn = Fn;
734  }
735 
736  /// RegisterMCRegInfo - Register a MCRegisterInfo implementation for the
737  /// given target.
738  ///
739  /// Clients are responsible for ensuring that registration doesn't occur
740  /// while another thread is attempting to access the registry. Typically
741  /// this is done by initializing all targets at program startup.
742  ///
743  /// @param T - The target being registered.
744  /// @param Fn - A function to construct a MCRegisterInfo for the target.
746  T.MCRegInfoCtorFn = Fn;
747  }
748 
749  /// RegisterMCSubtargetInfo - Register a MCSubtargetInfo implementation for
750  /// the given target.
751  ///
752  /// Clients are responsible for ensuring that registration doesn't occur
753  /// while another thread is attempting to access the registry. Typically
754  /// this is done by initializing all targets at program startup.
755  ///
756  /// @param T - The target being registered.
757  /// @param Fn - A function to construct a MCSubtargetInfo for the target.
760  T.MCSubtargetInfoCtorFn = Fn;
761  }
762 
763  /// RegisterTargetMachine - Register a TargetMachine implementation for the
764  /// given target.
765  ///
766  /// Clients are responsible for ensuring that registration doesn't occur
767  /// while another thread is attempting to access the registry. Typically
768  /// this is done by initializing all targets at program startup.
769  ///
770  /// @param T - The target being registered.
771  /// @param Fn - A function to construct a TargetMachine for the target.
773  T.TargetMachineCtorFn = Fn;
774  }
775 
776  /// RegisterMCAsmBackend - Register a MCAsmBackend implementation for the
777  /// given target.
778  ///
779  /// Clients are responsible for ensuring that registration doesn't occur
780  /// while another thread is attempting to access the registry. Typically
781  /// this is done by initializing all targets at program startup.
782  ///
783  /// @param T - The target being registered.
784  /// @param Fn - A function to construct an AsmBackend for the target.
786  T.MCAsmBackendCtorFn = Fn;
787  }
788 
789  /// RegisterMCAsmParser - Register a MCTargetAsmParser implementation for
790  /// the given target.
791  ///
792  /// Clients are responsible for ensuring that registration doesn't occur
793  /// while another thread is attempting to access the registry. Typically
794  /// this is done by initializing all targets at program startup.
795  ///
796  /// @param T - The target being registered.
797  /// @param Fn - A function to construct an MCTargetAsmParser for the target.
799  T.MCAsmParserCtorFn = Fn;
800  }
801 
802  /// RegisterAsmPrinter - Register an AsmPrinter implementation for the given
803  /// target.
804  ///
805  /// Clients are responsible for ensuring that registration doesn't occur
806  /// while another thread is attempting to access the registry. Typically
807  /// this is done by initializing all targets at program startup.
808  ///
809  /// @param T - The target being registered.
810  /// @param Fn - A function to construct an AsmPrinter for the target.
812  T.AsmPrinterCtorFn = Fn;
813  }
814 
815  /// RegisterMCDisassembler - Register a MCDisassembler implementation for
816  /// the given target.
817  ///
818  /// Clients are responsible for ensuring that registration doesn't occur
819  /// while another thread is attempting to access the registry. Typically
820  /// this is done by initializing all targets at program startup.
821  ///
822  /// @param T - The target being registered.
823  /// @param Fn - A function to construct an MCDisassembler for the target.
826  T.MCDisassemblerCtorFn = Fn;
827  }
828 
829  /// RegisterMCInstPrinter - Register a MCInstPrinter implementation for the
830  /// given target.
831  ///
832  /// Clients are responsible for ensuring that registration doesn't occur
833  /// while another thread is attempting to access the registry. Typically
834  /// this is done by initializing all targets at program startup.
835  ///
836  /// @param T - The target being registered.
837  /// @param Fn - A function to construct an MCInstPrinter for the target.
839  T.MCInstPrinterCtorFn = Fn;
840  }
841 
842  /// RegisterMCCodeEmitter - Register a MCCodeEmitter implementation for the
843  /// given target.
844  ///
845  /// Clients are responsible for ensuring that registration doesn't occur
846  /// while another thread is attempting to access the registry. Typically
847  /// this is done by initializing all targets at program startup.
848  ///
849  /// @param T - The target being registered.
850  /// @param Fn - A function to construct an MCCodeEmitter for the target.
852  T.MCCodeEmitterCtorFn = Fn;
853  }
854 
856  T.COFFStreamerCtorFn = Fn;
857  }
858 
860  T.MachOStreamerCtorFn = Fn;
861  }
862 
864  T.ELFStreamerCtorFn = Fn;
865  }
866 
868  T.WasmStreamerCtorFn = Fn;
869  }
870 
873  T.NullTargetStreamerCtorFn = Fn;
874  }
875 
878  T.AsmTargetStreamerCtorFn = Fn;
879  }
880 
881  static void
884  T.ObjectTargetStreamerCtorFn = Fn;
885  }
886 
887  /// RegisterMCRelocationInfo - Register an MCRelocationInfo
888  /// implementation for the given target.
889  ///
890  /// Clients are responsible for ensuring that registration doesn't occur
891  /// while another thread is attempting to access the registry. Typically
892  /// this is done by initializing all targets at program startup.
893  ///
894  /// @param T - The target being registered.
895  /// @param Fn - A function to construct an MCRelocationInfo for the target.
898  T.MCRelocationInfoCtorFn = Fn;
899  }
900 
901  /// RegisterMCSymbolizer - Register an MCSymbolizer
902  /// implementation for the given target.
903  ///
904  /// Clients are responsible for ensuring that registration doesn't occur
905  /// while another thread is attempting to access the registry. Typically
906  /// this is done by initializing all targets at program startup.
907  ///
908  /// @param T - The target being registered.
909  /// @param Fn - A function to construct an MCSymbolizer for the target.
911  T.MCSymbolizerCtorFn = Fn;
912  }
913 
914  /// @}
915 };
916 
917 //===--------------------------------------------------------------------===//
918 
919 /// RegisterTarget - Helper template for registering a target, for use in the
920 /// target's initialization function. Usage:
921 ///
922 ///
923 /// Target &getTheFooTarget() { // The global target instance.
924 /// static Target TheFooTarget;
925 /// return TheFooTarget;
926 /// }
927 /// extern "C" void LLVMInitializeFooTargetInfo() {
928 /// RegisterTarget<Triple::foo> X(getTheFooTarget(), "foo", "Foo
929 /// description", "Foo" /* Backend Name */);
930 /// }
931 template <Triple::ArchType TargetArchType = Triple::UnknownArch,
932  bool HasJIT = false>
934  RegisterTarget(Target &T, const char *Name, const char *Desc,
935  const char *BackendName) {
936  TargetRegistry::RegisterTarget(T, Name, Desc, BackendName, &getArchMatch,
937  HasJIT);
938  }
939 
940  static bool getArchMatch(Triple::ArchType Arch) {
941  return Arch == TargetArchType;
942  }
943 };
944 
945 /// RegisterMCAsmInfo - Helper template for registering a target assembly info
946 /// implementation. This invokes the static "Create" method on the class to
947 /// actually do the construction. Usage:
948 ///
949 /// extern "C" void LLVMInitializeFooTarget() {
950 /// extern Target TheFooTarget;
951 /// RegisterMCAsmInfo<FooMCAsmInfo> X(TheFooTarget);
952 /// }
953 template <class MCAsmInfoImpl> struct RegisterMCAsmInfo {
956  }
957 
958 private:
959  static MCAsmInfo *Allocator(const MCRegisterInfo & /*MRI*/, const Triple &TT,
960  const MCTargetOptions &Options) {
961  return new MCAsmInfoImpl(TT, Options);
962  }
963 };
964 
965 /// RegisterMCAsmInfoFn - Helper template for registering a target assembly info
966 /// implementation. This invokes the specified function to do the
967 /// construction. Usage:
968 ///
969 /// extern "C" void LLVMInitializeFooTarget() {
970 /// extern Target TheFooTarget;
971 /// RegisterMCAsmInfoFn X(TheFooTarget, TheFunction);
972 /// }
976  }
977 };
978 
979 /// RegisterMCInstrInfo - Helper template for registering a target instruction
980 /// info implementation. This invokes the static "Create" method on the class
981 /// to actually do the construction. Usage:
982 ///
983 /// extern "C" void LLVMInitializeFooTarget() {
984 /// extern Target TheFooTarget;
985 /// RegisterMCInstrInfo<FooMCInstrInfo> X(TheFooTarget);
986 /// }
987 template <class MCInstrInfoImpl> struct RegisterMCInstrInfo {
990  }
991 
992 private:
993  static MCInstrInfo *Allocator() { return new MCInstrInfoImpl(); }
994 };
995 
996 /// RegisterMCInstrInfoFn - Helper template for registering a target
997 /// instruction info implementation. This invokes the specified function to
998 /// do the construction. Usage:
999 ///
1000 /// extern "C" void LLVMInitializeFooTarget() {
1001 /// extern Target TheFooTarget;
1002 /// RegisterMCInstrInfoFn X(TheFooTarget, TheFunction);
1003 /// }
1007  }
1008 };
1009 
1010 /// RegisterMCInstrAnalysis - Helper template for registering a target
1011 /// instruction analyzer implementation. This invokes the static "Create"
1012 /// method on the class to actually do the construction. Usage:
1013 ///
1014 /// extern "C" void LLVMInitializeFooTarget() {
1015 /// extern Target TheFooTarget;
1016 /// RegisterMCInstrAnalysis<FooMCInstrAnalysis> X(TheFooTarget);
1017 /// }
1018 template <class MCInstrAnalysisImpl> struct RegisterMCInstrAnalysis {
1021  }
1022 
1023 private:
1024  static MCInstrAnalysis *Allocator(const MCInstrInfo *Info) {
1025  return new MCInstrAnalysisImpl(Info);
1026  }
1027 };
1028 
1029 /// RegisterMCInstrAnalysisFn - Helper template for registering a target
1030 /// instruction analyzer implementation. This invokes the specified function
1031 /// to do the construction. Usage:
1032 ///
1033 /// extern "C" void LLVMInitializeFooTarget() {
1034 /// extern Target TheFooTarget;
1035 /// RegisterMCInstrAnalysisFn X(TheFooTarget, TheFunction);
1036 /// }
1040  }
1041 };
1042 
1043 /// RegisterMCRegInfo - Helper template for registering a target register info
1044 /// implementation. This invokes the static "Create" method on the class to
1045 /// actually do the construction. Usage:
1046 ///
1047 /// extern "C" void LLVMInitializeFooTarget() {
1048 /// extern Target TheFooTarget;
1049 /// RegisterMCRegInfo<FooMCRegInfo> X(TheFooTarget);
1050 /// }
1051 template <class MCRegisterInfoImpl> struct RegisterMCRegInfo {
1053  TargetRegistry::RegisterMCRegInfo(T, &Allocator);
1054  }
1055 
1056 private:
1057  static MCRegisterInfo *Allocator(const Triple & /*TT*/) {
1058  return new MCRegisterInfoImpl();
1059  }
1060 };
1061 
1062 /// RegisterMCRegInfoFn - Helper template for registering a target register
1063 /// info implementation. This invokes the specified function to do the
1064 /// construction. Usage:
1065 ///
1066 /// extern "C" void LLVMInitializeFooTarget() {
1067 /// extern Target TheFooTarget;
1068 /// RegisterMCRegInfoFn X(TheFooTarget, TheFunction);
1069 /// }
1073  }
1074 };
1075 
1076 /// RegisterMCSubtargetInfo - Helper template for registering a target
1077 /// subtarget info implementation. This invokes the static "Create" method
1078 /// on the class to actually do the construction. Usage:
1079 ///
1080 /// extern "C" void LLVMInitializeFooTarget() {
1081 /// extern Target TheFooTarget;
1082 /// RegisterMCSubtargetInfo<FooMCSubtargetInfo> X(TheFooTarget);
1083 /// }
1084 template <class MCSubtargetInfoImpl> struct RegisterMCSubtargetInfo {
1087  }
1088 
1089 private:
1090  static MCSubtargetInfo *Allocator(const Triple & /*TT*/, StringRef /*CPU*/,
1091  StringRef /*FS*/) {
1092  return new MCSubtargetInfoImpl();
1093  }
1094 };
1095 
1096 /// RegisterMCSubtargetInfoFn - Helper template for registering a target
1097 /// subtarget info implementation. This invokes the specified function to
1098 /// do the construction. Usage:
1099 ///
1100 /// extern "C" void LLVMInitializeFooTarget() {
1101 /// extern Target TheFooTarget;
1102 /// RegisterMCSubtargetInfoFn X(TheFooTarget, TheFunction);
1103 /// }
1107  }
1108 };
1109 
1110 /// RegisterTargetMachine - Helper template for registering a target machine
1111 /// implementation, for use in the target machine initialization
1112 /// function. Usage:
1113 ///
1114 /// extern "C" void LLVMInitializeFooTarget() {
1115 /// extern Target TheFooTarget;
1116 /// RegisterTargetMachine<FooTargetMachine> X(TheFooTarget);
1117 /// }
1118 template <class TargetMachineImpl> struct RegisterTargetMachine {
1121  }
1122 
1123 private:
1124  static TargetMachine *
1125  Allocator(const Target &T, const Triple &TT, StringRef CPU, StringRef FS,
1126  const TargetOptions &Options, Optional<Reloc::Model> RM,
1128  return new TargetMachineImpl(T, TT, CPU, FS, Options, RM, CM, OL, JIT);
1129  }
1130 };
1131 
1132 /// RegisterMCAsmBackend - Helper template for registering a target specific
1133 /// assembler backend. Usage:
1134 ///
1135 /// extern "C" void LLVMInitializeFooMCAsmBackend() {
1136 /// extern Target TheFooTarget;
1137 /// RegisterMCAsmBackend<FooAsmLexer> X(TheFooTarget);
1138 /// }
1139 template <class MCAsmBackendImpl> struct RegisterMCAsmBackend {
1142  }
1143 
1144 private:
1145  static MCAsmBackend *Allocator(const Target &T, const MCSubtargetInfo &STI,
1146  const MCRegisterInfo &MRI,
1147  const MCTargetOptions &Options) {
1148  return new MCAsmBackendImpl(T, STI, MRI);
1149  }
1150 };
1151 
1152 /// RegisterMCAsmParser - Helper template for registering a target specific
1153 /// assembly parser, for use in the target machine initialization
1154 /// function. Usage:
1155 ///
1156 /// extern "C" void LLVMInitializeFooMCAsmParser() {
1157 /// extern Target TheFooTarget;
1158 /// RegisterMCAsmParser<FooAsmParser> X(TheFooTarget);
1159 /// }
1160 template <class MCAsmParserImpl> struct RegisterMCAsmParser {
1163  }
1164 
1165 private:
1166  static MCTargetAsmParser *Allocator(const MCSubtargetInfo &STI,
1167  MCAsmParser &P, const MCInstrInfo &MII,
1168  const MCTargetOptions &Options) {
1169  return new MCAsmParserImpl(STI, P, MII, Options);
1170  }
1171 };
1172 
1173 /// RegisterAsmPrinter - Helper template for registering a target specific
1174 /// assembly printer, for use in the target machine initialization
1175 /// function. Usage:
1176 ///
1177 /// extern "C" void LLVMInitializeFooAsmPrinter() {
1178 /// extern Target TheFooTarget;
1179 /// RegisterAsmPrinter<FooAsmPrinter> X(TheFooTarget);
1180 /// }
1181 template <class AsmPrinterImpl> struct RegisterAsmPrinter {
1184  }
1185 
1186 private:
1187  static AsmPrinter *Allocator(TargetMachine &TM,
1188  std::unique_ptr<MCStreamer> &&Streamer) {
1189  return new AsmPrinterImpl(TM, std::move(Streamer));
1190  }
1191 };
1192 
1193 /// RegisterMCCodeEmitter - Helper template for registering a target specific
1194 /// machine code emitter, for use in the target initialization
1195 /// function. Usage:
1196 ///
1197 /// extern "C" void LLVMInitializeFooMCCodeEmitter() {
1198 /// extern Target TheFooTarget;
1199 /// RegisterMCCodeEmitter<FooCodeEmitter> X(TheFooTarget);
1200 /// }
1201 template <class MCCodeEmitterImpl> struct RegisterMCCodeEmitter {
1204  }
1205 
1206 private:
1207  static MCCodeEmitter *Allocator(const MCInstrInfo & /*II*/,
1208  const MCRegisterInfo & /*MRI*/,
1209  MCContext & /*Ctx*/) {
1210  return new MCCodeEmitterImpl();
1211  }
1212 };
1213 
1214 } // end namespace llvm
1215 
1216 #endif // LLVM_SUPPORT_TARGETREGISTRY_H
llvm::Target::createMCObjectStreamer
MCStreamer * createMCObjectStreamer(const Triple &T, MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&Emitter, const MCSubtargetInfo &STI, bool RelaxAll, bool IncrementalLinkerCompatible, bool DWARFMustBeAtTheEnd) const
Create a target specific MCStreamer.
Definition: TargetRegistry.h:470
llvm::MCAsmParser
Generic assembler parser interface, for use by target specific assembly parsers.
Definition: MCAsmParser.h:123
llvm::Triple::Wasm
@ Wasm
Definition: Triple.h:238
llvm::Target::AsmPrinterCtorTy
AsmPrinter *(*)(TargetMachine &TM, std::unique_ptr< MCStreamer > &&Streamer) AsmPrinterCtorTy
Definition: TargetRegistry.h:147
llvm::RegisterMCAsmInfo::RegisterMCAsmInfo
RegisterMCAsmInfo(Target &T)
Definition: TargetRegistry.h:954
llvm
Definition: AllocatorList.h:23
llvm::TargetRegistry::iterator::difference_type
std::ptrdiff_t difference_type
Definition: TargetRegistry.h:616
llvm::SystemZISD::TM
@ TM
Definition: SystemZISelLowering.h:65
Optional.h
llvm::RegisterMCCodeEmitter::RegisterMCCodeEmitter
RegisterMCCodeEmitter(Target &T)
Definition: TargetRegistry.h:1202
llvm::Triple::UnknownArch
@ UnknownArch
Definition: Triple.h:48
llvm::Target::MCAsmInfoCtorFnTy
MCAsmInfo *(*)(const MCRegisterInfo &MRI, const Triple &TT, const MCTargetOptions &Options) MCAsmInfoCtorFnTy
Definition: TargetRegistry.h:132
llvm::RegisterMCAsmBackend
RegisterMCAsmBackend - Helper template for registering a target specific assembler backend.
Definition: TargetRegistry.h:1139
llvm::RegisterMCInstrInfoFn
RegisterMCInstrInfoFn - Helper template for registering a target instruction info implementation.
Definition: TargetRegistry.h:1004
llvm::TargetOptions
Definition: TargetOptions.h:123
llvm::Target::WasmStreamerCtorTy
MCStreamer *(*)(const Triple &T, MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&Emitter, bool RelaxAll) WasmStreamerCtorTy
Definition: TargetRegistry.h:185
llvm::MCContext
Context object for machine code objects.
Definition: MCContext.h:71
StringRef.h
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
llvm::Target::MCInstrAnalysisCtorFnTy
MCInstrAnalysis *(*)(const MCInstrInfo *Info) MCInstrAnalysisCtorFnTy
Definition: TargetRegistry.h:134
llvm::Target::MCRelocationInfoCtorTy
MCRelocationInfo *(*)(const Triple &TT, MCContext &Ctx) MCRelocationInfoCtorTy
Definition: TargetRegistry.h:193
llvm::Target::createNullTargetStreamer
MCTargetStreamer * createNullTargetStreamer(MCStreamer &S) const
Definition: TargetRegistry.h:555
llvm::MCAsmInfo
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
llvm::Target
Target - Wrapper for Target specific information.
Definition: TargetRegistry.h:124
llvm::MCRelocationInfo
Create MCExprs from relocations found in an object file.
Definition: MCRelocationInfo.h:24
llvm::Target::createMCAsmInfo
MCAsmInfo * createMCAsmInfo(const MCRegisterInfo &MRI, StringRef TheTriple, const MCTargetOptions &Options) const
createMCAsmInfo - Create a MCAsmInfo implementation for the specified target triple.
Definition: TargetRegistry.h:339
ErrorHandling.h
llvm::Target::MCSubtargetInfoCtorFnTy
MCSubtargetInfo *(*)(const Triple &TT, StringRef CPU, StringRef Features) MCSubtargetInfoCtorFnTy
Definition: TargetRegistry.h:138
llvm::Target::MCSymbolizerCtorTy
MCSymbolizer *(*)(const Triple &TT, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp, void *DisInfo, MCContext *Ctx, std::unique_ptr< MCRelocationInfo > &&RelInfo) MCSymbolizerCtorTy
Definition: TargetRegistry.h:197
llvm::TargetRegistry::RegisterAsmTargetStreamer
static void RegisterAsmTargetStreamer(Target &T, Target::AsmTargetStreamerCtorTy Fn)
Definition: TargetRegistry.h:876
llvm::TargetRegistry::RegisterWasmStreamer
static void RegisterWasmStreamer(Target &T, Target::WasmStreamerCtorTy Fn)
Definition: TargetRegistry.h:867
llvm::TargetRegistry::RegisterMCInstrAnalysis
static void RegisterMCInstrAnalysis(Target &T, Target::MCInstrAnalysisCtorFnTy Fn)
RegisterMCInstrAnalysis - Register a MCInstrAnalysis implementation for the given target.
Definition: TargetRegistry.h:731
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
llvm::Target::COFFStreamerCtorTy
MCStreamer *(*)(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&Emitter, bool RelaxAll, bool IncrementalLinkerCompatible) COFFStreamerCtorTy
Definition: TargetRegistry.h:180
llvm::RegisterMCInstrAnalysis::RegisterMCInstrAnalysis
RegisterMCInstrAnalysis(Target &T)
Definition: TargetRegistry.h:1019
llvm::Target::createMCRelocationInfo
MCRelocationInfo * createMCRelocationInfo(StringRef TT, MCContext &Ctx) const
createMCRelocationInfo - Create a target specific MCRelocationInfo.
Definition: TargetRegistry.h:565
llvm::createMachOStreamer
MCStreamer * createMachOStreamer(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&CE, bool RelaxAll, bool DWARFMustBeAtTheEnd, bool LabelSections=false)
Definition: MCMachOStreamer.cpp:509
llvm::RegisterMCInstrInfo::RegisterMCInstrInfo
RegisterMCInstrInfo(Target &T)
Definition: TargetRegistry.h:988
llvm::Target::createMCCodeEmitter
MCCodeEmitter * createMCCodeEmitter(const MCInstrInfo &II, const MCRegisterInfo &MRI, MCContext &Ctx) const
createMCCodeEmitter - Create a target specific code emitter.
Definition: TargetRegistry.h:454
llvm::TargetRegistry::iterator
Definition: TargetRegistry.h:606
llvm::RegisterMCRegInfoFn::RegisterMCRegInfoFn
RegisterMCRegInfoFn(Target &T, Target::MCRegInfoCtorFnTy Fn)
Definition: TargetRegistry.h:1071
llvm::TargetRegistry::RegisterMCDisassembler
static void RegisterMCDisassembler(Target &T, Target::MCDisassemblerCtorTy Fn)
RegisterMCDisassembler - Register a MCDisassembler implementation for the given target.
Definition: TargetRegistry.h:824
llvm::AMDGPU::Exp::Target
Target
Definition: SIDefines.h:732
llvm::Optional< Reloc::Model >
T
#define T
Definition: Mips16ISelLowering.cpp:341
llvm::Triple::XCOFF
@ XCOFF
Definition: Triple.h:239
llvm::TargetRegistry
TargetRegistry - Generic interface to target specific features.
Definition: TargetRegistry.h:599
llvm::Target::createAsmStreamer
MCStreamer * createAsmStreamer(MCContext &Ctx, std::unique_ptr< formatted_raw_ostream > OS, bool IsVerboseAsm, bool UseDwarfDirectory, MCInstPrinter *InstPrint, std::unique_ptr< MCCodeEmitter > &&CE, std::unique_ptr< MCAsmBackend > &&TAB, bool ShowInst) const
Definition: TargetRegistry.h:525
llvm::Target::createAsmTargetStreamer
MCTargetStreamer * createAsmTargetStreamer(MCStreamer &S, formatted_raw_ostream &OS, MCInstPrinter *InstPrint, bool IsVerboseAsm) const
Definition: TargetRegistry.h:540
tmp
alloca< 16 x float >, align 16 %tmp2=alloca< 16 x float >, align 16 store< 16 x float > %A,< 16 x float > *%tmp %s=bitcast< 16 x float > *%tmp to i8 *%s2=bitcast< 16 x float > *%tmp2 to i8 *call void @llvm.memcpy.i64(i8 *%s, i8 *%s2, i64 64, i32 16) %R=load< 16 x float > *%tmp2 ret< 16 x float > %R } declare void @llvm.memcpy.i64(i8 *nocapture, i8 *nocapture, i64, i32) nounwind which compiles to:_foo:subl $140, %esp movaps %xmm3, 112(%esp) movaps %xmm2, 96(%esp) movaps %xmm1, 80(%esp) movaps %xmm0, 64(%esp) movl 60(%esp), %eax movl %eax, 124(%esp) movl 56(%esp), %eax movl %eax, 120(%esp) movl 52(%esp), %eax< many many more 32-bit copies > movaps(%esp), %xmm0 movaps 16(%esp), %xmm1 movaps 32(%esp), %xmm2 movaps 48(%esp), %xmm3 addl $140, %esp ret On Nehalem, it may even be cheaper to just use movups when unaligned than to fall back to lower-granularity chunks. Implement processor-specific optimizations for parity with GCC on these processors. GCC does two optimizations:1. ix86_pad_returns inserts a noop before ret instructions if immediately preceded by a conditional branch or is the target of a jump. 2. ix86_avoid_jump_misspredicts inserts noops in cases where a 16-byte block of code contains more than 3 branches. The first one is done for all AMDs, Core2, and "Generic" The second one is done for:Atom, Pentium Pro, all AMDs, Pentium 4, Nocona, Core 2, and "Generic" Testcase:int x(int a) { return(a &0xf0)> >4 tmp
Definition: README.txt:1347
llvm::TargetRegistry::RegisterMCInstPrinter
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target.
Definition: TargetRegistry.h:838
llvm::TargetRegistry::lookupTarget
static const Target * lookupTarget(const std::string &Triple, std::string &Error)
lookupTarget - Lookup a target based on a target triple.
Definition: TargetRegistry.cpp:62
llvm::RegisterMCInstrInfo
RegisterMCInstrInfo - Helper template for registering a target instruction info implementation.
Definition: TargetRegistry.h:987
llvm::TargetRegistry::RegisterCOFFStreamer
static void RegisterCOFFStreamer(Target &T, Target::COFFStreamerCtorTy Fn)
Definition: TargetRegistry.h:855
llvm::Target::MCAsmParserCtorTy
MCTargetAsmParser *(*)(const MCSubtargetInfo &STI, MCAsmParser &P, const MCInstrInfo &MII, const MCTargetOptions &Options) MCAsmParserCtorTy
Definition: TargetRegistry.h:154
llvm::Target::createMCInstrInfo
MCInstrInfo * createMCInstrInfo() const
createMCInstrInfo - Create a MCInstrInfo implementation.
Definition: TargetRegistry.h:348
llvm::Target::MCInstrInfoCtorFnTy
MCInstrInfo *(*)() MCInstrInfoCtorFnTy
Definition: TargetRegistry.h:133
llvm::MCSymbolizer
Symbolize and annotate disassembled instructions.
Definition: MCSymbolizer.h:38
llvm::Target::MCAsmBackendCtorTy
MCAsmBackend *(*)(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options) MCAsmBackendCtorTy
Definition: TargetRegistry.h:151
llvm::Target::createMCRegInfo
MCRegisterInfo * createMCRegInfo(StringRef TT) const
createMCRegInfo - Create a MCRegisterInfo implementation.
Definition: TargetRegistry.h:364
FormattedStream.h
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:197
llvm::Target::hasTargetMachine
bool hasTargetMachine() const
hasTargetMachine - Check if this target supports code generation.
Definition: TargetRegistry.h:320
llvm::RegisterMCInstrInfoFn::RegisterMCInstrInfoFn
RegisterMCInstrInfoFn(Target &T, Target::MCInstrInfoCtorFnTy Fn)
Definition: TargetRegistry.h:1005
llvm::MCAsmBackend
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:36
llvm::RegisterMCAsmParser
RegisterMCAsmParser - Helper template for registering a target specific assembly parser,...
Definition: TargetRegistry.h:1160
llvm::Triple::ArchType
ArchType
Definition: Triple.h:47
llvm::TargetRegistry::targets
static iterator_range< iterator > targets()
Definition: TargetRegistry.cpp:20
llvm::TargetRegistry::TargetRegistry
TargetRegistry()=delete
LLVMOpInfoCallback
int(* LLVMOpInfoCallback)(void *DisInfo, uint64_t PC, uint64_t Offset, uint64_t Size, int TagType, void *TagBuf)
The type for the operand information call back function.
Definition: DisassemblerTypes.h:42
llvm::X86AS::FS
@ FS
Definition: X86.h:183
llvm::createAsmStreamer
MCStreamer * createAsmStreamer(MCContext &Ctx, std::unique_ptr< formatted_raw_ostream > OS, bool isVerboseAsm, bool useDwarfDirectory, MCInstPrinter *InstPrint, std::unique_ptr< MCCodeEmitter > &&CE, std::unique_ptr< MCAsmBackend > &&TAB, bool ShowInst)
Create a machine code streamer which will print out assembly for the native target,...
Definition: MCAsmStreamer.cpp:2391
llvm::RegisterMCSubtargetInfoFn
RegisterMCSubtargetInfoFn - Helper template for registering a target subtarget info implementation.
Definition: TargetRegistry.h:1104
llvm::TargetRegistry::iterator::iterator_category
std::forward_iterator_tag iterator_category
Definition: TargetRegistry.h:614
llvm::TargetRegistry::iterator::operator==
bool operator==(const iterator &x) const
Definition: TargetRegistry.h:622
llvm::Target::TargetMachineCtorTy
TargetMachine *(*)(const Target &T, const Triple &TT, StringRef CPU, StringRef Features, const TargetOptions &Options, Optional< Reloc::Model > RM, Optional< CodeModel::Model > CM, CodeGenOpt::Level OL, bool JIT) TargetMachineCtorTy
Definition: TargetRegistry.h:142
llvm::TargetRegistry::iterator::operator->
const Target * operator->() const
Definition: TargetRegistry.h:642
llvm::MCInstrAnalysis
Definition: MCInstrAnalysis.h:27
llvm::TargetRegistry::iterator::operator!=
bool operator!=(const iterator &x) const
Definition: TargetRegistry.h:623
llvm::TargetRegistry::RegisterTargetMachine
static void RegisterTargetMachine(Target &T, Target::TargetMachineCtorTy Fn)
RegisterTargetMachine - Register a TargetMachine implementation for the given target.
Definition: TargetRegistry.h:772
llvm::RegisterTargetMachine
RegisterTargetMachine - Helper template for registering a target machine implementation,...
Definition: TargetRegistry.h:1118
llvm::Target::ObjectTargetStreamerCtorTy
MCTargetStreamer *(*)(MCStreamer &S, const MCSubtargetInfo &STI) ObjectTargetStreamerCtorTy
Definition: TargetRegistry.h:191
llvm::report_fatal_error
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Definition: Error.cpp:140
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:50
llvm::MCTargetStreamer
Target specific streamer interface.
Definition: MCStreamer.h:91
Info
Analysis containing CSE Info
Definition: CSEInfo.cpp:26
llvm::Triple::GOFF
@ GOFF
Definition: Triple.h:236
llvm::RegisterMCSubtargetInfo::RegisterMCSubtargetInfo
RegisterMCSubtargetInfo(Target &T)
Definition: TargetRegistry.h:1085
llvm::None
const NoneType None
Definition: None.h:23
llvm::RegisterMCInstrAnalysisFn
RegisterMCInstrAnalysisFn - Helper template for registering a target instruction analyzer implementat...
Definition: TargetRegistry.h:1037
llvm::RegisterMCAsmInfoFn
RegisterMCAsmInfoFn - Helper template for registering a target assembly info implementation.
Definition: TargetRegistry.h:973
llvm::Target::createMCAsmParser
MCTargetAsmParser * createMCAsmParser(const MCSubtargetInfo &STI, MCAsmParser &Parser, const MCInstrInfo &MII, const MCTargetOptions &Options) const
createMCAsmParser - Create a target specific assembly parser.
Definition: TargetRegistry.h:419
llvm::Target::AsmTargetStreamerCtorTy
MCTargetStreamer *(*)(MCStreamer &S, formatted_raw_ostream &OS, MCInstPrinter *InstPrint, bool IsVerboseAsm) AsmTargetStreamerCtorTy
Definition: TargetRegistry.h:189
llvm::Target::hasJIT
bool hasJIT() const
hasJIT - Check if this targets supports the just-in-time compilation.
Definition: TargetRegistry.h:317
llvm::createWasmStreamer
MCStreamer * createWasmStreamer(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&CE, bool RelaxAll)
Definition: MCWasmStreamer.cpp:188
llvm::Triple::ELF
@ ELF
Definition: Triple.h:235
llvm::TargetRegistry::RegisterMCAsmParser
static void RegisterMCAsmParser(Target &T, Target::MCAsmParserCtorTy Fn)
RegisterMCAsmParser - Register a MCTargetAsmParser implementation for the given target.
Definition: TargetRegistry.h:798
llvm::CodeGenOpt::Default
@ Default
Definition: CodeGen.h:55
llvm::TargetRegistry::RegisterMCAsmBackend
static void RegisterMCAsmBackend(Target &T, Target::MCAsmBackendCtorTy Fn)
RegisterMCAsmBackend - Register a MCAsmBackend implementation for the given target.
Definition: TargetRegistry.h:785
LLVMSymbolLookupCallback
const typedef char *(* LLVMSymbolLookupCallback)(void *DisInfo, uint64_t ReferenceValue, uint64_t *ReferenceType, uint64_t ReferencePC, const char **ReferenceName)
The type for the symbol lookup function.
Definition: DisassemblerTypes.h:112
llvm::createXCOFFStreamer
MCStreamer * createXCOFFStreamer(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&CE, bool RelaxAll)
Definition: MCXCOFFStreamer.cpp:119
llvm::RegisterMCAsmParser::RegisterMCAsmParser
RegisterMCAsmParser(Target &T)
Definition: TargetRegistry.h:1161
llvm::TargetRegistry::RegisterMachOStreamer
static void RegisterMachOStreamer(Target &T, Target::MachOStreamerCtorTy Fn)
Definition: TargetRegistry.h:859
llvm::TargetRegistry::iterator::operator++
iterator operator++(int)
Definition: TargetRegistry.h:631
llvm::RegisterMCInstrAnalysisFn::RegisterMCInstrAnalysisFn
RegisterMCInstrAnalysisFn(Target &T, Target::MCInstrAnalysisCtorFnTy Fn)
Definition: TargetRegistry.h:1038
llvm::RegisterMCSubtargetInfoFn::RegisterMCSubtargetInfoFn
RegisterMCSubtargetInfoFn(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
Definition: TargetRegistry.h:1105
llvm::MCInstPrinter
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:43
llvm::EngineKind::JIT
@ JIT
Definition: ExecutionEngine.h:525
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::MCDisassembler
Superclass for all disassemblers.
Definition: MCDisassembler.h:76
llvm::TargetRegistry::RegisterTarget
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.
Definition: TargetRegistry.cpp:88
llvm::Target::getNext
const Target * getNext() const
Definition: TargetRegistry.h:301
llvm::Target::createMCSymbolizer
MCSymbolizer * createMCSymbolizer(StringRef TT, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp, void *DisInfo, MCContext *Ctx, std::unique_ptr< MCRelocationInfo > &&RelInfo) const
createMCSymbolizer - Create a target specific MCSymbolizer.
Definition: TargetRegistry.h:585
llvm::TargetRegistry::RegisterObjectTargetStreamer
static void RegisterObjectTargetStreamer(Target &T, Target::ObjectTargetStreamerCtorTy Fn)
Definition: TargetRegistry.h:882
llvm::createNullStreamer
MCStreamer * createNullStreamer(MCContext &Ctx)
Create a dummy machine code streamer, which does nothing.
Definition: MCNullStreamer.cpp:47
llvm::Target::createMCDisassembler
MCDisassembler * createMCDisassembler(const MCSubtargetInfo &STI, MCContext &Ctx) const
Definition: TargetRegistry.h:437
llvm::RegisterMCInstrAnalysis
RegisterMCInstrAnalysis - Helper template for registering a target instruction analyzer implementatio...
Definition: TargetRegistry.h:1018
llvm::Target::getName
const char * getName() const
getName - Get the target name.
Definition: TargetRegistry.h:304
llvm::formatted_raw_ostream
formatted_raw_ostream - A raw_ostream that wraps another one and keeps track of line and column posit...
Definition: FormattedStream.h:30
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:77
llvm::Target::createAsmPrinter
AsmPrinter * createAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > &&Streamer) const
createAsmPrinter - Create a target specific assembly printer pass.
Definition: TargetRegistry.h:430
llvm::TargetRegistry::RegisterMCAsmInfo
static void RegisterMCAsmInfo(Target &T, Target::MCAsmInfoCtorFnTy Fn)
RegisterMCAsmInfo - Register a MCAsmInfo implementation for the given target.
Definition: TargetRegistry.h:712
llvm::Target::MachOStreamerCtorTy
MCStreamer *(*)(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&Emitter, bool RelaxAll, bool DWARFMustBeAtTheEnd) MachOStreamerCtorTy
Definition: TargetRegistry.h:175
iterator_range.h
llvm::Target::MCInstPrinterCtorTy
MCInstPrinter *(*)(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI) MCInstPrinterCtorTy
Definition: TargetRegistry.h:162
llvm::TargetRegistry::RegisterMCSubtargetInfo
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
RegisterMCSubtargetInfo - Register a MCSubtargetInfo implementation for the given target.
Definition: TargetRegistry.h:758
llvm::MCTargetOptions
Definition: MCTargetOptions.h:36
llvm::Target::createNullStreamer
MCStreamer * createNullStreamer(MCContext &Ctx) const
Definition: TargetRegistry.h:549
Triple.h
llvm::Target::ArchMatchFnTy
bool(*)(Triple::ArchType Arch) ArchMatchFnTy
Definition: TargetRegistry.h:128
llvm::AArch64::RM
@ RM
Definition: AArch64ISelLowering.h:467
llvm::createMCRelocationInfo
MCRelocationInfo * createMCRelocationInfo(const Triple &TT, MCContext &Ctx)
Definition: MCRelocationInfo.cpp:27
llvm::RegisterMCRegInfo
RegisterMCRegInfo - Helper template for registering a target register info implementation.
Definition: TargetRegistry.h:1051
llvm::Target::createMCAsmBackend
MCAsmBackend * createMCAsmBackend(const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options) const
createMCAsmBackend - Create a target specific assembly parser.
Definition: TargetRegistry.h:407
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm::Target::hasMCAsmParser
bool hasMCAsmParser() const
hasMCAsmParser - Check if this target supports assembly parsing.
Definition: TargetRegistry.h:326
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
llvm::Target::MCDisassemblerCtorTy
MCDisassembler *(*)(const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx) MCDisassemblerCtorTy
Definition: TargetRegistry.h:157
llvm::Target::hasMCAsmBackend
bool hasMCAsmBackend() const
hasMCAsmBackend - Check if this target supports .o generation.
Definition: TargetRegistry.h:323
llvm::RegisterMCAsmInfo
RegisterMCAsmInfo - Helper template for registering a target assembly info implementation.
Definition: TargetRegistry.h:953
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::RegisterMCRegInfo::RegisterMCRegInfo
RegisterMCRegInfo(Target &T)
Definition: TargetRegistry.h:1052
llvm::CodeGenOpt::Level
Level
Definition: CodeGen.h:52
llvm::MCRegisterInfo
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Definition: MCRegisterInfo.h:135
llvm::TargetRegistry::printRegisteredTargetsForVersion
static void printRegisteredTargetsForVersion(raw_ostream &OS)
printRegisteredTargetsForVersion - Print the registered targets appropriately for inclusion in a tool...
Definition: TargetRegistry.cpp:117
MRI
unsigned const MachineRegisterInfo * MRI
Definition: AArch64AdvSIMDScalarPass.cpp:105
llvm::createELFStreamer
MCStreamer * createELFStreamer(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&CE, bool RelaxAll)
Definition: MCELFStreamer.cpp:714
llvm::Target::createMCInstrAnalysis
MCInstrAnalysis * createMCInstrAnalysis(const MCInstrInfo *Info) const
createMCInstrAnalysis - Create a MCInstrAnalysis implementation.
Definition: TargetRegistry.h:356
llvm::RegisterMCSubtargetInfo
RegisterMCSubtargetInfo - Helper template for registering a target subtarget info implementation.
Definition: TargetRegistry.h:1084
llvm::Target::createMCSubtargetInfo
MCSubtargetInfo * createMCSubtargetInfo(StringRef TheTriple, StringRef CPU, StringRef Features) const
createMCSubtargetInfo - Create a MCSubtargetInfo implementation.
Definition: TargetRegistry.h:379
llvm::TargetRegistry::RegisterMCInstrInfo
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
RegisterMCInstrInfo - Register a MCInstrInfo implementation for the given target.
Definition: TargetRegistry.h:725
llvm::TargetRegistry::RegisterMCCodeEmitter
static void RegisterMCCodeEmitter(Target &T, Target::MCCodeEmitterCtorTy Fn)
RegisterMCCodeEmitter - Register a MCCodeEmitter implementation for the given target.
Definition: TargetRegistry.h:851
llvm::MCInstrInfo
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:25
llvm::Target::createMCInstPrinter
MCInstPrinter * createMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI) const
Definition: TargetRegistry.h:444
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
llvm::MCCodeEmitter
MCCodeEmitter - Generic instruction encoding interface.
Definition: MCCodeEmitter.h:21
llvm::TargetRegistry::RegisterMCRegInfo
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
RegisterMCRegInfo - Register a MCRegisterInfo implementation for the given target.
Definition: TargetRegistry.h:745
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::TargetRegistry::RegisterELFStreamer
static void RegisterELFStreamer(Target &T, Target::ELFStreamerCtorTy Fn)
Definition: TargetRegistry.h:863
llvm::RegisterMCAsmBackend::RegisterMCAsmBackend
RegisterMCAsmBackend(Target &T)
Definition: TargetRegistry.h:1140
llvm::Triple::MachO
@ MachO
Definition: Triple.h:237
llvm::RegisterTarget::getArchMatch
static bool getArchMatch(Triple::ArchType Arch)
Definition: TargetRegistry.h:940
llvm::RegisterTarget
RegisterTarget - Helper template for registering a target, for use in the target's initialization fun...
Definition: TargetRegistry.h:933
x
TODO unsigned x
Definition: README.txt:10
llvm::MCTargetAsmParser
MCTargetAsmParser - Generic interface to target specific assembly parsers.
Definition: MCTargetAsmParser.h:309
llvm::AsmPrinter
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:82
llvm::TargetRegistry::RegisterNullTargetStreamer
static void RegisterNullTargetStreamer(Target &T, Target::NullTargetStreamerCtorTy Fn)
Definition: TargetRegistry.h:871
llvm::Target::MCRegInfoCtorFnTy
MCRegisterInfo *(*)(const Triple &TT) MCRegInfoCtorFnTy
Definition: TargetRegistry.h:135
CodeGen.h
llvm::Target::getBackendName
const char * getBackendName() const
getBackendName - Get the backend name.
Definition: TargetRegistry.h:310
llvm::Triple::COFF
@ COFF
Definition: Triple.h:234
llvm::Target::getShortDescription
const char * getShortDescription() const
getShortDescription - Get a short description of the target.
Definition: TargetRegistry.h:307
llvm::TargetRegistry::iterator::operator*
const Target & operator*() const
Definition: TargetRegistry.h:637
llvm::TargetRegistry::iterator::iterator
iterator()=default
DisassemblerTypes.h
llvm::RegisterTarget::RegisterTarget
RegisterTarget(Target &T, const char *Name, const char *Desc, const char *BackendName)
Definition: TargetRegistry.h:934
llvm::TargetRegistry::RegisterAsmPrinter
static void RegisterAsmPrinter(Target &T, Target::AsmPrinterCtorTy Fn)
RegisterAsmPrinter - Register an AsmPrinter implementation for the given target.
Definition: TargetRegistry.h:811
llvm::TargetRegistry::iterator::operator++
iterator & operator++()
Definition: TargetRegistry.h:626
llvm::RegisterTargetMachine::RegisterTargetMachine
RegisterTargetMachine(Target &T)
Definition: TargetRegistry.h:1119
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition: iterator_range.h:30
llvm::RegisterMCAsmInfoFn::RegisterMCAsmInfoFn
RegisterMCAsmInfoFn(Target &T, Target::MCAsmInfoCtorFnTy Fn)
Definition: TargetRegistry.h:974
llvm::TargetRegistry::RegisterMCSymbolizer
static void RegisterMCSymbolizer(Target &T, Target::MCSymbolizerCtorTy Fn)
RegisterMCSymbolizer - Register an MCSymbolizer implementation for the given target.
Definition: TargetRegistry.h:910
llvm::Target::ELFStreamerCtorTy
MCStreamer *(*)(const Triple &T, MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&Emitter, bool RelaxAll) ELFStreamerCtorTy
Definition: TargetRegistry.h:170
llvm::Target::Target
Target()=default
llvm::RegisterAsmPrinter
RegisterAsmPrinter - Helper template for registering a target specific assembly printer,...
Definition: TargetRegistry.h:1181
llvm::Target::MCCodeEmitterCtorTy
MCCodeEmitter *(*)(const MCInstrInfo &II, const MCRegisterInfo &MRI, MCContext &Ctx) MCCodeEmitterCtorTy
Definition: TargetRegistry.h:165
llvm::Target::NullTargetStreamerCtorTy
MCTargetStreamer *(*)(MCStreamer &S) NullTargetStreamerCtorTy
Definition: TargetRegistry.h:186
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:75
llvm::RegisterMCRegInfoFn
RegisterMCRegInfoFn - Helper template for registering a target register info implementation.
Definition: TargetRegistry.h:1070
llvm::RegisterMCCodeEmitter
RegisterMCCodeEmitter - Helper template for registering a target specific machine code emitter,...
Definition: TargetRegistry.h:1201
llvm::createMCSymbolizer
MCSymbolizer * createMCSymbolizer(const Triple &TT, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp, void *DisInfo, MCContext *Ctx, std::unique_ptr< MCRelocationInfo > &&RelInfo)
Definition: MCExternalSymbolizer.cpp:190
llvm::TargetRegistry::RegisterMCRelocationInfo
static void RegisterMCRelocationInfo(Target &T, Target::MCRelocationInfoCtorTy Fn)
RegisterMCRelocationInfo - Register an MCRelocationInfo implementation for the given target.
Definition: TargetRegistry.h:896
llvm::Target::createTargetMachine
TargetMachine * createTargetMachine(StringRef TT, StringRef CPU, StringRef Features, const TargetOptions &Options, Optional< Reloc::Model > RM, Optional< CodeModel::Model > CM=None, CodeGenOpt::Level OL=CodeGenOpt::Default, bool JIT=false) const
createTargetMachine - Create a target specific machine implementation for the specified Triple.
Definition: TargetRegistry.h:393
llvm::RegisterAsmPrinter::RegisterAsmPrinter
RegisterAsmPrinter(Target &T)
Definition: TargetRegistry.h:1182
llvm::Triple::UnknownObjectFormat
@ UnknownObjectFormat
Definition: Triple.h:232