clang  14.0.0git
TargetInfo.cpp
Go to the documentation of this file.
1 //===--- TargetInfo.cpp - Information about Target machine ----------------===//
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 // This file implements the TargetInfo and TargetInfoImpl interfaces.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "clang/Basic/TargetInfo.h"
15 #include "clang/Basic/CharInfo.h"
16 #include "clang/Basic/Diagnostic.h"
18 #include "llvm/ADT/APFloat.h"
19 #include "llvm/ADT/STLExtras.h"
20 #include "llvm/Support/ErrorHandling.h"
21 #include "llvm/Support/TargetParser.h"
22 #include <cstdlib>
23 using namespace clang;
24 
25 static const LangASMap DefaultAddrSpaceMap = {0};
26 
27 // TargetInfo Constructor.
28 TargetInfo::TargetInfo(const llvm::Triple &T) : TargetOpts(), Triple(T) {
29  // Set defaults. Defaults are set for a 32-bit RISC platform, like PPC or
30  // SPARC. These should be overridden by concrete targets as needed.
31  BigEndian = !T.isLittleEndian();
32  TLSSupported = true;
33  VLASupported = true;
34  NoAsmVariants = false;
35  HasLegalHalfType = false;
36  HasFloat128 = false;
37  HasIbm128 = false;
38  HasFloat16 = false;
39  HasBFloat16 = false;
40  HasStrictFP = false;
42  BoolWidth = BoolAlign = 8;
43  IntWidth = IntAlign = 32;
44  LongWidth = LongAlign = 32;
46 
47  // Fixed point default bit widths
49  AccumWidth = AccumAlign = 32;
52  FractWidth = FractAlign = 16;
54 
55  // Fixed point default integral and fractional bit sizes
56  // We give the _Accum 1 fewer fractional bits than their corresponding _Fract
57  // types by default to have the same number of fractional bits between _Accum
58  // and _Fract types.
60  ShortAccumScale = 7;
61  AccumScale = 15;
62  LongAccumScale = 31;
63 
64  SuitableAlign = 64;
66  MinGlobalAlign = 0;
67  // From the glibc documentation, on GNU systems, malloc guarantees 16-byte
68  // alignment on 64-bit systems and 8-byte alignment on 32-bit systems. See
69  // https://www.gnu.org/software/libc/manual/html_node/Malloc-Examples.html.
70  // This alignment guarantee also applies to Windows and Android. On Darwin,
71  // the alignment is 16 bytes on both 64-bit and 32-bit systems.
72  if (T.isGNUEnvironment() || T.isWindowsMSVCEnvironment() || T.isAndroid())
73  NewAlign = Triple.isArch64Bit() ? 128 : Triple.isArch32Bit() ? 64 : 0;
74  else if (T.isOSDarwin())
75  NewAlign = 128;
76  else
77  NewAlign = 0; // Infer from basic type alignment.
78  HalfWidth = 16;
79  HalfAlign = 16;
80  FloatWidth = 32;
81  FloatAlign = 32;
82  DoubleWidth = 64;
83  DoubleAlign = 64;
84  LongDoubleWidth = 64;
85  LongDoubleAlign = 64;
86  Float128Align = 128;
87  Ibm128Align = 128;
89  LargeArrayAlign = 0;
91  MaxVectorAlign = 0;
92  MaxTLSAlign = 0;
93  SimdDefaultAlign = 0;
113  HalfFormat = &llvm::APFloat::IEEEhalf();
114  FloatFormat = &llvm::APFloat::IEEEsingle();
115  DoubleFormat = &llvm::APFloat::IEEEdouble();
116  LongDoubleFormat = &llvm::APFloat::IEEEdouble();
117  Float128Format = &llvm::APFloat::IEEEquad();
118  Ibm128Format = &llvm::APFloat::PPCDoubleDouble();
119  MCountName = "mcount";
120  UserLabelPrefix = "_";
121  RegParmMax = 0;
122  SSERegParmMax = 0;
123  HasAlignMac68kSupport = false;
124  HasBuiltinMSVaList = false;
125  IsRenderScriptTarget = false;
126  HasAArch64SVETypes = false;
127  HasRISCVVTypes = false;
129  ARMCDECoprocMask = 0;
130 
131  // Default to no types using fpret.
133 
134  // Default to not using fp2ret for __Complex long double
136 
137  // Set the C++ ABI based on the triple.
138  TheCXXABI.set(Triple.isKnownWindowsMSVCEnvironment()
139  ? TargetCXXABI::Microsoft
140  : TargetCXXABI::GenericItanium);
141 
142  // Default to an empty address space map.
144  UseAddrSpaceMapMangling = false;
145 
146  // Default to an unknown platform name.
147  PlatformName = "unknown";
148  PlatformMinVersion = VersionTuple();
149 
150  MaxOpenCLWorkGroupSize = 1024;
151 }
152 
153 // Out of line virtual dtor for TargetInfo.
155 
156 void TargetInfo::resetDataLayout(StringRef DL, const char *ULP) {
157  DataLayoutString = DL.str();
158  UserLabelPrefix = ULP;
159 }
160 
161 bool
163  Diags.Report(diag::err_opt_not_valid_on_target) << "cf-protection=branch";
164  return false;
165 }
166 
167 bool
169  Diags.Report(diag::err_opt_not_valid_on_target) << "cf-protection=return";
170  return false;
171 }
172 
173 /// getTypeName - Return the user string for the specified integer type enum.
174 /// For example, SignedShort -> "short".
176  switch (T) {
177  default: llvm_unreachable("not an integer!");
178  case SignedChar: return "signed char";
179  case UnsignedChar: return "unsigned char";
180  case SignedShort: return "short";
181  case UnsignedShort: return "unsigned short";
182  case SignedInt: return "int";
183  case UnsignedInt: return "unsigned int";
184  case SignedLong: return "long int";
185  case UnsignedLong: return "long unsigned int";
186  case SignedLongLong: return "long long int";
187  case UnsignedLongLong: return "long long unsigned int";
188  }
189 }
190 
191 /// getTypeConstantSuffix - Return the constant suffix for the specified
192 /// integer type enum. For example, SignedLong -> "L".
194  switch (T) {
195  default: llvm_unreachable("not an integer!");
196  case SignedChar:
197  case SignedShort:
198  case SignedInt: return "";
199  case SignedLong: return "L";
200  case SignedLongLong: return "LL";
201  case UnsignedChar:
202  if (getCharWidth() < getIntWidth())
203  return "";
204  LLVM_FALLTHROUGH;
205  case UnsignedShort:
206  if (getShortWidth() < getIntWidth())
207  return "";
208  LLVM_FALLTHROUGH;
209  case UnsignedInt: return "U";
210  case UnsignedLong: return "UL";
211  case UnsignedLongLong: return "ULL";
212  }
213 }
214 
215 /// getTypeFormatModifier - Return the printf format modifier for the
216 /// specified integer type enum. For example, SignedLong -> "l".
217 
219  switch (T) {
220  default: llvm_unreachable("not an integer!");
221  case SignedChar:
222  case UnsignedChar: return "hh";
223  case SignedShort:
224  case UnsignedShort: return "h";
225  case SignedInt:
226  case UnsignedInt: return "";
227  case SignedLong:
228  case UnsignedLong: return "l";
229  case SignedLongLong:
230  case UnsignedLongLong: return "ll";
231  }
232 }
233 
234 /// getTypeWidth - Return the width (in bits) of the specified integer type
235 /// enum. For example, SignedInt -> getIntWidth().
237  switch (T) {
238  default: llvm_unreachable("not an integer!");
239  case SignedChar:
240  case UnsignedChar: return getCharWidth();
241  case SignedShort:
242  case UnsignedShort: return getShortWidth();
243  case SignedInt:
244  case UnsignedInt: return getIntWidth();
245  case SignedLong:
246  case UnsignedLong: return getLongWidth();
247  case SignedLongLong:
248  case UnsignedLongLong: return getLongLongWidth();
249  };
250 }
251 
253  unsigned BitWidth, bool IsSigned) const {
254  if (getCharWidth() == BitWidth)
255  return IsSigned ? SignedChar : UnsignedChar;
256  if (getShortWidth() == BitWidth)
257  return IsSigned ? SignedShort : UnsignedShort;
258  if (getIntWidth() == BitWidth)
259  return IsSigned ? SignedInt : UnsignedInt;
260  if (getLongWidth() == BitWidth)
261  return IsSigned ? SignedLong : UnsignedLong;
262  if (getLongLongWidth() == BitWidth)
263  return IsSigned ? SignedLongLong : UnsignedLongLong;
264  return NoInt;
265 }
266 
268  bool IsSigned) const {
269  if (getCharWidth() >= BitWidth)
270  return IsSigned ? SignedChar : UnsignedChar;
271  if (getShortWidth() >= BitWidth)
272  return IsSigned ? SignedShort : UnsignedShort;
273  if (getIntWidth() >= BitWidth)
274  return IsSigned ? SignedInt : UnsignedInt;
275  if (getLongWidth() >= BitWidth)
276  return IsSigned ? SignedLong : UnsignedLong;
277  if (getLongLongWidth() >= BitWidth)
278  return IsSigned ? SignedLongLong : UnsignedLongLong;
279  return NoInt;
280 }
281 
283  FloatModeKind ExplicitType) const {
284  if (getFloatWidth() == BitWidth)
285  return FloatModeKind::Float;
286  if (getDoubleWidth() == BitWidth)
287  return FloatModeKind::Double;
288 
289  switch (BitWidth) {
290  case 96:
291  if (&getLongDoubleFormat() == &llvm::APFloat::x87DoubleExtended())
293  break;
294  case 128:
295  // The caller explicitly asked for an IEEE compliant type but we still
296  // have to check if the target supports it.
297  if (ExplicitType == FloatModeKind::Float128)
300  if (ExplicitType == FloatModeKind::Ibm128)
303  if (ExplicitType == FloatModeKind::LongDouble)
304  return ExplicitType;
305  break;
306  }
307 
308  return FloatModeKind::NoFloat;
309 }
310 
311 /// getTypeAlign - Return the alignment (in bits) of the specified integer type
312 /// enum. For example, SignedInt -> getIntAlign().
314  switch (T) {
315  default: llvm_unreachable("not an integer!");
316  case SignedChar:
317  case UnsignedChar: return getCharAlign();
318  case SignedShort:
319  case UnsignedShort: return getShortAlign();
320  case SignedInt:
321  case UnsignedInt: return getIntAlign();
322  case SignedLong:
323  case UnsignedLong: return getLongAlign();
324  case SignedLongLong:
325  case UnsignedLongLong: return getLongLongAlign();
326  };
327 }
328 
329 /// isTypeSigned - Return whether an integer types is signed. Returns true if
330 /// the type is signed; false otherwise.
332  switch (T) {
333  default: llvm_unreachable("not an integer!");
334  case SignedChar:
335  case SignedShort:
336  case SignedInt:
337  case SignedLong:
338  case SignedLongLong:
339  return true;
340  case UnsignedChar:
341  case UnsignedShort:
342  case UnsignedInt:
343  case UnsignedLong:
344  case UnsignedLongLong:
345  return false;
346  };
347 }
348 
349 /// adjust - Set forced language options.
350 /// Apply changes to the target information with respect to certain
351 /// language options which change the target configuration and adjust
352 /// the language based on the target options where applicable.
354  if (Opts.NoBitFieldTypeAlign)
355  UseBitFieldTypeAlignment = false;
356 
357  switch (Opts.WCharSize) {
358  default: llvm_unreachable("invalid wchar_t width");
359  case 0: break;
360  case 1: WCharType = Opts.WCharIsSigned ? SignedChar : UnsignedChar; break;
361  case 2: WCharType = Opts.WCharIsSigned ? SignedShort : UnsignedShort; break;
362  case 4: WCharType = Opts.WCharIsSigned ? SignedInt : UnsignedInt; break;
363  }
364 
365  if (Opts.AlignDouble) {
366  DoubleAlign = LongLongAlign = 64;
367  LongDoubleAlign = 64;
368  }
369 
370  if (Opts.OpenCL) {
371  // OpenCL C requires specific widths for types, irrespective of
372  // what these normally are for the target.
373  // We also define long long and long double here, although the
374  // OpenCL standard only mentions these as "reserved".
375  IntWidth = IntAlign = 32;
376  LongWidth = LongAlign = 64;
378  HalfWidth = HalfAlign = 16;
379  FloatWidth = FloatAlign = 32;
380 
381  // Embedded 32-bit targets (OpenCL EP) might have double C type
382  // defined as float. Let's not override this as it might lead
383  // to generating illegal code that uses 64bit doubles.
384  if (DoubleWidth != FloatWidth) {
385  DoubleWidth = DoubleAlign = 64;
386  DoubleFormat = &llvm::APFloat::IEEEdouble();
387  }
389 
390  unsigned MaxPointerWidth = getMaxPointerWidth();
391  assert(MaxPointerWidth == 32 || MaxPointerWidth == 64);
392  bool Is32BitArch = MaxPointerWidth == 32;
393  SizeType = Is32BitArch ? UnsignedInt : UnsignedLong;
394  PtrDiffType = Is32BitArch ? SignedInt : SignedLong;
395  IntPtrType = Is32BitArch ? SignedInt : SignedLong;
396 
399 
400  HalfFormat = &llvm::APFloat::IEEEhalf();
401  FloatFormat = &llvm::APFloat::IEEEsingle();
402  LongDoubleFormat = &llvm::APFloat::IEEEquad();
403 
404  // OpenCL C v3.0 s6.7.5 - The generic address space requires support for
405  // OpenCL C 2.0 or OpenCL C 3.0 with the __opencl_c_generic_address_space
406  // feature
407  // OpenCL C v3.0 s6.2.1 - OpenCL pipes require support of OpenCL C 2.0
408  // or later and __opencl_c_pipes feature
409  // FIXME: These language options are also defined in setLangDefaults()
410  // for OpenCL C 2.0 but with no access to target capabilities. Target
411  // should be immutable once created and thus these language options need
412  // to be defined only once.
413  if (Opts.getOpenCLCompatibleVersion() == 300) {
414  const auto &OpenCLFeaturesMap = getSupportedOpenCLOpts();
415  Opts.OpenCLGenericAddressSpace = hasFeatureEnabled(
416  OpenCLFeaturesMap, "__opencl_c_generic_address_space");
417  Opts.OpenCLPipes =
418  hasFeatureEnabled(OpenCLFeaturesMap, "__opencl_c_pipes");
419  }
420  }
421 
422  if (Opts.DoubleSize) {
423  if (Opts.DoubleSize == 32) {
424  DoubleWidth = 32;
425  LongDoubleWidth = 32;
426  DoubleFormat = &llvm::APFloat::IEEEsingle();
427  LongDoubleFormat = &llvm::APFloat::IEEEsingle();
428  } else if (Opts.DoubleSize == 64) {
429  DoubleWidth = 64;
430  LongDoubleWidth = 64;
431  DoubleFormat = &llvm::APFloat::IEEEdouble();
432  LongDoubleFormat = &llvm::APFloat::IEEEdouble();
433  }
434  }
435 
436  if (Opts.LongDoubleSize) {
437  if (Opts.LongDoubleSize == DoubleWidth) {
441  } else if (Opts.LongDoubleSize == 128) {
443  LongDoubleFormat = &llvm::APFloat::IEEEquad();
444  }
445  }
446 
447  if (Opts.NewAlignOverride)
448  NewAlign = Opts.NewAlignOverride * getCharWidth();
449 
450  // Each unsigned fixed point type has the same number of fractional bits as
451  // its corresponding signed type.
452  PaddingOnUnsignedFixedPoint |= Opts.PaddingOnUnsignedFixedPoint;
453  CheckFixedPointBits();
454 
455  if (Opts.ProtectParens && !checkArithmeticFenceSupported()) {
456  Diags.Report(diag::err_opt_not_valid_on_target) << "-fprotect-parens";
457  Opts.ProtectParens = false;
458  }
459 }
460 
462  llvm::StringMap<bool> &Features, DiagnosticsEngine &Diags, StringRef CPU,
463  const std::vector<std::string> &FeatureVec) const {
464  for (const auto &F : FeatureVec) {
465  StringRef Name = F;
466  // Apply the feature via the target.
467  bool Enabled = Name[0] == '+';
468  setFeatureEnabled(Features, Name.substr(1), Enabled);
469  }
470  return true;
471 }
472 
474 TargetInfo::getCallingConvKind(bool ClangABICompat4) const {
475  if (getCXXABI() != TargetCXXABI::Microsoft &&
476  (ClangABICompat4 || getTriple().getOS() == llvm::Triple::PS4))
477  return CCK_ClangABI4OrPS4;
478  return CCK_Default;
479 }
480 
482  switch (TK) {
483  case OCLTK_Image:
484  case OCLTK_Pipe:
485  return LangAS::opencl_global;
486 
487  case OCLTK_Sampler:
489 
490  default:
491  return LangAS::Default;
492  }
493 }
494 
495 //===----------------------------------------------------------------------===//
496 
497 
498 static StringRef removeGCCRegisterPrefix(StringRef Name) {
499  if (Name[0] == '%' || Name[0] == '#')
500  Name = Name.substr(1);
501 
502  return Name;
503 }
504 
505 /// isValidClobber - Returns whether the passed in string is
506 /// a valid clobber in an inline asm statement. This is used by
507 /// Sema.
508 bool TargetInfo::isValidClobber(StringRef Name) const {
509  return (isValidGCCRegisterName(Name) || Name == "memory" || Name == "cc" ||
510  Name == "unwind");
511 }
512 
513 /// isValidGCCRegisterName - Returns whether the passed in string
514 /// is a valid register name according to GCC. This is used by Sema for
515 /// inline asm statements.
516 bool TargetInfo::isValidGCCRegisterName(StringRef Name) const {
517  if (Name.empty())
518  return false;
519 
520  // Get rid of any register prefix.
521  Name = removeGCCRegisterPrefix(Name);
522  if (Name.empty())
523  return false;
524 
526 
527  // If we have a number it maps to an entry in the register name array.
528  if (isDigit(Name[0])) {
529  unsigned n;
530  if (!Name.getAsInteger(0, n))
531  return n < Names.size();
532  }
533 
534  // Check register names.
535  if (llvm::is_contained(Names, Name))
536  return true;
537 
538  // Check any additional names that we have.
539  for (const AddlRegName &ARN : getGCCAddlRegNames())
540  for (const char *AN : ARN.Names) {
541  if (!AN)
542  break;
543  // Make sure the register that the additional name is for is within
544  // the bounds of the register names from above.
545  if (AN == Name && ARN.RegNum < Names.size())
546  return true;
547  }
548 
549  // Now check aliases.
550  for (const GCCRegAlias &GRA : getGCCRegAliases())
551  for (const char *A : GRA.Aliases) {
552  if (!A)
553  break;
554  if (A == Name)
555  return true;
556  }
557 
558  return false;
559 }
560 
562  bool ReturnCanonical) const {
563  assert(isValidGCCRegisterName(Name) && "Invalid register passed in");
564 
565  // Get rid of any register prefix.
566  Name = removeGCCRegisterPrefix(Name);
567 
569 
570  // First, check if we have a number.
571  if (isDigit(Name[0])) {
572  unsigned n;
573  if (!Name.getAsInteger(0, n)) {
574  assert(n < Names.size() && "Out of bounds register number!");
575  return Names[n];
576  }
577  }
578 
579  // Check any additional names that we have.
580  for (const AddlRegName &ARN : getGCCAddlRegNames())
581  for (const char *AN : ARN.Names) {
582  if (!AN)
583  break;
584  // Make sure the register that the additional name is for is within
585  // the bounds of the register names from above.
586  if (AN == Name && ARN.RegNum < Names.size())
587  return ReturnCanonical ? Names[ARN.RegNum] : Name;
588  }
589 
590  // Now check aliases.
591  for (const GCCRegAlias &RA : getGCCRegAliases())
592  for (const char *A : RA.Aliases) {
593  if (!A)
594  break;
595  if (A == Name)
596  return RA.Register;
597  }
598 
599  return Name;
600 }
601 
603  const char *Name = Info.getConstraintStr().c_str();
604  // An output constraint must start with '=' or '+'
605  if (*Name != '=' && *Name != '+')
606  return false;
607 
608  if (*Name == '+')
609  Info.setIsReadWrite();
610 
611  Name++;
612  while (*Name) {
613  switch (*Name) {
614  default:
615  if (!validateAsmConstraint(Name, Info)) {
616  // FIXME: We temporarily return false
617  // so we can add more constraints as we hit it.
618  // Eventually, an unknown constraint should just be treated as 'g'.
619  return false;
620  }
621  break;
622  case '&': // early clobber.
623  Info.setEarlyClobber();
624  break;
625  case '%': // commutative.
626  // FIXME: Check that there is a another register after this one.
627  break;
628  case 'r': // general register.
629  Info.setAllowsRegister();
630  break;
631  case 'm': // memory operand.
632  case 'o': // offsetable memory operand.
633  case 'V': // non-offsetable memory operand.
634  case '<': // autodecrement memory operand.
635  case '>': // autoincrement memory operand.
636  Info.setAllowsMemory();
637  break;
638  case 'g': // general register, memory operand or immediate integer.
639  case 'X': // any operand.
640  Info.setAllowsRegister();
641  Info.setAllowsMemory();
642  break;
643  case ',': // multiple alternative constraint. Pass it.
644  // Handle additional optional '=' or '+' modifiers.
645  if (Name[1] == '=' || Name[1] == '+')
646  Name++;
647  break;
648  case '#': // Ignore as constraint.
649  while (Name[1] && Name[1] != ',')
650  Name++;
651  break;
652  case '?': // Disparage slightly code.
653  case '!': // Disparage severely.
654  case '*': // Ignore for choosing register preferences.
655  case 'i': // Ignore i,n,E,F as output constraints (match from the other
656  // chars)
657  case 'n':
658  case 'E':
659  case 'F':
660  break; // Pass them.
661  }
662 
663  Name++;
664  }
665 
666  // Early clobber with a read-write constraint which doesn't permit registers
667  // is invalid.
668  if (Info.earlyClobber() && Info.isReadWrite() && !Info.allowsRegister())
669  return false;
670 
671  // If a constraint allows neither memory nor register operands it contains
672  // only modifiers. Reject it.
673  return Info.allowsMemory() || Info.allowsRegister();
674 }
675 
676 bool TargetInfo::resolveSymbolicName(const char *&Name,
677  ArrayRef<ConstraintInfo> OutputConstraints,
678  unsigned &Index) const {
679  assert(*Name == '[' && "Symbolic name did not start with '['");
680  Name++;
681  const char *Start = Name;
682  while (*Name && *Name != ']')
683  Name++;
684 
685  if (!*Name) {
686  // Missing ']'
687  return false;
688  }
689 
690  std::string SymbolicName(Start, Name - Start);
691 
692  for (Index = 0; Index != OutputConstraints.size(); ++Index)
693  if (SymbolicName == OutputConstraints[Index].getName())
694  return true;
695 
696  return false;
697 }
698 
700  MutableArrayRef<ConstraintInfo> OutputConstraints,
701  ConstraintInfo &Info) const {
702  const char *Name = Info.ConstraintStr.c_str();
703 
704  if (!*Name)
705  return false;
706 
707  while (*Name) {
708  switch (*Name) {
709  default:
710  // Check if we have a matching constraint
711  if (*Name >= '0' && *Name <= '9') {
712  const char *DigitStart = Name;
713  while (Name[1] >= '0' && Name[1] <= '9')
714  Name++;
715  const char *DigitEnd = Name;
716  unsigned i;
717  if (StringRef(DigitStart, DigitEnd - DigitStart + 1)
718  .getAsInteger(10, i))
719  return false;
720 
721  // Check if matching constraint is out of bounds.
722  if (i >= OutputConstraints.size()) return false;
723 
724  // A number must refer to an output only operand.
725  if (OutputConstraints[i].isReadWrite())
726  return false;
727 
728  // If the constraint is already tied, it must be tied to the
729  // same operand referenced to by the number.
730  if (Info.hasTiedOperand() && Info.getTiedOperand() != i)
731  return false;
732 
733  // The constraint should have the same info as the respective
734  // output constraint.
735  Info.setTiedOperand(i, OutputConstraints[i]);
736  } else if (!validateAsmConstraint(Name, Info)) {
737  // FIXME: This error return is in place temporarily so we can
738  // add more constraints as we hit it. Eventually, an unknown
739  // constraint should just be treated as 'g'.
740  return false;
741  }
742  break;
743  case '[': {
744  unsigned Index = 0;
745  if (!resolveSymbolicName(Name, OutputConstraints, Index))
746  return false;
747 
748  // If the constraint is already tied, it must be tied to the
749  // same operand referenced to by the number.
750  if (Info.hasTiedOperand() && Info.getTiedOperand() != Index)
751  return false;
752 
753  // A number must refer to an output only operand.
754  if (OutputConstraints[Index].isReadWrite())
755  return false;
756 
757  Info.setTiedOperand(Index, OutputConstraints[Index]);
758  break;
759  }
760  case '%': // commutative
761  // FIXME: Fail if % is used with the last operand.
762  break;
763  case 'i': // immediate integer.
764  break;
765  case 'n': // immediate integer with a known value.
766  Info.setRequiresImmediate();
767  break;
768  case 'I': // Various constant constraints with target-specific meanings.
769  case 'J':
770  case 'K':
771  case 'L':
772  case 'M':
773  case 'N':
774  case 'O':
775  case 'P':
776  if (!validateAsmConstraint(Name, Info))
777  return false;
778  break;
779  case 'r': // general register.
780  Info.setAllowsRegister();
781  break;
782  case 'm': // memory operand.
783  case 'o': // offsettable memory operand.
784  case 'V': // non-offsettable memory operand.
785  case '<': // autodecrement memory operand.
786  case '>': // autoincrement memory operand.
787  Info.setAllowsMemory();
788  break;
789  case 'g': // general register, memory operand or immediate integer.
790  case 'X': // any operand.
791  Info.setAllowsRegister();
792  Info.setAllowsMemory();
793  break;
794  case 'E': // immediate floating point.
795  case 'F': // immediate floating point.
796  case 'p': // address operand.
797  break;
798  case ',': // multiple alternative constraint. Ignore comma.
799  break;
800  case '#': // Ignore as constraint.
801  while (Name[1] && Name[1] != ',')
802  Name++;
803  break;
804  case '?': // Disparage slightly code.
805  case '!': // Disparage severely.
806  case '*': // Ignore for choosing register preferences.
807  break; // Pass them.
808  }
809 
810  Name++;
811  }
812 
813  return true;
814 }
815 
816 void TargetInfo::CheckFixedPointBits() const {
817  // Check that the number of fractional and integral bits (and maybe sign) can
818  // fit into the bits given for a fixed point type.
820  assert(AccumScale + getAccumIBits() + 1 <= AccumWidth);
827 
828  assert(getShortFractScale() + 1 <= ShortFractWidth);
829  assert(getFractScale() + 1 <= FractWidth);
830  assert(getLongFractScale() + 1 <= LongFractWidth);
832  assert(getUnsignedFractScale() <= FractWidth);
834 
835  // Each unsigned fract type has either the same number of fractional bits
836  // as, or one more fractional bit than, its corresponding signed fract type.
839  assert(getFractScale() == getUnsignedFractScale() ||
843 
844  // When arranged in order of increasing rank (see 6.3.1.3a), the number of
845  // fractional bits is nondecreasing for each of the following sets of
846  // fixed-point types:
847  // - signed fract types
848  // - unsigned fract types
849  // - signed accum types
850  // - unsigned accum types.
851  assert(getLongFractScale() >= getFractScale() &&
858 
859  // When arranged in order of increasing rank (see 6.3.1.3a), the number of
860  // integral bits is nondecreasing for each of the following sets of
861  // fixed-point types:
862  // - signed accum types
863  // - unsigned accum types
864  assert(getLongAccumIBits() >= getAccumIBits() &&
868 
869  // Each signed accum type has at least as many integral bits as its
870  // corresponding unsigned accum type.
872  assert(getAccumIBits() >= getUnsignedAccumIBits());
874 }
875 
877  auto *Target = static_cast<TransferrableTargetInfo*>(this);
878  auto *Src = static_cast<const TransferrableTargetInfo*>(Aux);
879  *Target = *Src;
880 }
clang::TransferrableTargetInfo::PointerAlign
unsigned char PointerAlign
Definition: TargetInfo.h:69
clang::TargetInfo::DataLayoutString
std::string DataLayoutString
Definition: TargetInfo.h:210
clang::TransferrableTargetInfo::LongWidth
unsigned char LongWidth
Definition: TargetInfo.h:78
clang::TransferrableTargetInfo::SuitableAlign
unsigned char SuitableAlign
Definition: TargetInfo.h:107
clang::TargetInfo::ConstraintInfo::allowsMemory
bool allowsMemory() const
Definition: TargetInfo.h:994
clang::TransferrableTargetInfo::LargeArrayAlign
unsigned char LargeArrayAlign
Definition: TargetInfo.h:77
clang::TargetInfo::getLongDoubleFormat
const llvm::fltSemantics & getLongDoubleFormat() const
Definition: TargetInfo.h:670
clang::TargetInfo::CCK_Default
@ CCK_Default
Definition: TargetInfo.h:1480
clang::TargetInfo::PlatformMinVersion
VersionTuple PlatformMinVersion
Definition: TargetInfo.h:218
clang::TargetInfo::RegParmMax
unsigned char RegParmMax
Definition: TargetInfo.h:213
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::TransferrableTargetInfo::UnsignedChar
@ UnsignedChar
Definition: TargetInfo.h:122
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:516
clang::TransferrableTargetInfo::IntMaxType
IntType IntMaxType
Definition: TargetInfo.h:134
clang::FloatModeKind::LongDouble
@ LongDouble
clang::LangOptions::getOpenCLCompatibleVersion
unsigned getOpenCLCompatibleVersion() const
Return the OpenCL version that kernel language is compatible with.
Definition: LangOptions.cpp:55
clang::TargetInfo::getAccumIBits
unsigned getAccumIBits() const
Definition: TargetInfo.h:505
clang::TargetInfo::getLongAccumIBits
unsigned getLongAccumIBits() const
Definition: TargetInfo.h:510
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::CCK_ClangABI4OrPS4
@ CCK_ClangABI4OrPS4
Definition: TargetInfo.h:1481
clang::TargetInfo::getTypeConstantSuffix
const char * getTypeConstantSuffix(IntType T) const
Return the constant suffix for the specified integer type enum.
Definition: TargetInfo.cpp:193
clang::TransferrableTargetInfo::UseExplicitBitFieldAlignment
unsigned UseExplicitBitFieldAlignment
Whether explicit bit field alignment attributes are honored.
Definition: TargetInfo.h:164
clang::TargetInfo::getLongWidth
unsigned getLongWidth() const
getLongWidth/Align - Return the size of 'signed long' and 'unsigned long' for this target,...
Definition: TargetInfo.h:457
clang::TransferrableTargetInfo::LongLongAlign
unsigned char LongLongAlign
Definition: TargetInfo.h:79
clang::TargetInfo::getUnsignedLongAccumScale
unsigned getUnsignedLongAccumScale() const
getUnsignedLongAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned long _...
Definition: TargetInfo.h:537
clang::TransferrableTargetInfo::DoubleAlign
unsigned char DoubleAlign
Definition: TargetInfo.h:75
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:220
clang::TargetInfo::TheCXXABI
TargetCXXABI TheCXXABI
Definition: TargetInfo.h:214
TargetInfo.h
clang::MultiVersionKind::Target
@ Target
clang::TargetInfo::getUnsignedShortAccumIBits
unsigned getUnsignedShortAccumIBits() const
Definition: TargetInfo.h:519
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:168
clang::TargetInfo::ConstraintInfo::setEarlyClobber
void setEarlyClobber()
Definition: TargetInfo.h:1023
clang::TargetInfo::isTypeSigned
static bool isTypeSigned(IntType T)
Returns true if the type is signed; false otherwise.
Definition: TargetInfo.cpp:331
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::RealTypeUsesObjCFPRet
unsigned RealTypeUsesObjCFPRet
Definition: TargetInfo.h:221
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:191
clang::TargetInfo::getCXXABI
TargetCXXABI getCXXABI() const
Get the C++ ABI currently in use.
Definition: TargetInfo.h:1203
clang::TargetInfo
Exposes information about the current target.
Definition: TargetInfo.h:189
clang::TransferrableTargetInfo::MaxTLSAlign
unsigned MaxTLSAlign
Definition: TargetInfo.h:113
clang::TransferrableTargetInfo::DefaultAlignForAttributeAligned
unsigned char DefaultAlignForAttributeAligned
Definition: TargetInfo.h:108
clang::TargetInfo::getCallingConvKind
virtual CallingConvKind getCallingConvKind(bool ClangABICompat4) const
Definition: TargetInfo.cpp:474
clang::OCLTK_Image
@ OCLTK_Image
Definition: TargetInfo.h:180
clang::TargetInfo::adjust
virtual void adjust(DiagnosticsEngine &Diags, LangOptions &Opts)
Set forced language options.
Definition: TargetInfo.cpp:353
clang::TransferrableTargetInfo::WIntType
IntType WIntType
Definition: TargetInfo.h:134
clang::TargetInfo::getFractScale
unsigned getFractScale() const
getFractScale - Return the number of fractional bits in a 'signed _Fract' type.
Definition: TargetInfo.h:552
clang::TargetInfo::getCharWidth
unsigned getCharWidth() const
Definition: TargetInfo.h:439
clang::TargetInfo::validateAsmConstraint
virtual bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &info) const =0
clang::TargetInfo::IsRenderScriptTarget
unsigned IsRenderScriptTarget
Definition: TargetInfo.h:226
clang::TargetInfo::getUnsignedShortAccumScale
unsigned getUnsignedShortAccumScale() const
getUnsignedShortAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned short...
Definition: TargetInfo.h:516
clang::TargetInfo::getLongLongWidth
unsigned getLongLongWidth() const
getLongLongWidth/Align - Return the size of 'signed long long' and 'unsigned long long' for this targ...
Definition: TargetInfo.h:462
clang::TransferrableTargetInfo::BoolAlign
unsigned char BoolAlign
Definition: TargetInfo.h:70
clang::TransferrableTargetInfo::Float128Align
unsigned char Float128Align
Definition: TargetInfo.h:76
clang::TargetInfo::getLongAlign
unsigned getLongAlign() const
Definition: TargetInfo.h:458
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:314
clang::TransferrableTargetInfo::LongAlign
unsigned char LongAlign
Definition: TargetInfo.h:78
clang::TransferrableTargetInfo::ShortFractWidth
unsigned char ShortFractWidth
Definition: TargetInfo.h:85
clang::TransferrableTargetInfo::UnsignedLongLong
@ UnsignedLongLong
Definition: TargetInfo.h:130
clang::TargetInfo::AllowAMDGPUUnsafeFPAtomics
unsigned AllowAMDGPUUnsafeFPAtomics
Definition: TargetInfo.h:232
clang::TransferrableTargetInfo::LongAccumAlign
unsigned char LongAccumAlign
Definition: TargetInfo.h:84
clang::TargetInfo::MaxAtomicPromoteWidth
unsigned char MaxAtomicPromoteWidth
Definition: TargetInfo.h:208
clang::TargetInfo::ConstraintInfo::setAllowsRegister
void setAllowsRegister()
Definition: TargetInfo.h:1025
clang::TransferrableTargetInfo::FloatFormat
const llvm::fltSemantics * FloatFormat
Definition: TargetInfo.h:115
clang::TransferrableTargetInfo::FractAlign
unsigned char FractAlign
Definition: TargetInfo.h:86
clang::TargetInfo::ARMCDECoprocMask
unsigned ARMCDECoprocMask
Definition: TargetInfo.h:234
clang::TargetInfo::checkCFProtectionBranchSupported
virtual bool checkCFProtectionBranchSupported(DiagnosticsEngine &Diags) const
Check if the target supports CFProtection branch.
Definition: TargetInfo.cpp:162
clang::TargetInfo::ConstraintInfo::setAllowsMemory
void setAllowsMemory()
Definition: TargetInfo.h:1024
AddressSpaces.h
clang::TargetInfo::HasLegalHalfType
bool HasLegalHalfType
Definition: TargetInfo.h:200
clang::FloatModeKind
FloatModeKind
Definition: TargetInfo.h:56
clang::TargetInfo::getShortAlign
unsigned getShortAlign() const
Return the alignment of 'signed short' and 'unsigned short' for this target.
Definition: TargetInfo.h:448
clang::TargetInfo::ConstraintInfo::setIsReadWrite
void setIsReadWrite()
Definition: TargetInfo.h:1022
clang::TargetInfo::HasAArch64SVETypes
unsigned HasAArch64SVETypes
Definition: TargetInfo.h:228
clang::TargetInfo::getSupportedOpenCLOpts
llvm::StringMap< bool > & getSupportedOpenCLOpts()
Get supported OpenCL extensions and optional core features.
Definition: TargetInfo.h:1533
clang::TransferrableTargetInfo::HalfAlign
unsigned char HalfAlign
Definition: TargetInfo.h:72
llvm::MutableArrayRef
Definition: LLVM.h:35
DefaultAddrSpaceMap
static const LangASMap DefaultAddrSpaceMap
Definition: TargetInfo.cpp:25
clang::TargetInfo::getTypeAlign
unsigned getTypeAlign(IntType T) const
Return the alignment (in bits) of the specified integer type enum.
Definition: TargetInfo.cpp:313
clang::TargetInfo::getLongLongAlign
unsigned getLongLongAlign() const
Definition: TargetInfo.h:463
clang::TargetInfo::getFloatWidth
unsigned getFloatWidth() const
getFloatWidth/Align/Format - Return the size/align/format of 'float'.
Definition: TargetInfo.h:652
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::LangASMap
unsigned[(unsigned) LangAS::FirstTargetAddressSpace] LangASMap
The type of a lookup table which maps from language-specific address spaces to target-specific ones.
Definition: AddressSpaces.h:67
clang::TargetInfo::getLongFractScale
unsigned getLongFractScale() const
getLongFractScale - Return the number of fractional bits in a 'signed long _Fract' type.
Definition: TargetInfo.h:556
clang::TransferrableTargetInfo::FloatAlign
unsigned char FloatAlign
Definition: TargetInfo.h:74
clang::TargetInfo::getRealTypeByWidth
FloatModeKind getRealTypeByWidth(unsigned BitWidth, FloatModeKind ExplicitType) const
Return floating point type with specified width.
Definition: TargetInfo.cpp:282
clang::TargetInfo::ConstraintInfo::setRequiresImmediate
void setRequiresImmediate(int Min, int Max)
Definition: TargetInfo.h:1027
clang::TransferrableTargetInfo::LongFractAlign
unsigned char LongFractAlign
Definition: TargetInfo.h:87
clang::TargetInfo::getNormalizedGCCRegisterName
StringRef getNormalizedGCCRegisterName(StringRef Name, bool ReturnCanonical=false) const
Returns the "normalized" GCC register name.
Definition: TargetInfo.cpp:561
clang::TargetInfo::TargetInfo
TargetInfo(const llvm::Triple &T)
Definition: TargetInfo.cpp:28
removeGCCRegisterPrefix
static StringRef removeGCCRegisterPrefix(StringRef Name)
Definition: TargetInfo.cpp:498
clang::TargetInfo::getUnsignedAccumIBits
unsigned getUnsignedAccumIBits() const
Definition: TargetInfo.h:530
clang::TransferrableTargetInfo::LongLongWidth
unsigned char LongLongWidth
Definition: TargetInfo.h:79
clang::TargetInfo::SimdDefaultAlign
unsigned short SimdDefaultAlign
Definition: TargetInfo.h:209
clang::TargetInfo::getUnsignedAccumScale
unsigned getUnsignedAccumScale() const
getUnsignedAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned _Accum' ty...
Definition: TargetInfo.h:527
LangOptions.h
Diagnostic.h
clang::TargetInfo::initFeatureMap
virtual bool initFeatureMap(llvm::StringMap< bool > &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector< std::string > &FeatureVec) const
Initialize the map with the default set of target features for the CPU this should include all legal ...
Definition: TargetInfo.cpp:461
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:593
clang::TransferrableTargetInfo::Ibm128Align
unsigned char Ibm128Align
Definition: TargetInfo.h:76
clang::TargetInfo::getMaxPointerWidth
virtual uint64_t getMaxPointerWidth() const
Return the maximum width of pointers on this target.
Definition: TargetInfo.h:425
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::LangAS::opencl_constant
@ opencl_constant
clang::TargetInfo::resetDataLayout
void resetDataLayout(StringRef DL, const char *UserLabelPrefix="")
Definition: TargetInfo.cpp:156
clang::TargetInfo::GCCRegAlias
Definition: TargetInfo.h:1142
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:267
clang::TargetInfo::getDoubleWidth
unsigned getDoubleWidth() const
getDoubleWidth/Align/Format - Return the size/align/format of 'double'.
Definition: TargetInfo.h:662
clang::TargetInfo::ConstraintInfo::getConstraintStr
const std::string & getConstraintStr() const
Definition: TargetInfo.h:989
clang::TransferrableTargetInfo::ShortAccumWidth
unsigned char ShortAccumWidth
Definition: TargetInfo.h:82
clang::TargetInfo::VLASupported
bool VLASupported
Definition: TargetInfo.h:198
getName
static std::string getName(const CallEvent &Call)
Definition: ReturnValueChecker.cpp:60
clang::TransferrableTargetInfo::Char16Type
IntType Char16Type
Definition: TargetInfo.h:135
clang::TargetInfo::HasStrictFP
bool HasStrictFP
Definition: TargetInfo.h:206
clang::TargetInfo::HasRISCVVTypes
unsigned HasRISCVVTypes
Definition: TargetInfo.h:230
clang::TargetInfo::getOpenCLTypeAddrSpace
virtual LangAS getOpenCLTypeAddrSpace(OpenCLTypeKind TK) const
Get address space for OpenCL type.
Definition: TargetInfo.cpp:481
clang::TransferrableTargetInfo::AccumAlign
unsigned char AccumAlign
Definition: TargetInfo.h:83
clang::TargetInfo::ConstraintInfo::earlyClobber
bool earlyClobber()
Definition: TargetInfo.h:992
clang::FloatModeKind::Double
@ Double
clang::TargetInfo::HasFloat128
bool HasFloat128
Definition: TargetInfo.h:202
clang::TransferrableTargetInfo::Ibm128Format
const llvm::fltSemantics * Ibm128Format
Definition: TargetInfo.h:116
clang::FloatModeKind::NoFloat
@ NoFloat
clang::TargetInfo::ConstraintInfo::ConstraintStr
std::string ConstraintStr
Definition: TargetInfo.h:979
clang::LangAS
LangAS
Defines the address space values used by the address space qualifier of QualType.
Definition: AddressSpaces.h:25
clang::TargetInfo::hasIbm128Type
virtual bool hasIbm128Type() const
Determine whether the __ibm128 type is supported on this target.
Definition: TargetInfo.h:602
clang::TargetCXXABI::set
void set(Kind kind)
Definition: TargetCXXABI.h:78
clang::TargetInfo::getTriple
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
Definition: TargetInfo.h:1130
clang::TargetInfo::AddlRegName
Definition: TargetInfo.h:1147
clang::TargetInfo::ConstraintInfo::allowsRegister
bool allowsRegister() const
Definition: TargetInfo.h:993
clang::TargetInfo::UserLabelPrefix
const char * UserLabelPrefix
Definition: TargetInfo.h:211
clang::TransferrableTargetInfo::PtrDiffType
IntType PtrDiffType
Definition: TargetInfo.h:134
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:1260
clang::TargetInfo::getTypeName
static const char * getTypeName(IntType T)
Return the user string for the specified integer type enum.
Definition: TargetInfo.cpp:175
CharInfo.h
clang::TargetInfo::validateInputConstraint
bool validateInputConstraint(MutableArrayRef< ConstraintInfo > OutputConstraints, ConstraintInfo &info) const
Definition: TargetInfo.cpp:699
clang::TargetInfo::TLSSupported
bool TLSSupported
Definition: TargetInfo.h:197
clang::TargetInfo::~TargetInfo
virtual ~TargetInfo()
Definition: TargetInfo.cpp:154
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:567
clang::TargetInfo::PlatformName
StringRef PlatformName
Definition: TargetInfo.h:217
clang::TransferrableTargetInfo::ProcessIDType
IntType ProcessIDType
Definition: TargetInfo.h:136
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:508
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:212
clang::TransferrableTargetInfo::NoInt
@ NoInt
Definition: TargetInfo.h:120
clang::TargetInfo::AddrSpaceMap
const LangASMap * AddrSpaceMap
Definition: TargetInfo.h:215
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:1005
llvm::ArrayRef< const char * >
clang::LangAS::opencl_global
@ opencl_global
clang::TransferrableTargetInfo::LongDoubleFormat
const llvm::fltSemantics * LongDoubleFormat
Definition: TargetInfo.h:116
clang::TransferrableTargetInfo::ShortAccumScale
unsigned char ShortAccumScale
Definition: TargetInfo.h:103
clang::TargetInfo::checkArithmeticFenceSupported
virtual bool checkArithmeticFenceSupported() const
Controls if __arithmetic_fence is supported in the targeted backend.
Definition: TargetInfo.h:1448
clang::TargetInfo::getUnsignedLongAccumIBits
unsigned getUnsignedLongAccumIBits() const
Definition: TargetInfo.h:540
clang::OCLTK_Sampler
@ OCLTK_Sampler
Definition: TargetInfo.h:184
clang::TargetInfo::ConstraintInfo::getTiedOperand
unsigned getTiedOperand() const
Definition: TargetInfo.h:1006
clang::TargetInfo::MaxOpenCLWorkGroupSize
unsigned MaxOpenCLWorkGroupSize
Definition: TargetInfo.h:236
clang::TransferrableTargetInfo::DoubleFormat
const llvm::fltSemantics * DoubleFormat
Definition: TargetInfo.h:116
clang::TargetInfo::MaxAtomicInlineWidth
unsigned char MaxAtomicInlineWidth
Definition: TargetInfo.h:208
clang::TargetInfo::ConstraintInfo::isReadWrite
bool isReadWrite() const
Definition: TargetInfo.h:991
clang::TransferrableTargetInfo::MaxVectorAlign
unsigned MaxVectorAlign
Definition: TargetInfo.h:112
clang::TargetInfo::getIntAlign
unsigned getIntAlign() const
Definition: TargetInfo.h:453
clang::TransferrableTargetInfo::IntAlign
unsigned char IntAlign
Definition: TargetInfo.h:71
clang::TargetInfo::ConstraintInfo
Definition: TargetInfo.h:960
clang::TransferrableTargetInfo::UseBitFieldTypeAlignment
unsigned UseBitFieldTypeAlignment
Control whether the alignment of bit-field types is respected when laying out structures.
Definition: TargetInfo.h:149
clang::LangOptions
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:58
clang::TransferrableTargetInfo
Fields controlling how types are laid out in memory; these may need to be copied for targets like AMD...
Definition: TargetInfo.h: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:252
clang::TransferrableTargetInfo::IntType
IntType
===-— Target Data Type Query Methods ----------------------------—===//
Definition: TargetInfo.h:119
clang::TargetInfo::getShortAccumIBits
unsigned getShortAccumIBits() const
Definition: TargetInfo.h:498
clang::FloatModeKind::Ibm128
@ Ibm128
clang::TargetInfo::getShortWidth
unsigned getShortWidth() const
Return the size of 'signed short' and 'unsigned short' for this target, in bits.
Definition: TargetInfo.h:444
clang::LangAS::Default
@ Default
clang::TransferrableTargetInfo::FloatWidth
unsigned char FloatWidth
Definition: TargetInfo.h:74
clang::TransferrableTargetInfo::HalfFormat
const llvm::fltSemantics * HalfFormat
Definition: TargetInfo.h:115
clang::OpenCLTypeKind
OpenCLTypeKind
OpenCL type kinds.
Definition: TargetInfo.h:176
clang::TargetInfo::ComplexLongDoubleUsesFP2Ret
unsigned ComplexLongDoubleUsesFP2Ret
Definition: TargetInfo.h:222
clang::TargetInfo::getTypeWidth
unsigned getTypeWidth(IntType T) const
Return the width (in bits) of the specified integer type enum.
Definition: TargetInfo.cpp:236
clang::TargetInfo::HasFloat16
bool HasFloat16
Definition: TargetInfo.h:203
clang
Definition: CalledOnceCheck.h:17
clang::TargetInfo::getTypeFormatModifier
static const char * getTypeFormatModifier(IntType T)
Return the printf format modifier for the specified integer type enum.
Definition: TargetInfo.cpp:218
clang::TransferrableTargetInfo::Int16Type
IntType Int16Type
Definition: TargetInfo.h:135
clang::FloatModeKind::Float
@ Float
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:1253
clang::TransferrableTargetInfo::SignedInt
@ SignedInt
Definition: TargetInfo.h:125
clang::TransferrableTargetInfo::MinGlobalAlign
unsigned char MinGlobalAlign
Definition: TargetInfo.h:109
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::isDigit
LLVM_READONLY bool isDigit(unsigned char c)
Return true if this character is an ASCII digit: [0-9].
Definition: CharInfo.h:98
clang::TransferrableTargetInfo::AccumScale
unsigned char AccumScale
Definition: TargetInfo.h:104
clang::TransferrableTargetInfo::PaddingOnUnsignedFixedPoint
bool PaddingOnUnsignedFixedPoint
Definition: TargetInfo.h:94
clang::TargetInfo::getUnsignedShortFractScale
unsigned getUnsignedShortFractScale() const
getUnsignedShortFractScale - Return the number of fractional bits in a 'unsigned short _Fract' type.
Definition: TargetInfo.h:560
clang::TargetInfo::getGCCRegNames
virtual ArrayRef< const char * > getGCCRegNames() const =0
clang::TargetInfo::getCharAlign
unsigned getCharAlign() const
Definition: TargetInfo.h:440
clang::TargetInfo::getShortFractScale
unsigned getShortFractScale() const
getShortFractScale - Return the number of fractional bits in a 'signed short _Fract' type.
Definition: TargetInfo.h:548
clang::TargetInfo::SSERegParmMax
unsigned char SSERegParmMax
Definition: TargetInfo.h:213
clang::OCLTK_Pipe
@ OCLTK_Pipe
Definition: TargetInfo.h:181
clang::TargetInfo::getGCCAddlRegNames
virtual ArrayRef< AddlRegName > getGCCAddlRegNames() const
Definition: TargetInfo.h:1595
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:1050
clang::TransferrableTargetInfo::SignedShort
@ SignedShort
Definition: TargetInfo.h:123
clang::TransferrableTargetInfo::NewAlign
unsigned short NewAlign
Definition: TargetInfo.h:111
clang::TransferrableTargetInfo::IntWidth
unsigned char IntWidth
Definition: TargetInfo.h:71
clang::TransferrableTargetInfo::WCharType
IntType WCharType
Definition: TargetInfo.h:134
clang::TransferrableTargetInfo::PointerWidth
unsigned char PointerWidth
Definition: TargetInfo.h:69
clang::TargetInfo::CallingConvKind
CallingConvKind
Definition: TargetInfo.h:1479
clang::TargetInfo::resolveSymbolicName
bool resolveSymbolicName(const char *&Name, ArrayRef< ConstraintInfo > OutputConstraints, unsigned &Index) const
Definition: TargetInfo.cpp:676
clang::TargetInfo::HasBuiltinMSVaList
unsigned HasBuiltinMSVaList
Definition: TargetInfo.h:224
clang::TransferrableTargetInfo::ZeroLengthBitfieldBoundary
unsigned ZeroLengthBitfieldBoundary
If non-zero, specifies a fixed alignment value for bitfields that follow zero length bitfield,...
Definition: TargetInfo.h:168
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::TargetInfo::getIntWidth
unsigned getIntWidth() const
getIntWidth/Align - Return the size of 'signed int' and 'unsigned int' for this target,...
Definition: TargetInfo.h:452
clang::TargetInfo::validateOutputConstraint
bool validateOutputConstraint(ConstraintInfo &Info) const
Definition: TargetInfo.cpp:602
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:876
clang::TransferrableTargetInfo::LongDoubleAlign
unsigned char LongDoubleAlign
Definition: TargetInfo.h:76
clang::TransferrableTargetInfo::SizeType
IntType SizeType
Definition: TargetInfo.h:134
clang::TargetInfo::getUnsignedLongFractScale
unsigned getUnsignedLongFractScale() const
getUnsignedLongFractScale - Return the number of fractional bits in a 'unsigned long _Fract' type.
Definition: TargetInfo.h:573
clang::DiagnosticsEngine::Report
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Definition: Diagnostic.h:1523
clang::TransferrableTargetInfo::SignedLong
@ SignedLong
Definition: TargetInfo.h:127
clang::TransferrableTargetInfo::Char32Type
IntType Char32Type
Definition: TargetInfo.h:135
clang::TransferrableTargetInfo::FractWidth
unsigned char FractWidth
Definition: TargetInfo.h:86