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