Coverage Report

Created: 2021-09-21 08:58

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