clang  14.0.0git
TargetInfo.h
Go to the documentation of this file.
1 //===--- TargetInfo.h - Expose information about the target -----*- 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 /// \file
10 /// Defines the clang::TargetInfo interface.
11 ///
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CLANG_BASIC_TARGETINFO_H
15 #define LLVM_CLANG_BASIC_TARGETINFO_H
16 
19 #include "clang/Basic/LLVM.h"
21 #include "clang/Basic/Specifiers.h"
24 #include "llvm/ADT/APFloat.h"
25 #include "llvm/ADT/APInt.h"
26 #include "llvm/ADT/ArrayRef.h"
27 #include "llvm/ADT/IntrusiveRefCntPtr.h"
28 #include "llvm/ADT/Optional.h"
29 #include "llvm/ADT/SmallSet.h"
30 #include "llvm/ADT/StringMap.h"
31 #include "llvm/ADT/StringRef.h"
32 #include "llvm/ADT/Triple.h"
33 #include "llvm/Frontend/OpenMP/OMPGridValues.h"
34 #include "llvm/Support/DataTypes.h"
35 #include "llvm/Support/Error.h"
36 #include "llvm/Support/VersionTuple.h"
37 #include <cassert>
38 #include <string>
39 #include <vector>
40 
41 namespace llvm {
42 struct fltSemantics;
43 }
44 
45 namespace clang {
46 class DiagnosticsEngine;
47 class LangOptions;
48 class CodeGenOptions;
49 class MacroBuilder;
50 
51 namespace Builtin { struct Info; }
52 
53 enum class FloatModeKind {
54  NoFloat = 255,
55  Float = 0,
56  Double,
57  LongDouble,
58  Float128,
59  Ibm128
60 };
61 
62 /// Fields controlling how types are laid out in memory; these may need to
63 /// be copied for targets like AMDGPU that base their ABIs on an auxiliary
64 /// CPU target.
66  unsigned char PointerWidth, PointerAlign;
67  unsigned char BoolWidth, BoolAlign;
68  unsigned char IntWidth, IntAlign;
69  unsigned char HalfWidth, HalfAlign;
70  unsigned char BFloat16Width, BFloat16Align;
71  unsigned char FloatWidth, FloatAlign;
72  unsigned char DoubleWidth, DoubleAlign;
75  unsigned char LongWidth, LongAlign;
76  unsigned char LongLongWidth, LongLongAlign;
77 
78  // Fixed point bit widths
80  unsigned char AccumWidth, AccumAlign;
83  unsigned char FractWidth, FractAlign;
85 
86  // If true, unsigned fixed point types have the same number of fractional bits
87  // as their signed counterparts, forcing the unsigned types to have one extra
88  // bit of padding. Otherwise, unsigned fixed point types have
89  // one more fractional bit than its corresponding signed type. This is false
90  // by default.
92 
93  // Fixed point integral and fractional bit sizes
94  // Saturated types share the same integral/fractional bits as their
95  // corresponding unsaturated types.
96  // For simplicity, the fractional bits in a _Fract type will be one less the
97  // width of that _Fract type. This leaves all signed _Fract types having no
98  // padding and unsigned _Fract types will only have 1 bit of padding after the
99  // sign if PaddingOnUnsignedFixedPoint is set.
100  unsigned char ShortAccumScale;
101  unsigned char AccumScale;
102  unsigned char LongAccumScale;
103 
104  unsigned char SuitableAlign;
106  unsigned char MinGlobalAlign;
107 
108  unsigned short NewAlign;
109  unsigned MaxVectorAlign;
110  unsigned MaxTLSAlign;
111 
112  const llvm::fltSemantics *HalfFormat, *BFloat16Format, *FloatFormat,
114 
115  ///===---- Target Data Type Query Methods -------------------------------===//
116  enum IntType {
117  NoInt = 0,
128  };
129 
130 protected:
134 
135  /// Whether Objective-C's built-in boolean type should be signed char.
136  ///
137  /// Otherwise, when this flag is not set, the normal built-in boolean type is
138  /// used.
140 
141  /// Control whether the alignment of bit-field types is respected when laying
142  /// out structures. If true, then the alignment of the bit-field type will be
143  /// used to (a) impact the alignment of the containing structure, and (b)
144  /// ensure that the individual bit-field will not straddle an alignment
145  /// boundary.
147 
148  /// Whether zero length bitfields (e.g., int : 0;) force alignment of
149  /// the next bitfield.
150  ///
151  /// If the alignment of the zero length bitfield is greater than the member
152  /// that follows it, `bar', `bar' will be aligned as the type of the
153  /// zero-length bitfield.
155 
156  /// Whether zero length bitfield alignment is respected if they are the
157  /// leading members.
159 
160  /// Whether explicit bit field alignment attributes are honored.
162 
163  /// If non-zero, specifies a fixed alignment value for bitfields that follow
164  /// zero length bitfield, regardless of the zero length bitfield type.
166 
167  /// If non-zero, specifies a maximum alignment to truncate alignment
168  /// specified in the aligned attribute of a static variable to this value.
170 };
171 
172 /// OpenCL type kinds.
173 enum OpenCLTypeKind : uint8_t {
182 };
183 
184 /// Exposes information about the current target.
185 ///
186 class TargetInfo : public virtual TransferrableTargetInfo,
187  public RefCountedBase<TargetInfo> {
188  std::shared_ptr<TargetOptions> TargetOpts;
189  llvm::Triple Triple;
190 protected:
191  // Target values set by the ctor of the actual target implementation. Default
192  // values are specified by the TargetInfo constructor.
193  bool BigEndian;
196  bool NoAsmVariants; // True if {|} are normal characters.
197  bool HasLegalHalfType; // True if the backend supports operations on the half
198  // LLVM IR type.
202  bool HasIbm128;
206 
208  unsigned short SimdDefaultAlign;
210  const char *UserLabelPrefix;
211  const char *MCountName;
212  unsigned char RegParmMax, SSERegParmMax;
216 
217  mutable StringRef PlatformName;
218  mutable VersionTuple PlatformMinVersion;
219 
220  unsigned HasAlignMac68kSupport : 1;
221  unsigned RealTypeUsesObjCFPRet : 3;
223 
224  unsigned HasBuiltinMSVaList : 1;
225 
226  unsigned IsRenderScriptTarget : 1;
227 
228  unsigned HasAArch64SVETypes : 1;
229 
230  unsigned HasRISCVVTypes : 1;
231 
233 
234  unsigned ARMCDECoprocMask : 8;
235 
237 
238  // TargetInfo Constructor. Default initializes all fields.
239  TargetInfo(const llvm::Triple &T);
240 
241  // UserLabelPrefix must match DL's getGlobalPrefix() when interpreted
242  // as a DataLayout object.
243  void resetDataLayout(StringRef DL, const char *UserLabelPrefix = "");
244 
245 public:
246  /// Construct a target for the given options.
247  ///
248  /// \param Opts - The options to use to initialize the target. The target may
249  /// modify the options to canonicalize the target feature information to match
250  /// what the backend expects.
251  static TargetInfo *
253  const std::shared_ptr<TargetOptions> &Opts);
254 
255  virtual ~TargetInfo();
256 
257  /// Retrieve the target options.
259  assert(TargetOpts && "Missing target options");
260  return *TargetOpts;
261  }
262 
263  /// The different kinds of __builtin_va_list types defined by
264  /// the target implementation.
266  /// typedef char* __builtin_va_list;
268 
269  /// typedef void* __builtin_va_list;
271 
272  /// __builtin_va_list as defined by the AArch64 ABI
273  /// http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055a/IHI0055A_aapcs64.pdf
275 
276  /// __builtin_va_list as defined by the PNaCl ABI:
277  /// http://www.chromium.org/nativeclient/pnacl/bitcode-abi#TOC-Machine-Types
279 
280  /// __builtin_va_list as defined by the Power ABI:
281  /// https://www.power.org
282  /// /resources/downloads/Power-Arch-32-bit-ABI-supp-1.0-Embedded.pdf
284 
285  /// __builtin_va_list as defined by the x86-64 ABI:
286  /// http://refspecs.linuxbase.org/elf/x86_64-abi-0.21.pdf
288 
289  /// __builtin_va_list as defined by ARM AAPCS ABI
290  /// http://infocenter.arm.com
291  // /help/topic/com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf
293 
294  // typedef struct __va_list_tag
295  // {
296  // long __gpr;
297  // long __fpr;
298  // void *__overflow_arg_area;
299  // void *__reg_save_area;
300  // } va_list[1];
302 
303  // typedef struct __va_list_tag {
304  // void *__current_saved_reg_area_pointer;
305  // void *__saved_reg_area_end_pointer;
306  // void *__overflow_area_pointer;
307  //} va_list;
309  };
310 
311 protected:
312  /// Specify if mangling based on address space map should be used or
313  /// not for language specific address spaces
315 
316 public:
317  IntType getSizeType() const { return SizeType; }
319  switch (SizeType) {
320  case UnsignedShort:
321  return SignedShort;
322  case UnsignedInt:
323  return SignedInt;
324  case UnsignedLong:
325  return SignedLong;
326  case UnsignedLongLong:
327  return SignedLongLong;
328  default:
329  llvm_unreachable("Invalid SizeType");
330  }
331  }
332  IntType getIntMaxType() const { return IntMaxType; }
335  }
336  IntType getPtrDiffType(unsigned AddrSpace) const {
337  return AddrSpace == 0 ? PtrDiffType : getPtrDiffTypeV(AddrSpace);
338  }
339  IntType getUnsignedPtrDiffType(unsigned AddrSpace) const {
340  return getCorrespondingUnsignedType(getPtrDiffType(AddrSpace));
341  }
342  IntType getIntPtrType() const { return IntPtrType; }
345  }
346  IntType getWCharType() const { return WCharType; }
347  IntType getWIntType() const { return WIntType; }
348  IntType getChar16Type() const { return Char16Type; }
349  IntType getChar32Type() const { return Char32Type; }
350  IntType getInt64Type() const { return Int64Type; }
353  }
354  IntType getInt16Type() const { return Int16Type; }
357  }
360 
362  switch (T) {
363  case SignedChar:
364  return UnsignedChar;
365  case SignedShort:
366  return UnsignedShort;
367  case SignedInt:
368  return UnsignedInt;
369  case SignedLong:
370  return UnsignedLong;
371  case SignedLongLong:
372  return UnsignedLongLong;
373  default:
374  llvm_unreachable("Unexpected signed integer type");
375  }
376  }
377 
378  /// In the event this target uses the same number of fractional bits for its
379  /// unsigned types as it does with its signed counterparts, there will be
380  /// exactly one bit of padding.
381  /// Return true if unsigned fixed point types have padding for this target.
384  }
385 
386  /// Return the width (in bits) of the specified integer type enum.
387  ///
388  /// For example, SignedInt -> getIntWidth().
389  unsigned getTypeWidth(IntType T) const;
390 
391  /// Return integer type with specified width.
392  virtual IntType getIntTypeByWidth(unsigned BitWidth, bool IsSigned) const;
393 
394  /// Return the smallest integer type with at least the specified width.
395  virtual IntType getLeastIntTypeByWidth(unsigned BitWidth,
396  bool IsSigned) const;
397 
398  /// Return floating point type with specified width. On PPC, there are
399  /// three possible types for 128-bit floating point: "PPC double-double",
400  /// IEEE 754R quad precision, and "long double" (which under the covers
401  /// is represented as one of those two). At this time, there is no support
402  /// for an explicit "PPC double-double" type (i.e. __ibm128) so we only
403  /// need to differentiate between "long double" and IEEE quad precision.
404  FloatModeKind getRealTypeByWidth(unsigned BitWidth,
405  FloatModeKind ExplicitType) const;
406 
407  /// Return the alignment (in bits) of the specified integer type enum.
408  ///
409  /// For example, SignedInt -> getIntAlign().
410  unsigned getTypeAlign(IntType T) const;
411 
412  /// Returns true if the type is signed; false otherwise.
413  static bool isTypeSigned(IntType T);
414 
415  /// Return the width of pointers on this target, for the
416  /// specified address space.
417  uint64_t getPointerWidth(unsigned AddrSpace) const {
418  return AddrSpace == 0 ? PointerWidth : getPointerWidthV(AddrSpace);
419  }
420  uint64_t getPointerAlign(unsigned AddrSpace) const {
421  return AddrSpace == 0 ? PointerAlign : getPointerAlignV(AddrSpace);
422  }
423 
424  /// Return the maximum width of pointers on this target.
425  virtual uint64_t getMaxPointerWidth() const {
426  return PointerWidth;
427  }
428 
429  /// Get integer value for null pointer.
430  /// \param AddrSpace address space of pointee in source language.
431  virtual uint64_t getNullPointerValue(LangAS AddrSpace) const { return 0; }
432 
433  /// Return the size of '_Bool' and C++ 'bool' for this target, in bits.
434  unsigned getBoolWidth() const { return BoolWidth; }
435 
436  /// Return the alignment of '_Bool' and C++ 'bool' for this target.
437  unsigned getBoolAlign() const { return BoolAlign; }
438 
439  unsigned getCharWidth() const { return 8; } // FIXME
440  unsigned getCharAlign() const { return 8; } // FIXME
441 
442  /// Return the size of 'signed short' and 'unsigned short' for this
443  /// target, in bits.
444  unsigned getShortWidth() const { return 16; } // FIXME
445 
446  /// Return the alignment of 'signed short' and 'unsigned short' for
447  /// this target.
448  unsigned getShortAlign() const { return 16; } // FIXME
449 
450  /// getIntWidth/Align - Return the size of 'signed int' and 'unsigned int' for
451  /// this target, in bits.
452  unsigned getIntWidth() const { return IntWidth; }
453  unsigned getIntAlign() const { return IntAlign; }
454 
455  /// getLongWidth/Align - Return the size of 'signed long' and 'unsigned long'
456  /// for this target, in bits.
457  unsigned getLongWidth() const { return LongWidth; }
458  unsigned getLongAlign() const { return LongAlign; }
459 
460  /// getLongLongWidth/Align - Return the size of 'signed long long' and
461  /// 'unsigned long long' for this target, in bits.
462  unsigned getLongLongWidth() const { return LongLongWidth; }
463  unsigned getLongLongAlign() const { return LongLongAlign; }
464 
465  /// getShortAccumWidth/Align - Return the size of 'signed short _Accum' and
466  /// 'unsigned short _Accum' for this target, in bits.
467  unsigned getShortAccumWidth() const { return ShortAccumWidth; }
468  unsigned getShortAccumAlign() const { return ShortAccumAlign; }
469 
470  /// getAccumWidth/Align - Return the size of 'signed _Accum' and
471  /// 'unsigned _Accum' for this target, in bits.
472  unsigned getAccumWidth() const { return AccumWidth; }
473  unsigned getAccumAlign() const { return AccumAlign; }
474 
475  /// getLongAccumWidth/Align - Return the size of 'signed long _Accum' and
476  /// 'unsigned long _Accum' for this target, in bits.
477  unsigned getLongAccumWidth() const { return LongAccumWidth; }
478  unsigned getLongAccumAlign() const { return LongAccumAlign; }
479 
480  /// getShortFractWidth/Align - Return the size of 'signed short _Fract' and
481  /// 'unsigned short _Fract' for this target, in bits.
482  unsigned getShortFractWidth() const { return ShortFractWidth; }
483  unsigned getShortFractAlign() const { return ShortFractAlign; }
484 
485  /// getFractWidth/Align - Return the size of 'signed _Fract' and
486  /// 'unsigned _Fract' for this target, in bits.
487  unsigned getFractWidth() const { return FractWidth; }
488  unsigned getFractAlign() const { return FractAlign; }
489 
490  /// getLongFractWidth/Align - Return the size of 'signed long _Fract' and
491  /// 'unsigned long _Fract' for this target, in bits.
492  unsigned getLongFractWidth() const { return LongFractWidth; }
493  unsigned getLongFractAlign() const { return LongFractAlign; }
494 
495  /// getShortAccumScale/IBits - Return the number of fractional/integral bits
496  /// in a 'signed short _Accum' type.
497  unsigned getShortAccumScale() const { return ShortAccumScale; }
498  unsigned getShortAccumIBits() const {
499  return ShortAccumWidth - ShortAccumScale - 1;
500  }
501 
502  /// getAccumScale/IBits - Return the number of fractional/integral bits
503  /// in a 'signed _Accum' type.
504  unsigned getAccumScale() const { return AccumScale; }
505  unsigned getAccumIBits() const { return AccumWidth - AccumScale - 1; }
506 
507  /// getLongAccumScale/IBits - Return the number of fractional/integral bits
508  /// in a 'signed long _Accum' type.
509  unsigned getLongAccumScale() const { return LongAccumScale; }
510  unsigned getLongAccumIBits() const {
511  return LongAccumWidth - LongAccumScale - 1;
512  }
513 
514  /// getUnsignedShortAccumScale/IBits - Return the number of
515  /// fractional/integral bits in a 'unsigned short _Accum' type.
516  unsigned getUnsignedShortAccumScale() const {
518  }
519  unsigned getUnsignedShortAccumIBits() const {
523  }
524 
525  /// getUnsignedAccumScale/IBits - Return the number of fractional/integral
526  /// bits in a 'unsigned _Accum' type.
527  unsigned getUnsignedAccumScale() const {
529  }
530  unsigned getUnsignedAccumIBits() const {
533  }
534 
535  /// getUnsignedLongAccumScale/IBits - Return the number of fractional/integral
536  /// bits in a 'unsigned long _Accum' type.
537  unsigned getUnsignedLongAccumScale() const {
539  }
540  unsigned getUnsignedLongAccumIBits() const {
544  }
545 
546  /// getShortFractScale - Return the number of fractional bits
547  /// in a 'signed short _Fract' type.
548  unsigned getShortFractScale() const { return ShortFractWidth - 1; }
549 
550  /// getFractScale - Return the number of fractional bits
551  /// in a 'signed _Fract' type.
552  unsigned getFractScale() const { return FractWidth - 1; }
553 
554  /// getLongFractScale - Return the number of fractional bits
555  /// in a 'signed long _Fract' type.
556  unsigned getLongFractScale() const { return LongFractWidth - 1; }
557 
558  /// getUnsignedShortFractScale - Return the number of fractional bits
559  /// in a 'unsigned short _Fract' type.
560  unsigned getUnsignedShortFractScale() const {
562  : getShortFractScale() + 1;
563  }
564 
565  /// getUnsignedFractScale - Return the number of fractional bits
566  /// in a 'unsigned _Fract' type.
567  unsigned getUnsignedFractScale() const {
569  }
570 
571  /// getUnsignedLongFractScale - Return the number of fractional bits
572  /// in a 'unsigned long _Fract' type.
573  unsigned getUnsignedLongFractScale() const {
575  : getLongFractScale() + 1;
576  }
577 
578  /// Determine whether the __int128 type is supported on this target.
579  virtual bool hasInt128Type() const {
580  return (getPointerWidth(0) >= 64) || getTargetOpts().ForceEnableInt128;
581  } // FIXME
582 
583  /// Determine whether the _BitInt type is supported on this target. This
584  /// limitation is put into place for ABI reasons.
585  /// FIXME: _BitInt is a required type in C23, so there's not much utility in
586  /// asking whether the target supported it or not; I think this should be
587  /// removed once backends have been alerted to the type and have had the
588  /// chance to do implementation work if needed.
589  virtual bool hasBitIntType() const {
590  return false;
591  }
592 
593  /// Determine whether _Float16 is supported on this target.
594  virtual bool hasLegalHalfType() const { return HasLegalHalfType; }
595 
596  /// Determine whether the __float128 type is supported on this target.
597  virtual bool hasFloat128Type() const { return HasFloat128; }
598 
599  /// Determine whether the _Float16 type is supported on this target.
600  virtual bool hasFloat16Type() const { return HasFloat16; }
601 
602  /// Determine whether the _BFloat16 type is supported on this target.
603  virtual bool hasBFloat16Type() const { return HasBFloat16; }
604 
605  /// Determine whether the __ibm128 type is supported on this target.
606  virtual bool hasIbm128Type() const { return HasIbm128; }
607 
608  /// Determine whether the long double type is supported on this target.
609  virtual bool hasLongDoubleType() const { return HasLongDouble; }
610 
611  /// Determine whether return of a floating point value is supported
612  /// on this target.
613  virtual bool hasFPReturn() const { return HasFPReturn; }
614 
615  /// Determine whether constrained floating point is supported on this target.
616  virtual bool hasStrictFP() const { return HasStrictFP; }
617 
618  /// Return the alignment that is the largest alignment ever used for any
619  /// scalar/SIMD data type on the target machine you are compiling for
620  /// (including types with an extended alignment requirement).
621  unsigned getSuitableAlign() const { return SuitableAlign; }
622 
623  /// Return the default alignment for __attribute__((aligned)) on
624  /// this target, to be used if no alignment value is specified.
627  }
628 
629  /// getMinGlobalAlign - Return the minimum alignment of a global variable,
630  /// unless its alignment is explicitly reduced via attributes.
631  virtual unsigned getMinGlobalAlign (uint64_t) const {
632  return MinGlobalAlign;
633  }
634 
635  /// Return the largest alignment for which a suitably-sized allocation with
636  /// '::operator new(size_t)' or 'malloc' is guaranteed to produce a
637  /// correctly-aligned pointer.
638  unsigned getNewAlign() const {
640  }
641 
642  /// getWCharWidth/Align - Return the size of 'wchar_t' for this target, in
643  /// bits.
644  unsigned getWCharWidth() const { return getTypeWidth(WCharType); }
645  unsigned getWCharAlign() const { return getTypeAlign(WCharType); }
646 
647  /// getChar16Width/Align - Return the size of 'char16_t' for this target, in
648  /// bits.
649  unsigned getChar16Width() const { return getTypeWidth(Char16Type); }
650  unsigned getChar16Align() const { return getTypeAlign(Char16Type); }
651 
652  /// getChar32Width/Align - Return the size of 'char32_t' for this target, in
653  /// bits.
654  unsigned getChar32Width() const { return getTypeWidth(Char32Type); }
655  unsigned getChar32Align() const { return getTypeAlign(Char32Type); }
656 
657  /// getHalfWidth/Align/Format - Return the size/align/format of 'half'.
658  unsigned getHalfWidth() const { return HalfWidth; }
659  unsigned getHalfAlign() const { return HalfAlign; }
660  const llvm::fltSemantics &getHalfFormat() const { return *HalfFormat; }
661 
662  /// getFloatWidth/Align/Format - Return the size/align/format of 'float'.
663  unsigned getFloatWidth() const { return FloatWidth; }
664  unsigned getFloatAlign() const { return FloatAlign; }
665  const llvm::fltSemantics &getFloatFormat() const { return *FloatFormat; }
666 
667  /// getBFloat16Width/Align/Format - Return the size/align/format of '__bf16'.
668  unsigned getBFloat16Width() const { return BFloat16Width; }
669  unsigned getBFloat16Align() const { return BFloat16Align; }
670  const llvm::fltSemantics &getBFloat16Format() const { return *BFloat16Format; }
671 
672  /// getDoubleWidth/Align/Format - Return the size/align/format of 'double'.
673  unsigned getDoubleWidth() const { return DoubleWidth; }
674  unsigned getDoubleAlign() const { return DoubleAlign; }
675  const llvm::fltSemantics &getDoubleFormat() const { return *DoubleFormat; }
676 
677  /// getLongDoubleWidth/Align/Format - Return the size/align/format of 'long
678  /// double'.
679  unsigned getLongDoubleWidth() const { return LongDoubleWidth; }
680  unsigned getLongDoubleAlign() const { return LongDoubleAlign; }
681  const llvm::fltSemantics &getLongDoubleFormat() const {
682  return *LongDoubleFormat;
683  }
684 
685  /// getFloat128Width/Align/Format - Return the size/align/format of
686  /// '__float128'.
687  unsigned getFloat128Width() const { return 128; }
688  unsigned getFloat128Align() const { return Float128Align; }
689  const llvm::fltSemantics &getFloat128Format() const {
690  return *Float128Format;
691  }
692 
693  /// getIbm128Width/Align/Format - Return the size/align/format of
694  /// '__ibm128'.
695  unsigned getIbm128Width() const { return 128; }
696  unsigned getIbm128Align() const { return Ibm128Align; }
697  const llvm::fltSemantics &getIbm128Format() const { return *Ibm128Format; }
698 
699  /// Return the mangled code of long double.
700  virtual const char *getLongDoubleMangling() const { return "e"; }
701 
702  /// Return the mangled code of __float128.
703  virtual const char *getFloat128Mangling() const { return "g"; }
704 
705  /// Return the mangled code of __ibm128.
706  virtual const char *getIbm128Mangling() const {
707  llvm_unreachable("ibm128 not implemented on this target");
708  }
709 
710  /// Return the mangled code of bfloat.
711  virtual const char *getBFloat16Mangling() const {
712  llvm_unreachable("bfloat not implemented on this target");
713  }
714 
715  /// Return the value for the C99 FLT_EVAL_METHOD macro.
716  virtual unsigned getFloatEvalMethod() const { return 0; }
717 
718  // getLargeArrayMinWidth/Align - Return the minimum array size that is
719  // 'large' and its alignment.
720  unsigned getLargeArrayMinWidth() const { return LargeArrayMinWidth; }
721  unsigned getLargeArrayAlign() const { return LargeArrayAlign; }
722 
723  /// Return the maximum width lock-free atomic operation which will
724  /// ever be supported for the given target
725  unsigned getMaxAtomicPromoteWidth() const { return MaxAtomicPromoteWidth; }
726  /// Return the maximum width lock-free atomic operation which can be
727  /// inlined given the supported features of the given target.
728  unsigned getMaxAtomicInlineWidth() const { return MaxAtomicInlineWidth; }
729  /// Set the maximum inline or promote width lock-free atomic operation
730  /// for the given target.
731  virtual void setMaxAtomicWidth() {}
732  /// Returns true if the given target supports lock-free atomic
733  /// operations at the specified width and alignment.
734  virtual bool hasBuiltinAtomic(uint64_t AtomicSizeInBits,
735  uint64_t AlignmentInBits) const {
736  return AtomicSizeInBits <= AlignmentInBits &&
737  AtomicSizeInBits <= getMaxAtomicInlineWidth() &&
738  (AtomicSizeInBits <= getCharWidth() ||
739  llvm::isPowerOf2_64(AtomicSizeInBits / getCharWidth()));
740  }
741 
742  /// Return the maximum vector alignment supported for the given target.
743  unsigned getMaxVectorAlign() const { return MaxVectorAlign; }
744  /// Return default simd alignment for the given target. Generally, this
745  /// value is type-specific, but this alignment can be used for most of the
746  /// types for the given target.
747  unsigned getSimdDefaultAlign() const { return SimdDefaultAlign; }
748 
750 
751  /// Return the alignment (in bits) of the thrown exception object. This is
752  /// only meaningful for targets that allocate C++ exceptions in a system
753  /// runtime, such as those using the Itanium C++ ABI.
754  virtual unsigned getExnObjectAlignment() const {
755  // Itanium says that an _Unwind_Exception has to be "double-word"
756  // aligned (and thus the end of it is also so-aligned), meaning 16
757  // bytes. Of course, that was written for the actual Itanium,
758  // which is a 64-bit platform. Classically, the ABI doesn't really
759  // specify the alignment on other platforms, but in practice
760  // libUnwind declares the struct with __attribute__((aligned)), so
761  // we assume that alignment here. (It's generally 16 bytes, but
762  // some targets overwrite it.)
764  }
765 
766  /// Return the size of intmax_t and uintmax_t for this target, in bits.
767  unsigned getIntMaxTWidth() const {
768  return getTypeWidth(IntMaxType);
769  }
770 
771  /// Return the address space for functions for the given target.
772  unsigned getProgramAddressSpace() const { return ProgramAddrSpace; }
773 
774  // Return the size of unwind_word for this target.
775  virtual unsigned getUnwindWordWidth() const { return getPointerWidth(0); }
776 
777  /// Return the "preferred" register width on this target.
778  virtual unsigned getRegisterWidth() const {
779  // Currently we assume the register width on the target matches the pointer
780  // width, we can introduce a new variable for this if/when some target wants
781  // it.
782  return PointerWidth;
783  }
784 
785  /// \brief Returns the default value of the __USER_LABEL_PREFIX__ macro,
786  /// which is the prefix given to user symbols by default.
787  ///
788  /// On most platforms this is "", but it is "_" on some.
789  const char *getUserLabelPrefix() const { return UserLabelPrefix; }
790 
791  /// Returns the name of the mcount instrumentation function.
792  const char *getMCountName() const {
793  return MCountName;
794  }
795 
796  /// Check if the Objective-C built-in boolean type should be signed
797  /// char.
798  ///
799  /// Otherwise, if this returns false, the normal built-in boolean type
800  /// should also be used for Objective-C.
803  }
805  UseSignedCharForObjCBool = false;
806  }
807 
808  /// Check whether the alignment of bit-field types is respected
809  /// when laying out structures.
812  }
813 
814  /// Check whether zero length bitfields should force alignment of
815  /// the next member.
818  }
819 
820  /// Check whether zero length bitfield alignment is respected if they are
821  /// leading members.
824  }
825 
826  /// Get the fixed alignment value in bits for a member that follows
827  /// a zero length bitfield.
828  unsigned getZeroLengthBitfieldBoundary() const {
830  }
831 
832  /// Get the maximum alignment in bits for a static variable with
833  /// aligned attribute.
834  unsigned getMaxAlignedAttribute() const { return MaxAlignedAttribute; }
835 
836  /// Check whether explicit bitfield alignment attributes should be
837  // honored, as in "__attribute__((aligned(2))) int b : 1;".
840  }
841 
842  /// Check whether this target support '\#pragma options align=mac68k'.
843  bool hasAlignMac68kSupport() const {
844  return HasAlignMac68kSupport;
845  }
846 
847  /// Return the user string for the specified integer type enum.
848  ///
849  /// For example, SignedShort -> "short".
850  static const char *getTypeName(IntType T);
851 
852  /// Return the constant suffix for the specified integer type enum.
853  ///
854  /// For example, SignedLong -> "L".
855  const char *getTypeConstantSuffix(IntType T) const;
856 
857  /// Return the printf format modifier for the specified
858  /// integer type enum.
859  ///
860  /// For example, SignedLong -> "l".
861  static const char *getTypeFormatModifier(IntType T);
862 
863  /// Check whether the given real type should use the "fpret" flavor of
864  /// Objective-C message passing on this target.
866  return RealTypeUsesObjCFPRet & (1 << (int)T);
867  }
868 
869  /// Check whether _Complex long double should use the "fp2ret" flavor
870  /// of Objective-C message passing on this target.
873  }
874 
875  /// Check whether llvm intrinsics such as llvm.convert.to.fp16 should be used
876  /// to convert to and from __fp16.
877  /// FIXME: This function should be removed once all targets stop using the
878  /// conversion intrinsics.
879  virtual bool useFP16ConversionIntrinsics() const {
880  return true;
881  }
882 
883  /// Specify if mangling based on address space map should be used or
884  /// not for language specific address spaces
887  }
888 
889  ///===---- Other target property query methods --------------------------===//
890 
891  /// Appends the target-specific \#define values for this
892  /// target set to the specified buffer.
893  virtual void getTargetDefines(const LangOptions &Opts,
894  MacroBuilder &Builder) const = 0;
895 
896 
897  /// Return information about target-specific builtins for
898  /// the current primary target, and info about which builtins are non-portable
899  /// across the current set of primary and secondary targets.
900  virtual ArrayRef<Builtin::Info> getTargetBuiltins() const = 0;
901 
902  /// Returns target-specific min and max values VScale_Range.
904  getVScaleRange(const LangOptions &LangOpts) const {
905  return None;
906  }
907  /// The __builtin_clz* and __builtin_ctz* built-in
908  /// functions are specified to have undefined results for zero inputs, but
909  /// on targets that support these operations in a way that provides
910  /// well-defined results for zero without loss of performance, it is a good
911  /// idea to avoid optimizing based on that undef behavior.
912  virtual bool isCLZForZeroUndef() const { return true; }
913 
914  /// Returns the kind of __builtin_va_list type that should be used
915  /// with this target.
916  virtual BuiltinVaListKind getBuiltinVaListKind() const = 0;
917 
918  /// Returns whether or not type \c __builtin_ms_va_list type is
919  /// available on this target.
920  bool hasBuiltinMSVaList() const { return HasBuiltinMSVaList; }
921 
922  /// Returns true for RenderScript.
924 
925  /// Returns whether or not the AArch64 SVE built-in types are
926  /// available on this target.
927  bool hasAArch64SVETypes() const { return HasAArch64SVETypes; }
928 
929  /// Returns whether or not the RISC-V V built-in types are
930  /// available on this target.
931  bool hasRISCVVTypes() const { return HasRISCVVTypes; }
932 
933  /// Returns whether or not the AMDGPU unsafe floating point atomics are
934  /// allowed.
936 
937  /// For ARM targets returns a mask defining which coprocessors are configured
938  /// as Custom Datapath.
939  uint32_t getARMCDECoprocMask() const { return ARMCDECoprocMask; }
940 
941  /// Returns whether the passed in string is a valid clobber in an
942  /// inline asm statement.
943  ///
944  /// This is used by Sema.
945  bool isValidClobber(StringRef Name) const;
946 
947  /// Returns whether the passed in string is a valid register name
948  /// according to GCC.
949  ///
950  /// This is used by Sema for inline asm statements.
951  virtual bool isValidGCCRegisterName(StringRef Name) const;
952 
953  /// Returns the "normalized" GCC register name.
954  ///
955  /// ReturnCannonical true will return the register name without any additions
956  /// such as "{}" or "%" in it's canonical form, for example:
957  /// ReturnCanonical = true and Name = "rax", will return "ax".
958  StringRef getNormalizedGCCRegisterName(StringRef Name,
959  bool ReturnCanonical = false) const;
960 
961  virtual bool isSPRegName(StringRef) const { return false; }
962 
963  /// Extracts a register from the passed constraint (if it is a
964  /// single-register constraint) and the asm label expression related to a
965  /// variable in the input or output list of an inline asm statement.
966  ///
967  /// This function is used by Sema in order to diagnose conflicts between
968  /// the clobber list and the input/output lists.
969  virtual StringRef getConstraintRegister(StringRef Constraint,
970  StringRef Expression) const {
971  return "";
972  }
973 
974  struct ConstraintInfo {
975  enum {
976  CI_None = 0x00,
979  CI_ReadWrite = 0x04, // "+r" output constraint (read and write).
980  CI_HasMatchingInput = 0x08, // This output operand has a matching input.
981  CI_ImmediateConstant = 0x10, // This operand must be an immediate constant
982  CI_EarlyClobber = 0x20, // "&" output constraint (early clobber).
983  };
984  unsigned Flags;
986  struct {
987  int Min;
988  int Max;
990  } ImmRange;
991  llvm::SmallSet<int, 4> ImmSet;
992 
993  std::string ConstraintStr; // constraint: "=rm"
994  std::string Name; // Operand name: [foo] with no []'s.
995  public:
996  ConstraintInfo(StringRef ConstraintStr, StringRef Name)
997  : Flags(0), TiedOperand(-1), ConstraintStr(ConstraintStr.str()),
998  Name(Name.str()) {
999  ImmRange.Min = ImmRange.Max = 0;
1000  ImmRange.isConstrained = false;
1001  }
1002 
1003  const std::string &getConstraintStr() const { return ConstraintStr; }
1004  const std::string &getName() const { return Name; }
1005  bool isReadWrite() const { return (Flags & CI_ReadWrite) != 0; }
1006  bool earlyClobber() { return (Flags & CI_EarlyClobber) != 0; }
1007  bool allowsRegister() const { return (Flags & CI_AllowsRegister) != 0; }
1008  bool allowsMemory() const { return (Flags & CI_AllowsMemory) != 0; }
1009 
1010  /// Return true if this output operand has a matching
1011  /// (tied) input operand.
1012  bool hasMatchingInput() const { return (Flags & CI_HasMatchingInput) != 0; }
1013 
1014  /// Return true if this input operand is a matching
1015  /// constraint that ties it to an output operand.
1016  ///
1017  /// If this returns true then getTiedOperand will indicate which output
1018  /// operand this is tied to.
1019  bool hasTiedOperand() const { return TiedOperand != -1; }
1020  unsigned getTiedOperand() const {
1021  assert(hasTiedOperand() && "Has no tied operand!");
1022  return (unsigned)TiedOperand;
1023  }
1024 
1026  return (Flags & CI_ImmediateConstant) != 0;
1027  }
1029  if (!ImmSet.empty())
1030  return Value.isSignedIntN(32) && ImmSet.contains(Value.getZExtValue());
1031  return !ImmRange.isConstrained ||
1032  (Value.sge(ImmRange.Min) && Value.sle(ImmRange.Max));
1033  }
1034 
1040  void setRequiresImmediate(int Min, int Max) {
1042  ImmRange.Min = Min;
1043  ImmRange.Max = Max;
1044  ImmRange.isConstrained = true;
1045  }
1048  for (int Exact : Exacts)
1049  ImmSet.insert(Exact);
1050  }
1051  void setRequiresImmediate(int Exact) {
1053  ImmSet.insert(Exact);
1054  }
1057  }
1058 
1059  /// Indicate that this is an input operand that is tied to
1060  /// the specified output operand.
1061  ///
1062  /// Copy over the various constraint information from the output.
1063  void setTiedOperand(unsigned N, ConstraintInfo &Output) {
1064  Output.setHasMatchingInput();
1065  Flags = Output.Flags;
1066  TiedOperand = N;
1067  // Don't copy Name or constraint string.
1068  }
1069  };
1070 
1071  /// Validate register name used for global register variables.
1072  ///
1073  /// This function returns true if the register passed in RegName can be used
1074  /// for global register variables on this target. In addition, it returns
1075  /// true in HasSizeMismatch if the size of the register doesn't match the
1076  /// variable size passed in RegSize.
1077  virtual bool validateGlobalRegisterVariable(StringRef RegName,
1078  unsigned RegSize,
1079  bool &HasSizeMismatch) const {
1080  HasSizeMismatch = false;
1081  return true;
1082  }
1083 
1084  // validateOutputConstraint, validateInputConstraint - Checks that
1085  // a constraint is valid and provides information about it.
1086  // FIXME: These should return a real error instead of just true/false.
1087  bool validateOutputConstraint(ConstraintInfo &Info) const;
1089  ConstraintInfo &info) const;
1090 
1091  virtual bool validateOutputSize(const llvm::StringMap<bool> &FeatureMap,
1092  StringRef /*Constraint*/,
1093  unsigned /*Size*/) const {
1094  return true;
1095  }
1096 
1097  virtual bool validateInputSize(const llvm::StringMap<bool> &FeatureMap,
1098  StringRef /*Constraint*/,
1099  unsigned /*Size*/) const {
1100  return true;
1101  }
1102  virtual bool
1103  validateConstraintModifier(StringRef /*Constraint*/,
1104  char /*Modifier*/,
1105  unsigned /*Size*/,
1106  std::string &/*SuggestedModifier*/) const {
1107  return true;
1108  }
1109  virtual bool
1110  validateAsmConstraint(const char *&Name,
1111  TargetInfo::ConstraintInfo &info) const = 0;
1112 
1113  bool resolveSymbolicName(const char *&Name,
1114  ArrayRef<ConstraintInfo> OutputConstraints,
1115  unsigned &Index) const;
1116 
1117  // Constraint parm will be left pointing at the last character of
1118  // the constraint. In practice, it won't be changed unless the
1119  // constraint is longer than one character.
1120  virtual std::string convertConstraint(const char *&Constraint) const {
1121  // 'p' defaults to 'r', but can be overridden by targets.
1122  if (*Constraint == 'p')
1123  return std::string("r");
1124  return std::string(1, *Constraint);
1125  }
1126 
1127  /// Replace some escaped characters with another string based on
1128  /// target-specific rules
1130  return llvm::None;
1131  }
1132 
1133  /// Returns a string of target-specific clobbers, in LLVM format.
1134  virtual const char *getClobbers() const = 0;
1135 
1136  /// Returns true if NaN encoding is IEEE 754-2008.
1137  /// Only MIPS allows a different encoding.
1138  virtual bool isNan2008() const {
1139  return true;
1140  }
1141 
1142  /// Returns the target triple of the primary target.
1143  const llvm::Triple &getTriple() const {
1144  return Triple;
1145  }
1146 
1147  /// Returns the target ID if supported.
1148  virtual llvm::Optional<std::string> getTargetID() const { return llvm::None; }
1149 
1150  const char *getDataLayoutString() const {
1151  assert(!DataLayoutString.empty() && "Uninitialized DataLayout!");
1152  return DataLayoutString.c_str();
1153  }
1154 
1155  struct GCCRegAlias {
1156  const char * const Aliases[5];
1157  const char * const Register;
1158  };
1159 
1160  struct AddlRegName {
1161  const char * const Names[5];
1162  const unsigned RegNum;
1163  };
1164 
1165  /// Does this target support "protected" visibility?
1166  ///
1167  /// Any target which dynamic libraries will naturally support
1168  /// something like "default" (meaning that the symbol is visible
1169  /// outside this shared object) and "hidden" (meaning that it isn't)
1170  /// visibilities, but "protected" is really an ELF-specific concept
1171  /// with weird semantics designed around the convenience of dynamic
1172  /// linker implementations. Which is not to suggest that there's
1173  /// consistent target-independent semantics for "default" visibility
1174  /// either; the entire thing is pretty badly mangled.
1175  virtual bool hasProtectedVisibility() const { return true; }
1176 
1177  /// Does this target aim for semantic compatibility with
1178  /// Microsoft C++ code using dllimport/export attributes?
1179  virtual bool shouldDLLImportComdatSymbols() const {
1180  return getTriple().isWindowsMSVCEnvironment() ||
1181  getTriple().isWindowsItaniumEnvironment() || getTriple().isPS4CPU();
1182  }
1183 
1184  // Does this target have PS4 specific dllimport/export handling?
1185  virtual bool hasPS4DLLImportExport() const {
1186  return getTriple().isPS4CPU() ||
1187  // Windows Itanium support allows for testing the SCEI flavour of
1188  // dllimport/export handling on a Windows system.
1189  (getTriple().isWindowsItaniumEnvironment() &&
1190  getTriple().getVendor() == llvm::Triple::SCEI);
1191  }
1192 
1193  /// Set forced language options.
1194  ///
1195  /// Apply changes to the target information with respect to certain
1196  /// language options which change the target configuration and adjust
1197  /// the language based on the target options where applicable.
1198  virtual void adjust(DiagnosticsEngine &Diags, LangOptions &Opts);
1199 
1200  /// Adjust target options based on codegen options.
1201  virtual void adjustTargetOptions(const CodeGenOptions &CGOpts,
1202  TargetOptions &TargetOpts) const {}
1203 
1204  /// Initialize the map with the default set of target features for the
1205  /// CPU this should include all legal feature strings on the target.
1206  ///
1207  /// \return False on error (invalid features).
1208  virtual bool initFeatureMap(llvm::StringMap<bool> &Features,
1209  DiagnosticsEngine &Diags, StringRef CPU,
1210  const std::vector<std::string> &FeatureVec) const;
1211 
1212  /// Get the ABI currently in use.
1213  virtual StringRef getABI() const { return StringRef(); }
1214 
1215  /// Get the C++ ABI currently in use.
1217  return TheCXXABI;
1218  }
1219 
1220  /// Target the specified CPU.
1221  ///
1222  /// \return False on error (invalid CPU name).
1223  virtual bool setCPU(const std::string &Name) {
1224  return false;
1225  }
1226 
1227  /// Fill a SmallVectorImpl with the valid values to setCPU.
1228  virtual void fillValidCPUList(SmallVectorImpl<StringRef> &Values) const {}
1229 
1230  /// Fill a SmallVectorImpl with the valid values for tuning CPU.
1231  virtual void fillValidTuneCPUList(SmallVectorImpl<StringRef> &Values) const {
1232  fillValidCPUList(Values);
1233  }
1234 
1235  /// brief Determine whether this TargetInfo supports the given CPU name.
1236  virtual bool isValidCPUName(StringRef Name) const {
1237  return true;
1238  }
1239 
1240  /// brief Determine whether this TargetInfo supports the given CPU name for
1241  // tuning.
1242  virtual bool isValidTuneCPUName(StringRef Name) const {
1243  return isValidCPUName(Name);
1244  }
1245 
1246  /// brief Determine whether this TargetInfo supports tune in target attribute.
1247  virtual bool supportsTargetAttributeTune() const {
1248  return false;
1249  }
1250 
1251  /// Use the specified ABI.
1252  ///
1253  /// \return False on error (invalid ABI name).
1254  virtual bool setABI(const std::string &Name) {
1255  return false;
1256  }
1257 
1258  /// Use the specified unit for FP math.
1259  ///
1260  /// \return False on error (invalid unit name).
1261  virtual bool setFPMath(StringRef Name) {
1262  return false;
1263  }
1264 
1265  /// Check if target has a given feature enabled
1266  virtual bool hasFeatureEnabled(const llvm::StringMap<bool> &Features,
1267  StringRef Name) const {
1268  return Features.lookup(Name);
1269  }
1270 
1271  /// Enable or disable a specific target feature;
1272  /// the feature name must be valid.
1273  virtual void setFeatureEnabled(llvm::StringMap<bool> &Features,
1274  StringRef Name,
1275  bool Enabled) const {
1276  Features[Name] = Enabled;
1277  }
1278 
1279  /// Determine whether this TargetInfo supports the given feature.
1280  virtual bool isValidFeatureName(StringRef Feature) const {
1281  return true;
1282  }
1283 
1290  };
1291 
1292  /// Determine if this TargetInfo supports the given branch protection
1293  /// specification
1294  virtual bool validateBranchProtection(StringRef Spec,
1295  BranchProtectionInfo &BPI,
1296  StringRef &Err) const {
1297  Err = "";
1298  return false;
1299  }
1300 
1301  /// Perform initialization based on the user configured
1302  /// set of features (e.g., +sse4).
1303  ///
1304  /// The list is guaranteed to have at most one entry per feature.
1305  ///
1306  /// The target may modify the features list, to change which options are
1307  /// passed onwards to the backend.
1308  /// FIXME: This part should be fixed so that we can change handleTargetFeatures
1309  /// to merely a TargetInfo initialization routine.
1310  ///
1311  /// \return False on error.
1312  virtual bool handleTargetFeatures(std::vector<std::string> &Features,
1313  DiagnosticsEngine &Diags) {
1314  return true;
1315  }
1316 
1317  /// Determine whether the given target has the given feature.
1318  virtual bool hasFeature(StringRef Feature) const {
1319  return false;
1320  }
1321 
1322  /// Identify whether this target supports multiversioning of functions,
1323  /// which requires support for cpu_supports and cpu_is functionality.
1324  bool supportsMultiVersioning() const { return getTriple().isX86(); }
1325 
1326  /// Identify whether this target supports IFuncs.
1327  bool supportsIFunc() const { return getTriple().isOSBinFormatELF(); }
1328 
1329  // Validate the contents of the __builtin_cpu_supports(const char*)
1330  // argument.
1331  virtual bool validateCpuSupports(StringRef Name) const { return false; }
1332 
1333  // Return the target-specific priority for features/cpus/vendors so
1334  // that they can be properly sorted for checking.
1335  virtual unsigned multiVersionSortPriority(StringRef Name) const {
1336  return 0;
1337  }
1338 
1339  // Validate the contents of the __builtin_cpu_is(const char*)
1340  // argument.
1341  virtual bool validateCpuIs(StringRef Name) const { return false; }
1342 
1343  // Validate a cpu_dispatch/cpu_specific CPU option, which is a different list
1344  // from cpu_is, since it checks via features rather than CPUs directly.
1345  virtual bool validateCPUSpecificCPUDispatch(StringRef Name) const {
1346  return false;
1347  }
1348 
1349  // Get the character to be added for mangling purposes for cpu_specific.
1350  virtual char CPUSpecificManglingCharacter(StringRef Name) const {
1351  llvm_unreachable(
1352  "cpu_specific Multiversioning not implemented on this target");
1353  }
1354 
1355  // Get a list of the features that make up the CPU option for
1356  // cpu_specific/cpu_dispatch so that it can be passed to llvm as optimization
1357  // options.
1359  StringRef Name, llvm::SmallVectorImpl<StringRef> &Features) const {
1360  llvm_unreachable(
1361  "cpu_specific Multiversioning not implemented on this target");
1362  }
1363 
1364  // Get the cache line size of a given cpu. This method switches over
1365  // the given cpu and returns "None" if the CPU is not found.
1366  virtual Optional<unsigned> getCPUCacheLineSize() const { return None; }
1367 
1368  // Returns maximal number of args passed in registers.
1369  unsigned getRegParmMax() const {
1370  assert(RegParmMax < 7 && "RegParmMax value is larger than AST can handle");
1371  return RegParmMax;
1372  }
1373 
1374  /// Whether the target supports thread-local storage.
1375  bool isTLSSupported() const {
1376  return TLSSupported;
1377  }
1378 
1379  /// Return the maximum alignment (in bits) of a TLS variable
1380  ///
1381  /// Gets the maximum alignment (in bits) of a TLS variable on this target.
1382  /// Returns zero if there is no such constraint.
1383  unsigned getMaxTLSAlign() const { return MaxTLSAlign; }
1384 
1385  /// Whether target supports variable-length arrays.
1386  bool isVLASupported() const { return VLASupported; }
1387 
1388  /// Whether the target supports SEH __try.
1389  bool isSEHTrySupported() const {
1390  return getTriple().isOSWindows() &&
1391  (getTriple().isX86() ||
1392  getTriple().getArch() == llvm::Triple::aarch64);
1393  }
1394 
1395  /// Return true if {|} are normal characters in the asm string.
1396  ///
1397  /// If this returns false (the default), then {abc|xyz} is syntax
1398  /// that says that when compiling for asm variant #0, "abc" should be
1399  /// generated, but when compiling for asm variant #1, "xyz" should be
1400  /// generated.
1401  bool hasNoAsmVariants() const {
1402  return NoAsmVariants;
1403  }
1404 
1405  /// Return the register number that __builtin_eh_return_regno would
1406  /// return with the specified argument.
1407  /// This corresponds with TargetLowering's getExceptionPointerRegister
1408  /// and getExceptionSelectorRegister in the backend.
1409  virtual int getEHDataRegisterNumber(unsigned RegNo) const {
1410  return -1;
1411  }
1412 
1413  /// Return the section to use for C++ static initialization functions.
1414  virtual const char *getStaticInitSectionSpecifier() const {
1415  return nullptr;
1416  }
1417 
1418  const LangASMap &getAddressSpaceMap() const { return *AddrSpaceMap; }
1419 
1420  /// Map from the address space field in builtin description strings to the
1421  /// language address space.
1422  virtual LangAS getOpenCLBuiltinAddressSpace(unsigned AS) const {
1423  return getLangASFromTargetAS(AS);
1424  }
1425 
1426  /// Map from the address space field in builtin description strings to the
1427  /// language address space.
1428  virtual LangAS getCUDABuiltinAddressSpace(unsigned AS) const {
1429  return getLangASFromTargetAS(AS);
1430  }
1431 
1432  /// Return an AST address space which can be used opportunistically
1433  /// for constant global memory. It must be possible to convert pointers into
1434  /// this address space to LangAS::Default. If no such address space exists,
1435  /// this may return None, and such optimizations will be disabled.
1437  return LangAS::Default;
1438  }
1439 
1440  // access target-specific GPU grid values that must be consistent between
1441  // host RTL (plugin), deviceRTL and clang.
1442  virtual const llvm::omp::GV &getGridValue() const {
1443  llvm_unreachable("getGridValue not implemented on this target");
1444  }
1445 
1446  /// Retrieve the name of the platform as it is used in the
1447  /// availability attribute.
1448  StringRef getPlatformName() const { return PlatformName; }
1449 
1450  /// Retrieve the minimum desired version of the platform, to
1451  /// which the program should be compiled.
1452  VersionTuple getPlatformMinVersion() const { return PlatformMinVersion; }
1453 
1454  bool isBigEndian() const { return BigEndian; }
1455  bool isLittleEndian() const { return !BigEndian; }
1456 
1457  /// Whether the option -fextend-arguments={32,64} is supported on the target.
1458  virtual bool supportsExtendIntArgs() const { return false; }
1459 
1460  /// Controls if __arithmetic_fence is supported in the targeted backend.
1461  virtual bool checkArithmeticFenceSupported() const { return false; }
1462 
1463  /// Gets the default calling convention for the given target and
1464  /// declaration context.
1466  // Not all targets will specify an explicit calling convention that we can
1467  // express. This will always do the right thing, even though it's not
1468  // an explicit calling convention.
1469  return CC_C;
1470  }
1471 
1477  };
1478 
1479  /// Determines whether a given calling convention is valid for the
1480  /// target. A calling convention can either be accepted, produce a warning
1481  /// and be substituted with the default calling convention, or (someday)
1482  /// produce an error (such as using thiscall on a non-instance function).
1484  switch (CC) {
1485  default:
1486  return CCCR_Warning;
1487  case CC_C:
1488  return CCCR_OK;
1489  }
1490  }
1491 
1496  };
1497 
1498  virtual CallingConvKind getCallingConvKind(bool ClangABICompat4) const;
1499 
1500  /// Controls if __builtin_longjmp / __builtin_setjmp can be lowered to
1501  /// llvm.eh.sjlj.longjmp / llvm.eh.sjlj.setjmp.
1502  virtual bool hasSjLjLowering() const {
1503  return false;
1504  }
1505 
1506  /// Check if the target supports CFProtection branch.
1507  virtual bool
1509 
1510  /// Check if the target supports CFProtection branch.
1511  virtual bool
1513 
1514  /// Whether target allows to overalign ABI-specified preferred alignment
1515  virtual bool allowsLargerPreferedTypeAlignment() const { return true; }
1516 
1517  /// Whether target defaults to the `power` alignment rules of AIX.
1518  virtual bool defaultsToAIXPowerAlignment() const { return false; }
1519 
1520  /// Set supported OpenCL extensions and optional core features.
1521  virtual void setSupportedOpenCLOpts() {}
1522 
1523  virtual void supportAllOpenCLOpts(bool V = true) {
1524 #define OPENCLEXTNAME(Ext) \
1525  setFeatureEnabled(getTargetOpts().OpenCLFeaturesMap, #Ext, V);
1526 #include "clang/Basic/OpenCLExtensions.def"
1527  }
1528 
1529  /// Set supported OpenCL extensions as written on command line
1530  virtual void setCommandLineOpenCLOpts() {
1531  for (const auto &Ext : getTargetOpts().OpenCLExtensionsAsWritten) {
1532  bool IsPrefixed = (Ext[0] == '+' || Ext[0] == '-');
1533  std::string Name = IsPrefixed ? Ext.substr(1) : Ext;
1534  bool V = IsPrefixed ? Ext[0] == '+' : true;
1535 
1536  if (Name == "all") {
1538  continue;
1539  }
1540 
1541  getTargetOpts().OpenCLFeaturesMap[Name] = V;
1542  }
1543  }
1544 
1545  /// Get supported OpenCL extensions and optional core features.
1546  llvm::StringMap<bool> &getSupportedOpenCLOpts() {
1548  }
1549 
1550  /// Get const supported OpenCL extensions and optional core features.
1551  const llvm::StringMap<bool> &getSupportedOpenCLOpts() const {
1553  }
1554 
1555  /// Get address space for OpenCL type.
1556  virtual LangAS getOpenCLTypeAddrSpace(OpenCLTypeKind TK) const;
1557 
1558  /// \returns Target specific vtbl ptr address space.
1559  virtual unsigned getVtblPtrAddressSpace() const {
1560  return 0;
1561  }
1562 
1563  /// \returns If a target requires an address within a target specific address
1564  /// space \p AddressSpace to be converted in order to be used, then return the
1565  /// corresponding target specific DWARF address space.
1566  ///
1567  /// \returns Otherwise return None and no conversion will be emitted in the
1568  /// DWARF.
1569  virtual Optional<unsigned> getDWARFAddressSpace(unsigned AddressSpace) const {
1570  return None;
1571  }
1572 
1573  /// \returns The version of the SDK which was used during the compilation if
1574  /// one was specified, or an empty version otherwise.
1575  const llvm::VersionTuple &getSDKVersion() const {
1576  return getTargetOpts().SDKVersion;
1577  }
1578 
1579  /// Check the target is valid after it is fully initialized.
1580  virtual bool validateTarget(DiagnosticsEngine &Diags) const {
1581  return true;
1582  }
1583 
1584  /// Check that OpenCL target has valid options setting based on OpenCL
1585  /// version.
1586  virtual bool validateOpenCLTarget(const LangOptions &Opts,
1587  DiagnosticsEngine &Diags) const;
1588 
1589  virtual void setAuxTarget(const TargetInfo *Aux) {}
1590 
1591  /// Whether target allows debuginfo types for decl only variables/functions.
1592  virtual bool allowDebugInfoForExternalRef() const { return false; }
1593 
1594 protected:
1595  /// Copy type and layout related info.
1596  void copyAuxTarget(const TargetInfo *Aux);
1597  virtual uint64_t getPointerWidthV(unsigned AddrSpace) const {
1598  return PointerWidth;
1599  }
1600  virtual uint64_t getPointerAlignV(unsigned AddrSpace) const {
1601  return PointerAlign;
1602  }
1603  virtual enum IntType getPtrDiffTypeV(unsigned AddrSpace) const {
1604  return PtrDiffType;
1605  }
1606  virtual ArrayRef<const char *> getGCCRegNames() const = 0;
1607  virtual ArrayRef<GCCRegAlias> getGCCRegAliases() const = 0;
1609  return None;
1610  }
1611 
1612  private:
1613  // Assert the values for the fractional and integral bits for each fixed point
1614  // type follow the restrictions given in clause 6.2.6.3 of N1169.
1615  void CheckFixedPointBits() const;
1616 };
1617 
1618 } // end namespace clang
1619 
1620 #endif
clang::TransferrableTargetInfo::PointerAlign
unsigned char PointerAlign
Definition: TargetInfo.h:66
clang::TargetInfo::DataLayoutString
std::string DataLayoutString
Definition: TargetInfo.h:209
clang::TransferrableTargetInfo::LongWidth
unsigned char LongWidth
Definition: TargetInfo.h:75
clang::TargetInfo::isNan2008
virtual bool isNan2008() const
Returns true if NaN encoding is IEEE 754-2008.
Definition: TargetInfo.h:1138
clang::TargetInfo::isRenderScriptTarget
bool isRenderScriptTarget() const
Returns true for RenderScript.
Definition: TargetInfo.h:923
clang::LangOptions::SignReturnAddressScopeKind
SignReturnAddressScopeKind
Definition: LangOptions.h:260
clang::TransferrableTargetInfo::SuitableAlign
unsigned char SuitableAlign
Definition: TargetInfo.h:104
clang::TargetInfo::PNaClABIBuiltinVaList
@ PNaClABIBuiltinVaList
__builtin_va_list as defined by the PNaCl ABI: http://www.chromium.org/nativeclient/pnacl/bitcode-abi...
Definition: TargetInfo.h:278
clang::TargetInfo::getDataLayoutString
const char * getDataLayoutString() const
Definition: TargetInfo.h:1150
clang::TargetInfo::ConstraintInfo::allowsMemory
bool allowsMemory() const
Definition: TargetInfo.h:1008
clang::TargetInfo::CCCR_Ignore
@ CCCR_Ignore
Definition: TargetInfo.h:1475
clang::TargetInfo::BranchProtectionInfo::SignKey
LangOptions::SignReturnAddressKeyKind SignKey
Definition: TargetInfo.h:1287
clang::TargetInfo::getShortFractWidth
unsigned getShortFractWidth() const
getShortFractWidth/Align - Return the size of 'signed short _Fract' and 'unsigned short _Fract' for t...
Definition: TargetInfo.h:482
clang::TargetInfo::getVtblPtrAddressSpace
virtual unsigned getVtblPtrAddressSpace() const
Definition: TargetInfo.h:1559
clang::TransferrableTargetInfo::LargeArrayAlign
unsigned char LargeArrayAlign
Definition: TargetInfo.h:74
clang::TargetInfo::getMaxVectorAlign
unsigned getMaxVectorAlign() const
Return the maximum vector alignment supported for the given target.
Definition: TargetInfo.h:743
clang::TargetInfo::GCCRegAlias::Register
const char *const Register
Definition: TargetInfo.h:1157
clang::TargetInfo::getProcessIDType
IntType getProcessIDType() const
Definition: TargetInfo.h:359
max
__DEVICE__ int max(int __a, int __b)
Definition: __clang_cuda_math.h:196
clang::TargetInfo::getWCharAlign
unsigned getWCharAlign() const
Definition: TargetInfo.h:645
clang::TargetInfo::getLongDoubleFormat
const llvm::fltSemantics & getLongDoubleFormat() const
Definition: TargetInfo.h:681
llvm
YAML serialization mapping.
Definition: Dominators.h:30
clang::TargetInfo::isCLZForZeroUndef
virtual bool isCLZForZeroUndef() const
The __builtin_clz* and __builtin_ctz* built-in functions are specified to have undefined results for ...
Definition: TargetInfo.h:912
clang::TargetInfo::CCK_Default
@ CCK_Default
Definition: TargetInfo.h:1493
clang::TargetInfo::PlatformMinVersion
VersionTuple PlatformMinVersion
Definition: TargetInfo.h:218
clang::TargetInfo::RegParmMax
unsigned char RegParmMax
Definition: TargetInfo.h:212
clang::TransferrableTargetInfo::IntPtrType
IntType IntPtrType
Definition: TargetInfo.h:131
clang::TransferrableTargetInfo::ShortFractAlign
unsigned char ShortFractAlign
Definition: TargetInfo.h:82
clang::TransferrableTargetInfo::AccumWidth
unsigned char AccumWidth
Definition: TargetInfo.h:80
clang::TargetInfo::getClobbers
virtual const char * getClobbers() const =0
Returns a string of target-specific clobbers, in LLVM format.
Specifiers.h
clang::TransferrableTargetInfo::UnsignedChar
@ UnsignedChar
Definition: TargetInfo.h:119
clang::interp::APInt
llvm::APInt APInt
Definition: Integral.h:27
clang::TargetInfo::getRegParmMax
unsigned getRegParmMax() const
Definition: TargetInfo.h:1369
clang::TargetInfo::isValidGCCRegisterName
virtual bool isValidGCCRegisterName(StringRef Name) const
Returns whether the passed in string is a valid register name according to GCC.
Definition: TargetInfo.cpp:522
clang::TransferrableTargetInfo::IntMaxType
IntType IntMaxType
Definition: TargetInfo.h:131
clang::TargetInfo::ConstraintInfo::getName
const std::string & getName() const
Definition: TargetInfo.h:1004
clang::FloatModeKind::LongDouble
@ LongDouble
clang::TargetInfo::supportsExtendIntArgs
virtual bool supportsExtendIntArgs() const
Whether the option -fextend-arguments={32,64} is supported on the target.
Definition: TargetInfo.h:1458
clang::TargetInfo::getAccumIBits
unsigned getAccumIBits() const
Definition: TargetInfo.h:505
clang::TargetInfo::getLongAccumIBits
unsigned getLongAccumIBits() const
Definition: TargetInfo.h:510
clang::TargetInfo::getBuiltinVaListKind
virtual BuiltinVaListKind getBuiltinVaListKind() const =0
Returns the kind of __builtin_va_list type that should be used with this target.
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
clang::TransferrableTargetInfo::SignedChar
@ SignedChar
Definition: TargetInfo.h:118
clang::TargetInfo::CCCR_Warning
@ CCCR_Warning
Definition: TargetInfo.h:1474
clang::TargetInfo::CCK_ClangABI4OrPS4
@ CCK_ClangABI4OrPS4
Definition: TargetInfo.h:1494
clang::TargetInfo::getTypeConstantSuffix
const char * getTypeConstantSuffix(IntType T) const
Return the constant suffix for the specified integer type enum.
Definition: TargetInfo.cpp:196
clang::TargetInfo::checkCallingConvention
virtual CallingConvCheckResult checkCallingConvention(CallingConv CC) const
Determines whether a given calling convention is valid for the target.
Definition: TargetInfo.h:1483
clang::TransferrableTargetInfo::UseExplicitBitFieldAlignment
unsigned UseExplicitBitFieldAlignment
Whether explicit bit field alignment attributes are honored.
Definition: TargetInfo.h:161
clang::TargetInfo::getDoubleFormat
const llvm::fltSemantics & getDoubleFormat() const
Definition: TargetInfo.h:675
clang::TargetInfo::validateConstraintModifier
virtual bool validateConstraintModifier(StringRef, char, unsigned, std::string &) const
Definition: TargetInfo.h:1103
clang::TargetInfo::fillValidCPUList
virtual void fillValidCPUList(SmallVectorImpl< StringRef > &Values) const
Fill a SmallVectorImpl with the valid values to setCPU.
Definition: TargetInfo.h:1228
clang::TargetInfo::X86_64ABIBuiltinVaList
@ X86_64ABIBuiltinVaList
__builtin_va_list as defined by the x86-64 ABI: http://refspecs.linuxbase.org/elf/x86_64-abi-0....
Definition: TargetInfo.h:287
clang::TargetInfo::getLongWidth
unsigned getLongWidth() const
getLongWidth/Align - Return the size of 'signed long' and 'unsigned long' for this target,...
Definition: TargetInfo.h:457
clang::TargetInfo::ConstraintInfo::Min
int Min
Definition: TargetInfo.h:987
clang::TargetInfo::getIbm128Align
unsigned getIbm128Align() const
Definition: TargetInfo.h:696
clang::TargetInfo::getSuitableAlign
unsigned getSuitableAlign() const
Return the alignment that is the largest alignment ever used for any scalar/SIMD data type on the tar...
Definition: TargetInfo.h:621
clang::TransferrableTargetInfo::LongLongAlign
unsigned char LongLongAlign
Definition: TargetInfo.h:76
clang::TargetInfo::getNewAlign
unsigned getNewAlign() const
Return the largest alignment for which a suitably-sized allocation with '::operator new(size_t)' or '...
Definition: TargetInfo.h:638
clang::TargetInfo::getUnsignedLongAccumScale
unsigned getUnsignedLongAccumScale() const
getUnsignedLongAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned long _...
Definition: TargetInfo.h:537
clang::TransferrableTargetInfo::DoubleAlign
unsigned char DoubleAlign
Definition: TargetInfo.h:72
clang::TargetInfo::SystemZBuiltinVaList
@ SystemZBuiltinVaList
Definition: TargetInfo.h:301
clang::TargetInfo::getUserLabelPrefix
const char * getUserLabelPrefix() const
Returns the default value of the USER_LABEL_PREFIX macro, which is the prefix given to user symbols b...
Definition: TargetInfo.h:789
clang::TargetInfo::getExnObjectAlignment
virtual unsigned getExnObjectAlignment() const
Return the alignment (in bits) of the thrown exception object.
Definition: TargetInfo.h:754
clang::TransferrableTargetInfo::SigAtomicType
IntType SigAtomicType
Definition: TargetInfo.h:132
clang::TransferrableTargetInfo::LongAccumScale
unsigned char LongAccumScale
Definition: TargetInfo.h:102
clang::TargetInfo::HasAlignMac68kSupport
unsigned HasAlignMac68kSupport
Definition: TargetInfo.h:220
clang::TargetInfo::TheCXXABI
TargetCXXABI TheCXXABI
Definition: TargetInfo.h:213
clang::TargetInfo::ConstraintInfo::CI_AllowsMemory
@ CI_AllowsMemory
Definition: TargetInfo.h:977
clang::TargetInfo::getUnsignedShortAccumIBits
unsigned getUnsignedShortAccumIBits() const
Definition: TargetInfo.h:519
clang::TargetInfo::useAddressSpaceMapMangling
bool useAddressSpaceMapMangling() const
Specify if mangling based on address space map should be used or not for language specific address sp...
Definition: TargetInfo.h:885
clang::TargetInfo::hasProtectedVisibility
virtual bool hasProtectedVisibility() const
Does this target support "protected" visibility?
Definition: TargetInfo.h:1175
clang::TargetInfo::ConstraintInfo::CI_EarlyClobber
@ CI_EarlyClobber
Definition: TargetInfo.h:982
clang::TransferrableTargetInfo::MaxAlignedAttribute
unsigned MaxAlignedAttribute
If non-zero, specifies a maximum alignment to truncate alignment specified in the aligned attribute o...
Definition: TargetInfo.h:169
clang::TargetInfo::checkCFProtectionReturnSupported
virtual bool checkCFProtectionReturnSupported(DiagnosticsEngine &Diags) const
Check if the target supports CFProtection branch.
Definition: TargetInfo.cpp:171
clang::TargetInfo::getSimdDefaultAlign
unsigned getSimdDefaultAlign() const
Return default simd alignment for the given target.
Definition: TargetInfo.h:747
clang::TargetInfo::useLeadingZeroLengthBitfield
bool useLeadingZeroLengthBitfield() const
Check whether zero length bitfield alignment is respected if they are leading members.
Definition: TargetInfo.h:822
clang::TargetInfo::hasLongDoubleType
virtual bool hasLongDoubleType() const
Determine whether the long double type is supported on this target.
Definition: TargetInfo.h:609
clang::TargetInfo::ConstraintInfo::setEarlyClobber
void setEarlyClobber()
Definition: TargetInfo.h:1036
clang::TargetInfo::getHalfWidth
unsigned getHalfWidth() const
getHalfWidth/Align/Format - Return the size/align/format of 'half'.
Definition: TargetInfo.h:658
clang::TargetInfo::getDefaultAlignForAttributeAligned
unsigned getDefaultAlignForAttributeAligned() const
Return the default alignment for attribute((aligned)) on this target, to be used if no alignment valu...
Definition: TargetInfo.h:625
clang::TargetInfo::getLongDoubleAlign
unsigned getLongDoubleAlign() const
Definition: TargetInfo.h:680
clang::TargetInfo::isTypeSigned
static bool isTypeSigned(IntType T)
Returns true if the type is signed; false otherwise.
Definition: TargetInfo.cpp:337
clang::TargetInfo::getABI
virtual StringRef getABI() const
Get the ABI currently in use.
Definition: TargetInfo.h:1213
clang::TransferrableTargetInfo::UseZeroLengthBitfieldAlignment
unsigned UseZeroLengthBitfieldAlignment
Whether zero length bitfields (e.g., int : 0;) force alignment of the next bitfield.
Definition: TargetInfo.h:154
clang::TargetInfo::RealTypeUsesObjCFPRet
unsigned RealTypeUsesObjCFPRet
Definition: TargetInfo.h:221
clang::TargetInfo::getBFloat16Mangling
virtual const char * getBFloat16Mangling() const
Return the mangled code of bfloat.
Definition: TargetInfo.h:711
clang::TransferrableTargetInfo::UnsignedShort
@ UnsignedShort
Definition: TargetInfo.h:121
clang::DiagnosticsEngine
Concrete class used by the front-end to report problems and issues.
Definition: Diagnostic.h:191
clang::TargetInfo::getCXXABI
TargetCXXABI getCXXABI() const
Get the C++ ABI currently in use.
Definition: TargetInfo.h:1216
clang::TargetInfo::getFloatEvalMethod
virtual unsigned getFloatEvalMethod() const
Return the value for the C99 FLT_EVAL_METHOD macro.
Definition: TargetInfo.h:716
clang::TargetInfo::getSDKVersion
const llvm::VersionTuple & getSDKVersion() const
Definition: TargetInfo.h:1575
clang::TargetInfo
Exposes information about the current target.
Definition: TargetInfo.h:186
clang::TransferrableTargetInfo::MaxTLSAlign
unsigned MaxTLSAlign
Definition: TargetInfo.h:110
clang::TargetInfo::useObjCFP2RetForComplexLongDouble
bool useObjCFP2RetForComplexLongDouble() const
Check whether _Complex long double should use the "fp2ret" flavor of Objective-C message passing on t...
Definition: TargetInfo.h:871
clang::TargetInfo::getFloatAlign
unsigned getFloatAlign() const
Definition: TargetInfo.h:664
int
__device__ int
Definition: __clang_hip_libdevice_declares.h:63
clang::TransferrableTargetInfo::DefaultAlignForAttributeAligned
unsigned char DefaultAlignForAttributeAligned
Definition: TargetInfo.h:105
clang::TargetInfo::setCPU
virtual bool setCPU(const std::string &Name)
Target the specified CPU.
Definition: TargetInfo.h:1223
clang::TargetInfo::getCallingConvKind
virtual CallingConvKind getCallingConvKind(bool ClangABICompat4) const
Definition: TargetInfo.cpp:480
clang::TargetInfo::VoidPtrBuiltinVaList
@ VoidPtrBuiltinVaList
typedef void* __builtin_va_list;
Definition: TargetInfo.h:270
clang::OCLTK_Image
@ OCLTK_Image
Definition: TargetInfo.h:177
clang::TargetInfo::hasFloat16Type
virtual bool hasFloat16Type() const
Determine whether the _Float16 type is supported on this target.
Definition: TargetInfo.h:600
clang::TargetInfo::AddlRegName::Names
const char *const Names[5]
Definition: TargetInfo.h:1161
clang::TargetInfo::useBitFieldTypeAlignment
bool useBitFieldTypeAlignment() const
Check whether the alignment of bit-field types is respected when laying out structures.
Definition: TargetInfo.h:810
clang::TransferrableTargetInfo::BFloat16Width
unsigned char BFloat16Width
Definition: TargetInfo.h:70
clang::TargetInfo::adjust
virtual void adjust(DiagnosticsEngine &Diags, LangOptions &Opts)
Set forced language options.
Definition: TargetInfo.cpp:359
clang::TransferrableTargetInfo::WIntType
IntType WIntType
Definition: TargetInfo.h:131
clang::LangOptions::SignReturnAddressScopeKind::None
@ None
No signing for any function.
clang::TargetInfo::getBoolWidth
unsigned getBoolWidth() const
Return the size of '_Bool' and C++ 'bool' for this target, in bits.
Definition: TargetInfo.h:434
clang::TargetInfo::getFractScale
unsigned getFractScale() const
getFractScale - Return the number of fractional bits in a 'signed _Fract' type.
Definition: TargetInfo.h:552
clang::TargetInfo::getLongAccumWidth
unsigned getLongAccumWidth() const
getLongAccumWidth/Align - Return the size of 'signed long _Accum' and 'unsigned long _Accum' for this...
Definition: TargetInfo.h:477
clang::TargetInfo::getCharWidth
unsigned getCharWidth() const
Definition: TargetInfo.h:439
clang::TargetInfo::hasFeature
virtual bool hasFeature(StringRef Feature) const
Determine whether the given target has the given feature.
Definition: TargetInfo.h:1318
llvm::Optional
Definition: LLVM.h:40
clang::TargetInfo::isBigEndian
bool isBigEndian() const
Definition: TargetInfo.h:1454
clang::TargetInfo::validateAsmConstraint
virtual bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &info) const =0
clang::TargetInfo::IsRenderScriptTarget
unsigned IsRenderScriptTarget
Definition: TargetInfo.h:226
clang::TargetInfo::getARMCDECoprocMask
uint32_t getARMCDECoprocMask() const
For ARM targets returns a mask defining which coprocessors are configured as Custom Datapath.
Definition: TargetInfo.h:939
clang::TargetInfo::getConstantAddressSpace
virtual llvm::Optional< LangAS > getConstantAddressSpace() const
Return an AST address space which can be used opportunistically for constant global memory.
Definition: TargetInfo.h:1436
clang::TargetInfo::validateCpuSupports
virtual bool validateCpuSupports(StringRef Name) const
Definition: TargetInfo.h:1331
clang::TargetInfo::getUnsignedShortAccumScale
unsigned getUnsignedShortAccumScale() const
getUnsignedShortAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned short...
Definition: TargetInfo.h:516
clang::TargetInfo::getDWARFAddressSpace
virtual Optional< unsigned > getDWARFAddressSpace(unsigned AddressSpace) const
Definition: TargetInfo.h:1569
clang::TargetInfo::getLongLongWidth
unsigned getLongLongWidth() const
getLongLongWidth/Align - Return the size of 'signed long long' and 'unsigned long long' for this targ...
Definition: TargetInfo.h:462
clang::TargetInfo::getOpenCLBuiltinAddressSpace
virtual LangAS getOpenCLBuiltinAddressSpace(unsigned AS) const
Map from the address space field in builtin description strings to the language address space.
Definition: TargetInfo.h:1422
clang::TargetInfo::GCCRegAlias::Aliases
const char *const Aliases[5]
Definition: TargetInfo.h:1156
clang::TransferrableTargetInfo::BoolAlign
unsigned char BoolAlign
Definition: TargetInfo.h:67
clang::TransferrableTargetInfo::Float128Align
unsigned char Float128Align
Definition: TargetInfo.h:73
Expression
clang::TargetInfo::getLongAlign
unsigned getLongAlign() const
Definition: TargetInfo.h:458
clang::TargetInfo::HasBFloat16
bool HasBFloat16
Definition: TargetInfo.h:201
clang::TargetInfo::UseAddrSpaceMapMangling
bool UseAddrSpaceMapMangling
Specify if mangling based on address space map should be used or not for language specific address sp...
Definition: TargetInfo.h:314
clang::TransferrableTargetInfo::LongAlign
unsigned char LongAlign
Definition: TargetInfo.h:75
clang::TransferrableTargetInfo::ShortFractWidth
unsigned char ShortFractWidth
Definition: TargetInfo.h:82
clang::TargetInfo::ConstraintInfo::CI_ImmediateConstant
@ CI_ImmediateConstant
Definition: TargetInfo.h:981
clang::TargetInfo::getMaxOpenCLWorkGroupSize
unsigned getMaxOpenCLWorkGroupSize() const
Definition: TargetInfo.h:749
clang::TargetInfo::setSupportedOpenCLOpts
virtual void setSupportedOpenCLOpts()
Set supported OpenCL extensions and optional core features.
Definition: TargetInfo.h:1521
clang::TransferrableTargetInfo::UnsignedLongLong
@ UnsignedLongLong
Definition: TargetInfo.h:127
clang::TargetInfo::AllowAMDGPUUnsafeFPAtomics
unsigned AllowAMDGPUUnsafeFPAtomics
Definition: TargetInfo.h:232
clang::TargetInfo::BuiltinVaListKind
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
Definition: TargetInfo.h:265
clang::TargetInfo::getShortAccumWidth
unsigned getShortAccumWidth() const
getShortAccumWidth/Align - Return the size of 'signed short _Accum' and 'unsigned short _Accum' for t...
Definition: TargetInfo.h:467
clang::TargetInfo::hasInt128Type
virtual bool hasInt128Type() const
Determine whether the __int128 type is supported on this target.
Definition: TargetInfo.h:579
clang::TransferrableTargetInfo::LongAccumAlign
unsigned char LongAccumAlign
Definition: TargetInfo.h:81
clang::TargetInfo::MaxAtomicPromoteWidth
unsigned char MaxAtomicPromoteWidth
Definition: TargetInfo.h:207
clang::TargetInfo::getVScaleRange
virtual Optional< std::pair< unsigned, unsigned > > getVScaleRange(const LangOptions &LangOpts) const
Returns target-specific min and max values VScale_Range.
Definition: TargetInfo.h:904
clang::TargetInfo::allowAMDGPUUnsafeFPAtomics
bool allowAMDGPUUnsafeFPAtomics() const
Returns whether or not the AMDGPU unsafe floating point atomics are allowed.
Definition: TargetInfo.h:935
clang::TargetInfo::HasFPReturn
bool HasFPReturn
Definition: TargetInfo.h:204
clang::TargetInfo::ConstraintInfo::setAllowsRegister
void setAllowsRegister()
Definition: TargetInfo.h:1038
clang::TargetInfo::ConstraintInfo::Name
std::string Name
Definition: TargetInfo.h:994
clang::TransferrableTargetInfo::FloatFormat
const llvm::fltSemantics * FloatFormat
Definition: TargetInfo.h:112
clang::TransferrableTargetInfo::BFloat16Format
const llvm::fltSemantics * BFloat16Format
Definition: TargetInfo.h:112
clang::TransferrableTargetInfo::FractAlign
unsigned char FractAlign
Definition: TargetInfo.h:83
clang::TargetInfo::getPtrDiffType
IntType getPtrDiffType(unsigned AddrSpace) const
Definition: TargetInfo.h:336
clang::TargetInfo::ConstraintInfo::ImmRange
struct clang::TargetInfo::ConstraintInfo::@174 ImmRange
clang::TargetInfo::getUInt64Type
IntType getUInt64Type() const
Definition: TargetInfo.h:351
clang::LangOptions::SignReturnAddressKeyKind::AKey
@ AKey
Return address signing uses APIA key.
clang::OCLTK_Default
@ OCLTK_Default
Definition: TargetInfo.h:174
clang::TargetInfo::ARMCDECoprocMask
unsigned ARMCDECoprocMask
Definition: TargetInfo.h:234
clang::TargetInfo::checkCFProtectionBranchSupported
virtual bool checkCFProtectionBranchSupported(DiagnosticsEngine &Diags) const
Check if the target supports CFProtection branch.
Definition: TargetInfo.cpp:165
llvm::RefCountedBase
Definition: LLVM.h:49
clang::TargetInfo::getConstraintRegister
virtual StringRef getConstraintRegister(StringRef Constraint, StringRef Expression) const
Extracts a register from the passed constraint (if it is a single-register constraint) and the asm la...
Definition: TargetInfo.h:969
clang::TargetInfo::ConstraintInfo::setAllowsMemory
void setAllowsMemory()
Definition: TargetInfo.h:1037
AddressSpaces.h
clang::TargetInfo::getMaxAtomicInlineWidth
unsigned getMaxAtomicInlineWidth() const
Return the maximum width lock-free atomic operation which can be inlined given the supported features...
Definition: TargetInfo.h:728
clang::TargetInfo::HasLegalHalfType
bool HasLegalHalfType
Definition: TargetInfo.h:197
clang::TargetInfo::getLongDoubleWidth
unsigned getLongDoubleWidth() const
getLongDoubleWidth/Align/Format - Return the size/align/format of 'long double'.
Definition: TargetInfo.h:679
clang::FloatModeKind
FloatModeKind
Definition: TargetInfo.h:53
clang::TargetInfo::getShortAlign
unsigned getShortAlign() const
Return the alignment of 'signed short' and 'unsigned short' for this target.
Definition: TargetInfo.h:448
CodeGenOptions.h
clang::TargetInfo::ConstraintInfo::setIsReadWrite
void setIsReadWrite()
Definition: TargetInfo.h:1035
clang::TargetInfo::HasAArch64SVETypes
unsigned HasAArch64SVETypes
Definition: TargetInfo.h:228
clang::TargetInfo::getFractAlign
unsigned getFractAlign() const
Definition: TargetInfo.h:488
clang::TargetInfo::getSupportedOpenCLOpts
llvm::StringMap< bool > & getSupportedOpenCLOpts()
Get supported OpenCL extensions and optional core features.
Definition: TargetInfo.h:1546
clang::TargetInfo::ConstraintInfo::setHasMatchingInput
void setHasMatchingInput()
Definition: TargetInfo.h:1039
clang::TargetInfo::useSignedCharForObjCBool
bool useSignedCharForObjCBool() const
Check if the Objective-C built-in boolean type should be signed char.
Definition: TargetInfo.h:801
clang::TargetInfo::hasBitIntType
virtual bool hasBitIntType() const
Determine whether the _BitInt type is supported on this target.
Definition: TargetInfo.h:589
clang::TransferrableTargetInfo::HalfAlign
unsigned char HalfAlign
Definition: TargetInfo.h:69
clang::TargetInfo::getTargetID
virtual llvm::Optional< std::string > getTargetID() const
Returns the target ID if supported.
Definition: TargetInfo.h:1148
clang::TargetInfo::useObjCFPRetForRealType
bool useObjCFPRetForRealType(FloatModeKind T) const
Check whether the given real type should use the "fpret" flavor of Objective-C message passing on thi...
Definition: TargetInfo.h:865
clang::TargetInfo::getLongDoubleMangling
virtual const char * getLongDoubleMangling() const
Return the mangled code of long double.
Definition: TargetInfo.h:700
llvm::MutableArrayRef
Definition: LLVM.h:35
V
#define V(N, I)
Definition: ASTContext.h:3127
clang::TargetInfo::getSignedSizeType
IntType getSignedSizeType() const
Definition: TargetInfo.h:318
clang::TargetInfo::getTypeAlign
unsigned getTypeAlign(IntType T) const
Return the alignment (in bits) of the specified integer type enum.
Definition: TargetInfo.cpp:319
clang::TargetInfo::getLongLongAlign
unsigned getLongLongAlign() const
Definition: TargetInfo.h:463
clang::TargetInfo::getRegisterWidth
virtual unsigned getRegisterWidth() const
Return the "preferred" register width on this target.
Definition: TargetInfo.h:778
clang::TargetInfo::useZeroLengthBitfieldAlignment
bool useZeroLengthBitfieldAlignment() const
Check whether zero length bitfields should force alignment of the next member.
Definition: TargetInfo.h:816
clang::TargetInfo::getIntPtrType
IntType getIntPtrType() const
Definition: TargetInfo.h:342
clang::TargetInfo::CPUSpecificManglingCharacter
virtual char CPUSpecificManglingCharacter(StringRef Name) const
Definition: TargetInfo.h:1350
clang::TargetInfo::getDefaultCallingConv
virtual CallingConv getDefaultCallingConv() const
Gets the default calling convention for the given target and declaration context.
Definition: TargetInfo.h:1465
clang::TargetInfo::allowsLargerPreferedTypeAlignment
virtual bool allowsLargerPreferedTypeAlignment() const
Whether target allows to overalign ABI-specified preferred alignment.
Definition: TargetInfo.h:1515
clang::TargetInfo::getFloatWidth
unsigned getFloatWidth() const
getFloatWidth/Align/Format - Return the size/align/format of 'float'.
Definition: TargetInfo.h:663
clang::TransferrableTargetInfo::ShortAccumAlign
unsigned char ShortAccumAlign
Definition: TargetInfo.h:79
clang::TransferrableTargetInfo::LongFractWidth
unsigned char LongFractWidth
Definition: TargetInfo.h:84
clang::TargetInfo::ConstraintInfo::CI_ReadWrite
@ CI_ReadWrite
Definition: TargetInfo.h:979
clang::TransferrableTargetInfo::Float128Format
const llvm::fltSemantics * Float128Format
Definition: TargetInfo.h:113
clang::TargetInfo::isLittleEndian
bool isLittleEndian() const
Definition: TargetInfo.h:1455
clang::LangASMap
unsigned[(unsigned) LangAS::FirstTargetAddressSpace] LangASMap
The type of a lookup table which maps from language-specific address spaces to target-specific ones.
Definition: AddressSpaces.h:67
clang::TargetInfo::getLongFractScale
unsigned getLongFractScale() const
getLongFractScale - Return the number of fractional bits in a 'signed long _Fract' type.
Definition: TargetInfo.h:556
clang::TransferrableTargetInfo::FloatAlign
unsigned char FloatAlign
Definition: TargetInfo.h:71
clang::TargetInfo::getChar32Align
unsigned getChar32Align() const
Definition: TargetInfo.h:655
clang::TargetInfo::getAccumScale
unsigned getAccumScale() const
getAccumScale/IBits - Return the number of fractional/integral bits in a 'signed _Accum' type.
Definition: TargetInfo.h:504
clang::TargetInfo::getRealTypeByWidth
FloatModeKind getRealTypeByWidth(unsigned BitWidth, FloatModeKind ExplicitType) const
Return floating point type with specified width.
Definition: TargetInfo.cpp:285
clang::TargetInfo::ConstraintInfo::setRequiresImmediate
void setRequiresImmediate(int Min, int Max)
Definition: TargetInfo.h:1040
clang::OCLTK_ClkEvent
@ OCLTK_ClkEvent
Definition: TargetInfo.h:175
clang::TransferrableTargetInfo::LongFractAlign
unsigned char LongFractAlign
Definition: TargetInfo.h:84
clang::TargetInfo::getPtrDiffTypeV
virtual enum IntType getPtrDiffTypeV(unsigned AddrSpace) const
Definition: TargetInfo.h:1603
clang::TargetInfo::ConstraintInfo::TiedOperand
int TiedOperand
Definition: TargetInfo.h:985
clang::TargetInfo::getNormalizedGCCRegisterName
StringRef getNormalizedGCCRegisterName(StringRef Name, bool ReturnCanonical=false) const
Returns the "normalized" GCC register name.
Definition: TargetInfo.cpp:567
clang::TargetInfo::TargetInfo
TargetInfo(const llvm::Triple &T)
Definition: TargetInfo.cpp:28
clang::TargetInfo::getChar32Type
IntType getChar32Type() const
Definition: TargetInfo.h:349
clang::TargetInfo::AddlRegName::RegNum
const unsigned RegNum
Definition: TargetInfo.h:1162
clang::TargetInfo::getUnsignedAccumIBits
unsigned getUnsignedAccumIBits() const
Definition: TargetInfo.h:530
clang::TransferrableTargetInfo::LongLongWidth
unsigned char LongLongWidth
Definition: TargetInfo.h:76
clang::TargetInfo::SimdDefaultAlign
unsigned short SimdDefaultAlign
Definition: TargetInfo.h:208
clang::TargetInfo::getFloat128Align
unsigned getFloat128Align() const
Definition: TargetInfo.h:688
clang::TargetInfo::getMCountName
const char * getMCountName() const
Returns the name of the mcount instrumentation function.
Definition: TargetInfo.h:792
clang::TargetInfo::noSignedCharForObjCBool
void noSignedCharForObjCBool()
Definition: TargetInfo.h:804
clang::TargetInfo::getUnsignedAccumScale
unsigned getUnsignedAccumScale() const
getUnsignedAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned _Accum' ty...
Definition: TargetInfo.h:527
LangOptions.h
clang::TargetInfo::initFeatureMap
virtual bool initFeatureMap(llvm::StringMap< bool > &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector< std::string > &FeatureVec) const
Initialize the map with the default set of target features for the CPU this should include all legal ...
Definition: TargetInfo.cpp:467
clang::TargetInfo::getPointerAlign
uint64_t getPointerAlign(unsigned AddrSpace) const
Definition: TargetInfo.h:420
clang::TargetInfo::getMaxTLSAlign
unsigned getMaxTLSAlign() const
Return the maximum alignment (in bits) of a TLS variable.
Definition: TargetInfo.h:1383
clang::TargetInfo::isValidCPUName
virtual bool isValidCPUName(StringRef Name) const
brief Determine whether this TargetInfo supports the given CPU name.
Definition: TargetInfo.h:1236
clang::TransferrableTargetInfo::UseLeadingZeroLengthBitfield
unsigned UseLeadingZeroLengthBitfield
Whether zero length bitfield alignment is respected if they are the leading members.
Definition: TargetInfo.h:158
clang::TargetInfo::hasFloat128Type
virtual bool hasFloat128Type() const
Determine whether the __float128 type is supported on this target.
Definition: TargetInfo.h:597
clang::TransferrableTargetInfo::Ibm128Align
unsigned char Ibm128Align
Definition: TargetInfo.h:73
clang::TargetInfo::CCCR_OK
@ CCCR_OK
Definition: TargetInfo.h:1473
clang::TargetInfo::getMaxPointerWidth
virtual uint64_t getMaxPointerWidth() const
Return the maximum width of pointers on this target.
Definition: TargetInfo.h:425
clang::OCLTK_Queue
@ OCLTK_Queue
Definition: TargetInfo.h:179
clang::TargetInfo::getPlatformMinVersion
VersionTuple getPlatformMinVersion() const
Retrieve the minimum desired version of the platform, to which the program should be compiled.
Definition: TargetInfo.h:1452
clang::TargetInfo::getWCharWidth
unsigned getWCharWidth() const
getWCharWidth/Align - Return the size of 'wchar_t' for this target, in bits.
Definition: TargetInfo.h:644
clang::TargetInfo::getLongAccumAlign
unsigned getLongAccumAlign() const
Definition: TargetInfo.h:478
clang::TargetInfo::getMaxAlignedAttribute
unsigned getMaxAlignedAttribute() const
Get the maximum alignment in bits for a static variable with aligned attribute.
Definition: TargetInfo.h:834
clang::TargetInfo::getGCCRegAliases
virtual ArrayRef< GCCRegAlias > getGCCRegAliases() const =0
clang::TargetInfo::NoAsmVariants
bool NoAsmVariants
Definition: TargetInfo.h:196
clang::TransferrableTargetInfo::HalfWidth
unsigned char HalfWidth
Definition: TargetInfo.h:69
clang::TargetInfo::validateCpuIs
virtual bool validateCpuIs(StringRef Name) const
Definition: TargetInfo.h:1341
clang::TargetInfo::getTargetBuiltins
virtual ArrayRef< Builtin::Info > getTargetBuiltins() const =0
Return information about target-specific builtins for the current primary target, and info about whic...
clang::getLangASFromTargetAS
LangAS getLangASFromTargetAS(unsigned TargetAS)
Definition: AddressSpaces.h:80
clang::TargetInfo::getIbm128Mangling
virtual const char * getIbm128Mangling() const
Return the mangled code of __ibm128.
Definition: TargetInfo.h:706
clang::TargetInfo::getFloatFormat
const llvm::fltSemantics & getFloatFormat() const
Definition: TargetInfo.h:665
clang::CallingConv
CallingConv
CallingConv - Specifies the calling convention that a function uses.
Definition: Specifiers.h:263
clang::TargetInfo::setFPMath
virtual bool setFPMath(StringRef Name)
Use the specified unit for FP math.
Definition: TargetInfo.h:1261
clang::TargetInfo::getNullPointerValue
virtual uint64_t getNullPointerValue(LangAS AddrSpace) const
Get integer value for null pointer.
Definition: TargetInfo.h:431
clang::TargetInfo::isValidTuneCPUName
virtual bool isValidTuneCPUName(StringRef Name) const
brief Determine whether this TargetInfo supports the given CPU name for
Definition: TargetInfo.h:1242
clang::TargetInfo::resetDataLayout
void resetDataLayout(StringRef DL, const char *UserLabelPrefix="")
Definition: TargetInfo.cpp:159
clang::TargetInfo::getFloat128Format
const llvm::fltSemantics & getFloat128Format() const
Definition: TargetInfo.h:689
clang::TargetInfo::isTLSSupported
bool isTLSSupported() const
Whether the target supports thread-local storage.
Definition: TargetInfo.h:1375
clang::TargetInfo::supportsTargetAttributeTune
virtual bool supportsTargetAttributeTune() const
brief Determine whether this TargetInfo supports tune in target attribute.
Definition: TargetInfo.h:1247
clang::TargetInfo::GCCRegAlias
Definition: TargetInfo.h:1155
clang::TargetInfo::getCUDABuiltinAddressSpace
virtual LangAS getCUDABuiltinAddressSpace(unsigned AS) const
Map from the address space field in builtin description strings to the language address space.
Definition: TargetInfo.h:1428
clang::TargetInfo::CreateTargetInfo
static TargetInfo * CreateTargetInfo(DiagnosticsEngine &Diags, const std::shared_ptr< TargetOptions > &Opts)
Construct a target for the given options.
Definition: Targets.cpp:668
clang::TargetInfo::getHalfFormat
const llvm::fltSemantics & getHalfFormat() const
Definition: TargetInfo.h:660
clang::TargetInfo::getUnwindWordWidth
virtual unsigned getUnwindWordWidth() const
Definition: TargetInfo.h:775
clang::TargetInfo::getLeastIntTypeByWidth
virtual IntType getLeastIntTypeByWidth(unsigned BitWidth, bool IsSigned) const
Return the smallest integer type with at least the specified width.
Definition: TargetInfo.cpp:270
clang::TargetInfo::validateCPUSpecificCPUDispatch
virtual bool validateCPUSpecificCPUDispatch(StringRef Name) const
Definition: TargetInfo.h:1345
clang::TargetInfo::getDoubleWidth
unsigned getDoubleWidth() const
getDoubleWidth/Align/Format - Return the size/align/format of 'double'.
Definition: TargetInfo.h:673
clang::TargetInfo::ConstraintInfo::getConstraintStr
const std::string & getConstraintStr() const
Definition: TargetInfo.h:1003
clang::TransferrableTargetInfo::ShortAccumWidth
unsigned char ShortAccumWidth
Definition: TargetInfo.h:79
clang::TargetInfo::VLASupported
bool VLASupported
Definition: TargetInfo.h:195
clang::TransferrableTargetInfo::Char16Type
IntType Char16Type
Definition: TargetInfo.h:132
clang::TargetInfo::HasStrictFP
bool HasStrictFP
Definition: TargetInfo.h:205
clang::TargetInfo::HasRISCVVTypes
unsigned HasRISCVVTypes
Definition: TargetInfo.h:230
clang::CodeGenOptions
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
Definition: CodeGenOptions.h:49
clang::TargetInfo::validateOutputSize
virtual bool validateOutputSize(const llvm::StringMap< bool > &FeatureMap, StringRef, unsigned) const
Definition: TargetInfo.h:1091
clang::TargetInfo::getOpenCLTypeAddrSpace
virtual LangAS getOpenCLTypeAddrSpace(OpenCLTypeKind TK) const
Get address space for OpenCL type.
Definition: TargetInfo.cpp:487
clang::TransferrableTargetInfo::AccumAlign
unsigned char AccumAlign
Definition: TargetInfo.h:80
clang::TargetInfo::ConstraintInfo::earlyClobber
bool earlyClobber()
Definition: TargetInfo.h:1006
clang::TargetInfo::AAPCSABIBuiltinVaList
@ AAPCSABIBuiltinVaList
__builtin_va_list as defined by ARM AAPCS ABI http://infocenter.arm.com
Definition: TargetInfo.h:292
clang::FloatModeKind::Double
@ Double
clang::TargetInfo::getLongAccumScale
unsigned getLongAccumScale() const
getLongAccumScale/IBits - Return the number of fractional/integral bits in a 'signed long _Accum' typ...
Definition: TargetInfo.h:509
clang::TransferrableTargetInfo::BFloat16Align
unsigned char BFloat16Align
Definition: TargetInfo.h:70
clang::TargetInfo::HasFloat128
bool HasFloat128
Definition: TargetInfo.h:199
clang::TargetInfo::getAccumWidth
unsigned getAccumWidth() const
getAccumWidth/Align - Return the size of 'signed _Accum' and 'unsigned _Accum' for this target,...
Definition: TargetInfo.h:472
clang::TransferrableTargetInfo::Ibm128Format
const llvm::fltSemantics * Ibm128Format
Definition: TargetInfo.h:113
clang::FloatModeKind::NoFloat
@ NoFloat
TargetCXXABI.h
clang::CC_C
@ CC_C
Definition: Specifiers.h:264
clang::TargetInfo::BranchProtectionInfo::BranchTargetEnforcement
bool BranchTargetEnforcement
Definition: TargetInfo.h:1289
clang::TargetInfo::ConstraintInfo::ConstraintStr
std::string ConstraintStr
Definition: TargetInfo.h:993
clang::TargetInfo::isVLASupported
bool isVLASupported() const
Whether target supports variable-length arrays.
Definition: TargetInfo.h:1386
clang::TargetInfo::getLongFractWidth
unsigned getLongFractWidth() const
getLongFractWidth/Align - Return the size of 'signed long _Fract' and 'unsigned long _Fract' for this...
Definition: TargetInfo.h:492
clang::LangAS
LangAS
Defines the address space values used by the address space qualifier of QualType.
Definition: AddressSpaces.h:25
clang::TargetInfo::defaultsToAIXPowerAlignment
virtual bool defaultsToAIXPowerAlignment() const
Whether target defaults to the power alignment rules of AIX.
Definition: TargetInfo.h:1518
clang::TargetInfo::hasIbm128Type
virtual bool hasIbm128Type() const
Determine whether the __ibm128 type is supported on this target.
Definition: TargetInfo.h:606
clang::TargetInfo::getTriple
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
Definition: TargetInfo.h:1143
clang::TargetInfo::getSizeType
IntType getSizeType() const
Definition: TargetInfo.h:317
clang::TargetInfo::BranchProtectionInfo
Definition: TargetInfo.h:1284
clang::TargetInfo::AddlRegName
Definition: TargetInfo.h:1160
clang::TargetInfo::getUInt16Type
IntType getUInt16Type() const
Definition: TargetInfo.h:355
clang::TargetInfo::getTargetDefines
virtual void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const =0
===-— Other target property query methods -----------------------—===//
clang::TargetInfo::ConstraintInfo::allowsRegister
bool allowsRegister() const
Definition: TargetInfo.h:1007
clang::TargetInfo::getInt16Type
IntType getInt16Type() const
Definition: TargetInfo.h:354
clang::TargetInfo::getBoolAlign
unsigned getBoolAlign() const
Return the alignment of '_Bool' and C++ 'bool' for this target.
Definition: TargetInfo.h:437
clang::TargetInfo::UserLabelPrefix
const char * UserLabelPrefix
Definition: TargetInfo.h:210
clang::TransferrableTargetInfo::PtrDiffType
IntType PtrDiffType
Definition: TargetInfo.h:131
clang::TargetInfo::hasAlignMac68kSupport
bool hasAlignMac68kSupport() const
Check whether this target support '#pragma options align=mac68k'.
Definition: TargetInfo.h:843
clang::TargetInfo::getUIntPtrType
IntType getUIntPtrType() const
Definition: TargetInfo.h:343
clang::TargetInfo::getBFloat16Width
unsigned getBFloat16Width() const
getBFloat16Width/Align/Format - Return the size/align/format of '__bf16'.
Definition: TargetInfo.h:668
clang::TargetInfo::setFeatureEnabled
virtual void setFeatureEnabled(llvm::StringMap< bool > &Features, StringRef Name, bool Enabled) const
Enable or disable a specific target feature; the feature name must be valid.
Definition: TargetInfo.h:1273
clang::TargetInfo::HasLongDouble
bool HasLongDouble
Definition: TargetInfo.h:203
clang::TargetInfo::getTargetOpts
TargetOptions & getTargetOpts() const
Retrieve the target options.
Definition: TargetInfo.h:258
clang::TargetInfo::ConstraintInfo::Flags
unsigned Flags
Definition: TargetInfo.h:984
clang::TargetOptions::ForceEnableInt128
bool ForceEnableInt128
If given, enables support for __int128_t and __uint128_t types.
Definition: TargetOptions.h:72
clang::TargetInfo::ConstraintInfo::setRequiresImmediate
void setRequiresImmediate(llvm::ArrayRef< int > Exacts)
Definition: TargetInfo.h:1046
clang::TargetInfo::getTypeName
static const char * getTypeName(IntType T)
Return the user string for the specified integer type enum.
Definition: TargetInfo.cpp:178
clang::OCLTK_Event
@ OCLTK_Event
Definition: TargetInfo.h:176
clang::TargetInfo::ConstraintInfo::Max
int Max
Definition: TargetInfo.h:988
clang::TargetInfo::validateInputConstraint
bool validateInputConstraint(MutableArrayRef< ConstraintInfo > OutputConstraints, ConstraintInfo &info) const
Definition: TargetInfo.cpp:705
clang::TargetInfo::TLSSupported
bool TLSSupported
Definition: TargetInfo.h:194
clang::TargetInfo::~TargetInfo
virtual ~TargetInfo()
Definition: TargetInfo.cpp:157
clang::TargetInfo::ConstraintInfo::isConstrained
bool isConstrained
Definition: TargetInfo.h:989
clang::TargetInfo::HasIbm128
bool HasIbm128
Definition: TargetInfo.h:202
clang::TargetInfo::getUnsignedFractScale
unsigned getUnsignedFractScale() const
getUnsignedFractScale - Return the number of fractional bits in a 'unsigned _Fract' type.
Definition: TargetInfo.h:567
clang::TargetInfo::hasBuiltinAtomic
virtual bool hasBuiltinAtomic(uint64_t AtomicSizeInBits, uint64_t AlignmentInBits) const
Returns true if the given target supports lock-free atomic operations at the specified width and alig...
Definition: TargetInfo.h:734
clang::TargetInfo::validateTarget
virtual bool validateTarget(DiagnosticsEngine &Diags) const
Check the target is valid after it is fully initialized.
Definition: TargetInfo.h:1580
clang::TargetInfo::ConstraintInfo::hasMatchingInput
bool hasMatchingInput() const
Return true if this output operand has a matching (tied) input operand.
Definition: TargetInfo.h:1012
clang::TargetInfo::getIntMaxTWidth
unsigned getIntMaxTWidth() const
Return the size of intmax_t and uintmax_t for this target, in bits.
Definition: TargetInfo.h:767
clang::TargetInfo::PlatformName
StringRef PlatformName
Definition: TargetInfo.h:217
clang::TransferrableTargetInfo::ProcessIDType
IntType ProcessIDType
Definition: TargetInfo.h:133
clang::TargetInfo::getCPUCacheLineSize
virtual Optional< unsigned > getCPUCacheLineSize() const
Definition: TargetInfo.h:1366
TargetOptions.h
clang::TargetInfo::isValidClobber
bool isValidClobber(StringRef Name) const
Returns whether the passed in string is a valid clobber in an inline asm statement.
Definition: TargetInfo.cpp:514
clang::TargetInfo::BigEndian
bool BigEndian
Definition: TargetInfo.h:193
clang::TransferrableTargetInfo::DoubleWidth
unsigned char DoubleWidth
Definition: TargetInfo.h:72
clang::TargetInfo::MCountName
const char * MCountName
Definition: TargetInfo.h:211
clang::TargetInfo::getChar32Width
unsigned getChar32Width() const
getChar32Width/Align - Return the size of 'char32_t' for this target, in bits.
Definition: TargetInfo.h:654
clang::TransferrableTargetInfo::NoInt
@ NoInt
Definition: TargetInfo.h:117
clang::TargetInfo::AddrSpaceMap
const LangASMap * AddrSpaceMap
Definition: TargetInfo.h:214
clang::TargetInfo::getShortAccumScale
unsigned getShortAccumScale() const
getShortAccumScale/IBits - Return the number of fractional/integral bits in a 'signed short _Accum' t...
Definition: TargetInfo.h:497
clang::TargetInfo::getShortAccumAlign
unsigned getShortAccumAlign() const
Definition: TargetInfo.h:468
clang::TargetInfo::getWIntType
IntType getWIntType() const
Definition: TargetInfo.h:347
clang::TargetInfo::ConstraintInfo::hasTiedOperand
bool hasTiedOperand() const
Return true if this input operand is a matching constraint that ties it to an output operand.
Definition: TargetInfo.h:1019
llvm::ArrayRef
Definition: LLVM.h:34
clang::TargetInfo::adjustTargetOptions
virtual void adjustTargetOptions(const CodeGenOptions &CGOpts, TargetOptions &TargetOpts) const
Adjust target options based on codegen options.
Definition: TargetInfo.h:1201
Value
Value
Definition: UninitializedValues.cpp:102
clang::TransferrableTargetInfo::LongDoubleFormat
const llvm::fltSemantics * LongDoubleFormat
Definition: TargetInfo.h:113
clang::TargetInfo::getFloat128Mangling
virtual const char * getFloat128Mangling() const
Return the mangled code of __float128.
Definition: TargetInfo.h:703
clang::TargetInfo::getChar16Width
unsigned getChar16Width() const
getChar16Width/Align - Return the size of 'char16_t' for this target, in bits.
Definition: TargetInfo.h:649
clang::TargetInfo::CharPtrBuiltinVaList
@ CharPtrBuiltinVaList
typedef char* __builtin_va_list;
Definition: TargetInfo.h:267
clang::TargetInfo::getCPUSpecificCPUDispatchFeatures
virtual void getCPUSpecificCPUDispatchFeatures(StringRef Name, llvm::SmallVectorImpl< StringRef > &Features) const
Definition: TargetInfo.h:1358
clang::TargetInfo::getIbm128Width
unsigned getIbm128Width() const
getIbm128Width/Align/Format - Return the size/align/format of '__ibm128'.
Definition: TargetInfo.h:695
clang::TargetInfo::hasNoAsmVariants
bool hasNoAsmVariants() const
Return true if {|} are normal characters in the asm string.
Definition: TargetInfo.h:1401
clang::TransferrableTargetInfo::ShortAccumScale
unsigned char ShortAccumScale
Definition: TargetInfo.h:100
clang::TargetInfo::getMinGlobalAlign
virtual unsigned getMinGlobalAlign(uint64_t) const
getMinGlobalAlign - Return the minimum alignment of a global variable, unless its alignment is explic...
Definition: TargetInfo.h:631
clang::TargetInfo::checkArithmeticFenceSupported
virtual bool checkArithmeticFenceSupported() const
Controls if __arithmetic_fence is supported in the targeted backend.
Definition: TargetInfo.h:1461
clang::TargetInfo::validateOpenCLTarget
virtual bool validateOpenCLTarget(const LangOptions &Opts, DiagnosticsEngine &Diags) const
Check that OpenCL target has valid options setting based on OpenCL version.
Definition: Targets.cpp:743
clang::TargetInfo::getUnsignedLongAccumIBits
unsigned getUnsignedLongAccumIBits() const
Definition: TargetInfo.h:540
clang::OCLTK_Sampler
@ OCLTK_Sampler
Definition: TargetInfo.h:181
LLVM.h
clang::TargetInfo::ConstraintInfo::getTiedOperand
unsigned getTiedOperand() const
Definition: TargetInfo.h:1020
clang::TargetInfo::getUIntMaxType
IntType getUIntMaxType() const
Definition: TargetInfo.h:333
clang::TargetInfo::MaxOpenCLWorkGroupSize
unsigned MaxOpenCLWorkGroupSize
Definition: TargetInfo.h:236
clang::TargetInfo::getStaticInitSectionSpecifier
virtual const char * getStaticInitSectionSpecifier() const
Return the section to use for C++ static initialization functions.
Definition: TargetInfo.h:1414
clang::TargetInfo::supportAllOpenCLOpts
virtual void supportAllOpenCLOpts(bool V=true)
Definition: TargetInfo.h:1523
clang::TargetInfo::getIntMaxType
IntType getIntMaxType() const
Definition: TargetInfo.h:332
clang::TransferrableTargetInfo::DoubleFormat
const llvm::fltSemantics * DoubleFormat
Definition: TargetInfo.h:113
clang::TargetInfo::MaxAtomicInlineWidth
unsigned char MaxAtomicInlineWidth
Definition: TargetInfo.h:207
clang::TargetInfo::setCommandLineOpenCLOpts
virtual void setCommandLineOpenCLOpts()
Set supported OpenCL extensions as written on command line.
Definition: TargetInfo.h:1530
clang::TargetInfo::getZeroLengthBitfieldBoundary
unsigned getZeroLengthBitfieldBoundary() const
Get the fixed alignment value in bits for a member that follows a zero length bitfield.
Definition: TargetInfo.h:828
clang::TargetInfo::getFloat128Width
unsigned getFloat128Width() const
getFloat128Width/Align/Format - Return the size/align/format of '__float128'.
Definition: TargetInfo.h:687
clang::TargetInfo::hasPS4DLLImportExport
virtual bool hasPS4DLLImportExport() const
Definition: TargetInfo.h:1185
clang::TargetInfo::fillValidTuneCPUList
virtual void fillValidTuneCPUList(SmallVectorImpl< StringRef > &Values) const
Fill a SmallVectorImpl with the valid values for tuning CPU.
Definition: TargetInfo.h:1231
clang::TargetInfo::ConstraintInfo::isReadWrite
bool isReadWrite() const
Definition: TargetInfo.h:1005
clang::TargetInfo::hasSjLjLowering
virtual bool hasSjLjLowering() const
Controls if __builtin_longjmp / __builtin_setjmp can be lowered to llvm.eh.sjlj.longjmp / llvm....
Definition: TargetInfo.h:1502
clang::TargetInfo::getFractWidth
unsigned getFractWidth() const
getFractWidth/Align - Return the size of 'signed _Fract' and 'unsigned _Fract' for this target,...
Definition: TargetInfo.h:487
clang::TargetInfo::getBFloat16Align
unsigned getBFloat16Align() const
Definition: TargetInfo.h:669
clang::TargetInfo::ConstraintInfo::setRequiresImmediate
void setRequiresImmediate()
Definition: TargetInfo.h:1055
clang::TargetInfo::getAddressSpaceMap
const LangASMap & getAddressSpaceMap() const
Definition: TargetInfo.h:1418
clang::TargetInfo::getSupportedOpenCLOpts
const llvm::StringMap< bool > & getSupportedOpenCLOpts() const
Get const supported OpenCL extensions and optional core features.
Definition: TargetInfo.h:1551
clang::TransferrableTargetInfo::MaxVectorAlign
unsigned MaxVectorAlign
Definition: TargetInfo.h:109
clang::TargetInfo::validateInputSize
virtual bool validateInputSize(const llvm::StringMap< bool > &FeatureMap, StringRef, unsigned) const
Definition: TargetInfo.h:1097
clang::TargetInfo::getPointerWidthV
virtual uint64_t getPointerWidthV(unsigned AddrSpace) const
Definition: TargetInfo.h:1597
clang::TargetInfo::getIbm128Format
const llvm::fltSemantics & getIbm128Format() const
Definition: TargetInfo.h:697
clang::TargetInfo::getIntAlign
unsigned getIntAlign() const
Definition: TargetInfo.h:453
clang::TransferrableTargetInfo::IntAlign
unsigned char IntAlign
Definition: TargetInfo.h:68
clang::TargetInfo::ConstraintInfo
Definition: TargetInfo.h:974
clang::TransferrableTargetInfo::UseBitFieldTypeAlignment
unsigned UseBitFieldTypeAlignment
Control whether the alignment of bit-field types is respected when laying out structures.
Definition: TargetInfo.h:146
clang::TargetInfo::useExplicitBitFieldAlignment
bool useExplicitBitFieldAlignment() const
Check whether explicit bitfield alignment attributes should be.
Definition: TargetInfo.h:838
clang::LangOptions
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:58
clang::TransferrableTargetInfo
Fields controlling how types are laid out in memory; these may need to be copied for targets like AMD...
Definition: TargetInfo.h:65
clang::TransferrableTargetInfo::BoolWidth
unsigned char BoolWidth
Definition: TargetInfo.h:67
clang::TargetInfo::getIntTypeByWidth
virtual IntType getIntTypeByWidth(unsigned BitWidth, bool IsSigned) const
Return integer type with specified width.
Definition: TargetInfo.cpp:255
clang::TargetInfo::getLargeArrayMinWidth
unsigned getLargeArrayMinWidth() const
Definition: TargetInfo.h:720
clang::TargetInfo::handleAsmEscapedChar
virtual llvm::Optional< std::string > handleAsmEscapedChar(char C) const
Replace some escaped characters with another string based on target-specific rules.
Definition: TargetInfo.h:1129
clang::TransferrableTargetInfo::IntType
IntType
===-— Target Data Type Query Methods ----------------------------—===//
Definition: TargetInfo.h:116
clang::TargetInfo::getShortAccumIBits
unsigned getShortAccumIBits() const
Definition: TargetInfo.h:498
clang::TargetInfo::getChar16Type
IntType getChar16Type() const
Definition: TargetInfo.h:348
clang::FloatModeKind::Ibm128
@ Ibm128
clang::TargetInfo::validateBranchProtection
virtual bool validateBranchProtection(StringRef Spec, BranchProtectionInfo &BPI, StringRef &Err) const
Determine if this TargetInfo supports the given branch protection specification.
Definition: TargetInfo.h:1294
clang::TargetInfo::handleTargetFeatures
virtual bool handleTargetFeatures(std::vector< std::string > &Features, DiagnosticsEngine &Diags)
Perform initialization based on the user configured set of features (e.g., +sse4).
Definition: TargetInfo.h:1312
clang::TargetInfo::getShortWidth
unsigned getShortWidth() const
Return the size of 'signed short' and 'unsigned short' for this target, in bits.
Definition: TargetInfo.h:444
clang::TargetInfo::doUnsignedFixedPointTypesHavePadding
bool doUnsignedFixedPointTypesHavePadding() const
In the event this target uses the same number of fractional bits for its unsigned types as it does wi...
Definition: TargetInfo.h:382
clang::LangAS::Default
@ Default
clang::TransferrableTargetInfo::FloatWidth
unsigned char FloatWidth
Definition: TargetInfo.h:71
clang::LangOptions::SignReturnAddressKeyKind
SignReturnAddressKeyKind
Definition: LangOptions.h:269
clang::TargetInfo::getChar16Align
unsigned getChar16Align() const
Definition: TargetInfo.h:650
clang::TargetInfo::multiVersionSortPriority
virtual unsigned multiVersionSortPriority(StringRef Name) const
Definition: TargetInfo.h:1335
clang::TargetInfo::isValidFeatureName
virtual bool isValidFeatureName(StringRef Feature) const
Determine whether this TargetInfo supports the given feature.
Definition: TargetInfo.h:1280
clang::TargetInfo::getGridValue
virtual const llvm::omp::GV & getGridValue() const
Definition: TargetInfo.h:1442
clang::TargetInfo::setMaxAtomicWidth
virtual void setMaxAtomicWidth()
Set the maximum inline or promote width lock-free atomic operation for the given target.
Definition: TargetInfo.h:731
clang::TransferrableTargetInfo::HalfFormat
const llvm::fltSemantics * HalfFormat
Definition: TargetInfo.h:112
clang::OpenCLTypeKind
OpenCLTypeKind
OpenCL type kinds.
Definition: TargetInfo.h:173
clang::TargetInfo::ConstraintInfo::setRequiresImmediate
void setRequiresImmediate(int Exact)
Definition: TargetInfo.h:1051
clang::TargetInfo::ComplexLongDoubleUsesFP2Ret
unsigned ComplexLongDoubleUsesFP2Ret
Definition: TargetInfo.h:222
clang::TargetInfo::ProgramAddrSpace
unsigned ProgramAddrSpace
Definition: TargetInfo.h:215
clang::TargetInfo::getDoubleAlign
unsigned getDoubleAlign() const
Definition: TargetInfo.h:674
clang::TargetInfo::getTypeWidth
unsigned getTypeWidth(IntType T) const
Return the width (in bits) of the specified integer type enum.
Definition: TargetInfo.cpp:239
clang::TargetInfo::HasFloat16
bool HasFloat16
Definition: TargetInfo.h:200
clang
Definition: CalledOnceCheck.h:17
clang::TargetInfo::hasStrictFP
virtual bool hasStrictFP() const
Determine whether constrained floating point is supported on this target.
Definition: TargetInfo.h:616
clang::TargetInfo::supportsIFunc
bool supportsIFunc() const
Identify whether this target supports IFuncs.
Definition: TargetInfo.h:1327
clang::TargetInfo::getTypeFormatModifier
static const char * getTypeFormatModifier(IntType T)
Return the printf format modifier for the specified integer type enum.
Definition: TargetInfo.cpp:221
clang::TargetInfo::setAuxTarget
virtual void setAuxTarget(const TargetInfo *Aux)
Definition: TargetInfo.h:1589
clang::TransferrableTargetInfo::Int16Type
IntType Int16Type
Definition: TargetInfo.h:132
clang::FloatModeKind::Float
@ Float
clang::TargetInfo::getMaxAtomicPromoteWidth
unsigned getMaxAtomicPromoteWidth() const
Return the maximum width lock-free atomic operation which will ever be supported for the given target...
Definition: TargetInfo.h:725
clang::TargetInfo::allowDebugInfoForExternalRef
virtual bool allowDebugInfoForExternalRef() const
Whether target allows debuginfo types for decl only variables/functions.
Definition: TargetInfo.h:1592
clang::TargetInfo::getPointerWidth
uint64_t getPointerWidth(unsigned AddrSpace) const
Return the width of pointers on this target, for the specified address space.
Definition: TargetInfo.h:417
clang::FloatModeKind::Float128
@ Float128
clang::TargetInfo::ConstraintInfo::CI_HasMatchingInput
@ CI_HasMatchingInput
Definition: TargetInfo.h:980
clang::TargetInfo::hasFeatureEnabled
virtual bool hasFeatureEnabled(const llvm::StringMap< bool > &Features, StringRef Name) const
Check if target has a given feature enabled.
Definition: TargetInfo.h:1266
clang::TargetInfo::getPointerAlignV
virtual uint64_t getPointerAlignV(unsigned AddrSpace) const
Definition: TargetInfo.h:1600
clang::TransferrableTargetInfo::SignedInt
@ SignedInt
Definition: TargetInfo.h:122
clang::TransferrableTargetInfo::MinGlobalAlign
unsigned char MinGlobalAlign
Definition: TargetInfo.h:106
clang::TransferrableTargetInfo::UnsignedLong
@ UnsignedLong
Definition: TargetInfo.h:125
clang::TransferrableTargetInfo::LongAccumWidth
unsigned char LongAccumWidth
Definition: TargetInfo.h:81
clang::TransferrableTargetInfo::SignedLongLong
@ SignedLongLong
Definition: TargetInfo.h:126
clang::TargetInfo::getSigAtomicType
IntType getSigAtomicType() const
Definition: TargetInfo.h:358
clang::TargetInfo::ConstraintInfo::requiresImmediateConstant
bool requiresImmediateConstant() const
Definition: TargetInfo.h:1025
clang::TransferrableTargetInfo::AccumScale
unsigned char AccumScale
Definition: TargetInfo.h:101
clang::TargetInfo::getUnsignedPtrDiffType
IntType getUnsignedPtrDiffType(unsigned AddrSpace) const
Definition: TargetInfo.h:339
clang::TargetInfo::CCK_MicrosoftWin64
@ CCK_MicrosoftWin64
Definition: TargetInfo.h:1495
clang::TargetInfo::CCCR_Error
@ CCCR_Error
Definition: TargetInfo.h:1476
clang::TransferrableTargetInfo::PaddingOnUnsignedFixedPoint
bool PaddingOnUnsignedFixedPoint
Definition: TargetInfo.h:91
clang::TargetInfo::getPlatformName
StringRef getPlatformName() const
Retrieve the name of the platform as it is used in the availability attribute.
Definition: TargetInfo.h:1448
clang::TargetInfo::supportsMultiVersioning
bool supportsMultiVersioning() const
Identify whether this target supports multiversioning of functions, which requires support for cpu_su...
Definition: TargetInfo.h:1324
clang::TargetInfo::getUnsignedShortFractScale
unsigned getUnsignedShortFractScale() const
getUnsignedShortFractScale - Return the number of fractional bits in a 'unsigned short _Fract' type.
Definition: TargetInfo.h:560
clang::TargetInfo::ConstraintInfo::CI_AllowsRegister
@ CI_AllowsRegister
Definition: TargetInfo.h:978
clang::TargetInfo::getLargeArrayAlign
unsigned getLargeArrayAlign() const
Definition: TargetInfo.h:721
clang::TargetInfo::getGCCRegNames
virtual ArrayRef< const char * > getGCCRegNames() const =0
clang::TargetInfo::getCharAlign
unsigned getCharAlign() const
Definition: TargetInfo.h:440
clang::TargetInfo::convertConstraint
virtual std::string convertConstraint(const char *&Constraint) const
Definition: TargetInfo.h:1120
clang::TargetInfo::getEHDataRegisterNumber
virtual int getEHDataRegisterNumber(unsigned RegNo) const
Return the register number that __builtin_eh_return_regno would return with the specified argument.
Definition: TargetInfo.h:1409
clang::TargetInfo::ConstraintInfo::isValidAsmImmediate
bool isValidAsmImmediate(const llvm::APInt &Value) const
Definition: TargetInfo.h:1028
clang::TargetInfo::getShortFractAlign
unsigned getShortFractAlign() const
Definition: TargetInfo.h:483
clang::TargetInfo::hasAArch64SVETypes
bool hasAArch64SVETypes() const
Returns whether or not the AArch64 SVE built-in types are available on this target.
Definition: TargetInfo.h:927
clang::TargetOptions::SDKVersion
llvm::VersionTuple SDKVersion
The version of the SDK which was used during the compilation.
Definition: TargetOptions.h:93
clang::TargetInfo::getAccumAlign
unsigned getAccumAlign() const
Definition: TargetInfo.h:473
clang::TargetInfo::getInt64Type
IntType getInt64Type() const
Definition: TargetInfo.h:350
clang::TargetInfo::getShortFractScale
unsigned getShortFractScale() const
getShortFractScale - Return the number of fractional bits in a 'signed short _Fract' type.
Definition: TargetInfo.h:548
clang::TargetInfo::getHalfAlign
unsigned getHalfAlign() const
Definition: TargetInfo.h:659
clang::TargetInfo::hasLegalHalfType
virtual bool hasLegalHalfType() const
Determine whether _Float16 is supported on this target.
Definition: TargetInfo.h:594
clang::TargetOptions
Options for controlling the target.
Definition: TargetOptions.h:26
clang::OCLTK_ReserveID
@ OCLTK_ReserveID
Definition: TargetInfo.h:180
clang::TargetInfo::getBFloat16Format
const llvm::fltSemantics & getBFloat16Format() const
Definition: TargetInfo.h:670
clang::TargetInfo::getLongFractAlign
unsigned getLongFractAlign() const
Definition: TargetInfo.h:493
clang::TargetInfo::ConstraintInfo::CI_None
@ CI_None
Definition: TargetInfo.h:976
clang::TargetInfo::SSERegParmMax
unsigned char SSERegParmMax
Definition: TargetInfo.h:212
llvm::SmallVectorImpl
Definition: LLVM.h:39
clang::OCLTK_Pipe
@ OCLTK_Pipe
Definition: TargetInfo.h:178
clang::TargetInfo::getGCCAddlRegNames
virtual ArrayRef< AddlRegName > getGCCAddlRegNames() const
Definition: TargetInfo.h:1608
clang::TargetInfo::ConstraintInfo::setTiedOperand
void setTiedOperand(unsigned N, ConstraintInfo &Output)
Indicate that this is an input operand that is tied to the specified output operand.
Definition: TargetInfo.h:1063
clang::TargetInfo::setABI
virtual bool setABI(const std::string &Name)
Use the specified ABI.
Definition: TargetInfo.h:1254
clang::TransferrableTargetInfo::SignedShort
@ SignedShort
Definition: TargetInfo.h:120
clang::TargetInfo::isSPRegName
virtual bool isSPRegName(StringRef) const
Definition: TargetInfo.h:961
clang::TargetInfo::hasBFloat16Type
virtual bool hasBFloat16Type() const
Determine whether the _BFloat16 type is supported on this target.
Definition: TargetInfo.h:603
clang::TargetInfo::AArch64ABIBuiltinVaList
@ AArch64ABIBuiltinVaList
__builtin_va_list as defined by the AArch64 ABI http://infocenter.arm.com/help/topic/com....
Definition: TargetInfo.h:274
clang::TransferrableTargetInfo::NewAlign
unsigned short NewAlign
Definition: TargetInfo.h:108
clang::TargetInfo::shouldDLLImportComdatSymbols
virtual bool shouldDLLImportComdatSymbols() const
Does this target aim for semantic compatibility with Microsoft C++ code using dllimport/export attrib...
Definition: TargetInfo.h:1179
clang::TransferrableTargetInfo::IntWidth
unsigned char IntWidth
Definition: TargetInfo.h:68
clang::TransferrableTargetInfo::WCharType
IntType WCharType
Definition: TargetInfo.h:131
clang::TargetInfo::ConstraintInfo::ImmSet
llvm::SmallSet< int, 4 > ImmSet
Definition: TargetInfo.h:991
clang::TransferrableTargetInfo::PointerWidth
unsigned char PointerWidth
Definition: TargetInfo.h:66
clang::TargetInfo::PowerABIBuiltinVaList
@ PowerABIBuiltinVaList
__builtin_va_list as defined by the Power ABI: https://www.power.org /resources/downloads/Power-Arch-...
Definition: TargetInfo.h:283
clang::TargetInfo::CallingConvCheckResult
CallingConvCheckResult
Definition: TargetInfo.h:1472
clang::MacroBuilder
Definition: MacroBuilder.h:23
clang::TargetInfo::getWCharType
IntType getWCharType() const
Definition: TargetInfo.h:346
clang::TargetInfo::CallingConvKind
CallingConvKind
Definition: TargetInfo.h:1492
clang::TargetInfo::resolveSymbolicName
bool resolveSymbolicName(const char *&Name, ArrayRef< ConstraintInfo > OutputConstraints, unsigned &Index) const
Definition: TargetInfo.cpp:682
clang::TargetInfo::validateGlobalRegisterVariable
virtual bool validateGlobalRegisterVariable(StringRef RegName, unsigned RegSize, bool &HasSizeMismatch) const
Validate register name used for global register variables.
Definition: TargetInfo.h:1077
clang::TargetInfo::HasBuiltinMSVaList
unsigned HasBuiltinMSVaList
Definition: TargetInfo.h:224
clang::TransferrableTargetInfo::ZeroLengthBitfieldBoundary
unsigned ZeroLengthBitfieldBoundary
If non-zero, specifies a fixed alignment value for bitfields that follow zero length bitfield,...
Definition: TargetInfo.h:165
clang::TargetInfo::hasFPReturn
virtual bool hasFPReturn() const
Determine whether return of a floating point value is supported on this target.
Definition: TargetInfo.h:613
clang::TransferrableTargetInfo::Int64Type
IntType Int64Type
Definition: TargetInfo.h:132
clang::TransferrableTargetInfo::LargeArrayMinWidth
unsigned char LargeArrayMinWidth
Definition: TargetInfo.h:74
clang::TransferrableTargetInfo::LongDoubleWidth
unsigned char LongDoubleWidth
Definition: TargetInfo.h:73
clang::TransferrableTargetInfo::UnsignedInt
@ UnsignedInt
Definition: TargetInfo.h:123
clang::TargetCXXABI
The basic abstraction for the target C++ ABI.
Definition: TargetCXXABI.h:28
clang::TargetInfo::ConstraintInfo::ConstraintInfo
ConstraintInfo(StringRef ConstraintStr, StringRef Name)
Definition: TargetInfo.h:996
clang::TargetInfo::getIntWidth
unsigned getIntWidth() const
getIntWidth/Align - Return the size of 'signed int' and 'unsigned int' for this target,...
Definition: TargetInfo.h:452
clang::TargetOptions::OpenCLFeaturesMap
llvm::StringMap< bool > OpenCLFeaturesMap
Supported OpenCL extensions and optional core features.
Definition: TargetOptions.h:65
clang::TargetInfo::validateOutputConstraint
bool validateOutputConstraint(ConstraintInfo &Info) const
Definition: TargetInfo.cpp:608
clang::TransferrableTargetInfo::UseSignedCharForObjCBool
unsigned UseSignedCharForObjCBool
Whether Objective-C's built-in boolean type should be signed char.
Definition: TargetInfo.h:139
clang::TargetInfo::copyAuxTarget
void copyAuxTarget(const TargetInfo *Aux)
Copy type and layout related info.
Definition: TargetInfo.cpp:882
clang::TransferrableTargetInfo::LongDoubleAlign
unsigned char LongDoubleAlign
Definition: TargetInfo.h:73
clang::TargetInfo::useFP16ConversionIntrinsics
virtual bool useFP16ConversionIntrinsics() const
Check whether llvm intrinsics such as llvm.convert.to.fp16 should be used to convert to and from __fp...
Definition: TargetInfo.h:879
clang::TransferrableTargetInfo::SizeType
IntType SizeType
Definition: TargetInfo.h:131
clang::TargetInfo::isSEHTrySupported
bool isSEHTrySupported() const
Whether the target supports SEH __try.
Definition: TargetInfo.h:1389
clang::TargetInfo::hasBuiltinMSVaList
bool hasBuiltinMSVaList() const
Returns whether or not type __builtin_ms_va_list type is available on this target.
Definition: TargetInfo.h:920
clang::TargetInfo::getUnsignedLongFractScale
unsigned getUnsignedLongFractScale() const
getUnsignedLongFractScale - Return the number of fractional bits in a 'unsigned long _Fract' type.
Definition: TargetInfo.h:573
clang::TargetInfo::getCorrespondingUnsignedType
static IntType getCorrespondingUnsignedType(IntType T)
Definition: TargetInfo.h:361
clang::TransferrableTargetInfo::SignedLong
@ SignedLong
Definition: TargetInfo.h:124
clang::TargetInfo::hasRISCVVTypes
bool hasRISCVVTypes() const
Returns whether or not the RISC-V V built-in types are available on this target.
Definition: TargetInfo.h:931
clang::TargetInfo::BranchProtectionInfo::SignReturnAddr
LangOptions::SignReturnAddressScopeKind SignReturnAddr
Definition: TargetInfo.h:1285
clang::TargetInfo::getProgramAddressSpace
unsigned getProgramAddressSpace() const
Return the address space for functions for the given target.
Definition: TargetInfo.h:772
clang::TargetInfo::HexagonBuiltinVaList
@ HexagonBuiltinVaList
Definition: TargetInfo.h:308
clang::TransferrableTargetInfo::Char32Type
IntType Char32Type
Definition: TargetInfo.h:132
clang::TransferrableTargetInfo::FractWidth
unsigned char FractWidth
Definition: TargetInfo.h:83