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