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