clang 22.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 interface.
10//
11//===----------------------------------------------------------------------===//
12
19#include "llvm/ADT/APFloat.h"
20#include "llvm/ADT/STLExtras.h"
21#include "llvm/ADT/StringExtras.h"
22#include "llvm/Support/ErrorHandling.h"
23#include "llvm/TargetParser/TargetParser.h"
24#include <cstdlib>
25using namespace clang;
26
27static const LangASMap DefaultAddrSpaceMap = {0};
28// The fake address space map must have a distinct entry for each
29// language-specific address space.
31 0, // Default
32 1, // opencl_global
33 3, // opencl_local
34 2, // opencl_constant
35 0, // opencl_private
36 4, // opencl_generic
37 5, // opencl_global_device
38 6, // opencl_global_host
39 7, // cuda_device
40 8, // cuda_constant
41 9, // cuda_shared
42 1, // sycl_global
43 5, // sycl_global_device
44 6, // sycl_global_host
45 3, // sycl_local
46 0, // sycl_private
47 10, // ptr32_sptr
48 11, // ptr32_uptr
49 12, // ptr64
50 13, // hlsl_groupshared
51 14, // hlsl_constant
52 15, // hlsl_private
53 16, // hlsl_device
54 17, // hlsl_input
55 20, // wasm_funcref
56};
57
58// TargetInfo Constructor.
59TargetInfo::TargetInfo(const llvm::Triple &T) : Triple(T) {
60 // Set defaults. Defaults are set for a 32-bit RISC platform, like PPC or
61 // SPARC. These should be overridden by concrete targets as needed.
62 HasMustTail = true;
63 BigEndian = !T.isLittleEndian();
64 TLSSupported = true;
65 VLASupported = true;
66 NoAsmVariants = false;
67 HasFastHalfType = false;
68 HalfArgsAndReturns = false;
69 HasFloat128 = false;
70 HasIbm128 = false;
71 HasFloat16 = false;
72 HasBFloat16 = false;
73 HasFullBFloat16 = false;
74 HasLongDouble = true;
75 HasFPReturn = true;
76 HasStrictFP = false;
78 BoolWidth = BoolAlign = 8;
80 IntWidth = IntAlign = 32;
81 LongWidth = LongAlign = 32;
83 Int128Align = 128;
84
85 // Fixed point default bit widths
92
93 // Fixed point default integral and fractional bit sizes
94 // We give the _Accum 1 fewer fractional bits than their corresponding _Fract
95 // types by default to have the same number of fractional bits between _Accum
96 // and _Fract types.
99 AccumScale = 15;
100 LongAccumScale = 31;
101
102 SuitableAlign = 64;
104 MinGlobalAlign = 0;
105 // From the glibc documentation, on GNU systems, malloc guarantees 16-byte
106 // alignment on 64-bit systems and 8-byte alignment on 32-bit systems. See
107 // https://www.gnu.org/software/libc/manual/html_node/Malloc-Examples.html.
108 // This alignment guarantee also applies to Windows and Android. On Darwin
109 // and OpenBSD, the alignment is 16 bytes on both 64-bit and 32-bit systems.
110 if (T.isGNUEnvironment() || T.isWindowsMSVCEnvironment() || T.isAndroid() ||
111 T.isOHOSFamily())
112 NewAlign = Triple.isArch64Bit() ? 128 : Triple.isArch32Bit() ? 64 : 0;
113 else if (T.isOSDarwin() || T.isOSOpenBSD())
114 NewAlign = 128;
115 else
116 NewAlign = 0; // Infer from basic type alignment.
117 HalfWidth = 16;
118 HalfAlign = 16;
119 FloatWidth = 32;
120 FloatAlign = 32;
121 DoubleWidth = 64;
122 DoubleAlign = 64;
123 LongDoubleWidth = 64;
124 LongDoubleAlign = 64;
125 Float128Align = 128;
126 Ibm128Align = 128;
128 LargeArrayAlign = 0;
130 MaxVectorAlign = 0;
131 MaxTLSAlign = 0;
152 HalfFormat = &llvm::APFloat::IEEEhalf();
153 FloatFormat = &llvm::APFloat::IEEEsingle();
154 DoubleFormat = &llvm::APFloat::IEEEdouble();
155 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
156 Float128Format = &llvm::APFloat::IEEEquad();
157 Ibm128Format = &llvm::APFloat::PPCDoubleDouble();
158 MCountName = "mcount";
159 UserLabelPrefix = Triple.isOSBinFormatMachO() ? "_" : "";
160 RegParmMax = 0;
161 SSERegParmMax = 0;
162 HasAlignMac68kSupport = false;
163 HasBuiltinMSVaList = false;
164 HasAArch64ACLETypes = false;
165 HasRISCVVTypes = false;
167 HasUnalignedAccess = false;
169
170 // Default to no types using fpret.
172
173 // Default to not using fp2ret for __Complex long double
175
176 // Set the C++ ABI based on the triple.
177 TheCXXABI.set(Triple.isKnownWindowsMSVCEnvironment() || Triple.isUEFI()
178 ? TargetCXXABI::Microsoft
179 : TargetCXXABI::GenericItanium);
180
181 HasMicrosoftRecordLayout = TheCXXABI.isMicrosoft();
182
183 // Default to an empty address space map.
186
187 // Default to an unknown platform name.
188 PlatformName = "unknown";
189 PlatformMinVersion = VersionTuple();
190
192
193 MaxBitIntWidth.reset();
194}
195
196// Out of line virtual dtor for TargetInfo.
198
199void TargetInfo::resetDataLayout(StringRef DL) { DataLayoutString = DL.str(); }
200
202 DataLayoutString = Triple.computeDataLayout(getABI());
203}
204
205bool
207 Diags.Report(diag::err_opt_not_valid_on_target) << "cf-protection=branch";
208 return false;
209}
210
212 // if this hook is called, the target should override it to return a
213 // non-default scheme
214 llvm::report_fatal_error("not implemented");
215}
216
218 const CFBranchLabelSchemeKind Scheme, DiagnosticsEngine &Diags) const {
220 Diags.Report(diag::err_opt_not_valid_on_target)
221 << (Twine("mcf-branch-label-scheme=") +
223 .str();
224 return false;
225}
226
227bool
229 Diags.Report(diag::err_opt_not_valid_on_target) << "cf-protection=return";
230 return false;
231}
232
233/// getTypeName - Return the user string for the specified integer type enum.
234/// For example, SignedShort -> "short".
236 switch (T) {
237 default: llvm_unreachable("not an integer!");
238 case SignedChar: return "signed char";
239 case UnsignedChar: return "unsigned char";
240 case SignedShort: return "short";
241 case UnsignedShort: return "unsigned short";
242 case SignedInt: return "int";
243 case UnsignedInt: return "unsigned int";
244 case SignedLong: return "long int";
245 case UnsignedLong: return "long unsigned int";
246 case SignedLongLong: return "long long int";
247 case UnsignedLongLong: return "long long unsigned int";
248 }
249}
250
251/// getTypeConstantSuffix - Return the constant suffix for the specified
252/// integer type enum. For example, SignedLong -> "L".
254 switch (T) {
255 default: llvm_unreachable("not an integer!");
256 case SignedChar:
257 case SignedShort:
258 case SignedInt: return "";
259 case SignedLong: return "L";
260 case SignedLongLong: return "LL";
261 case UnsignedChar:
262 if (getCharWidth() < getIntWidth())
263 return "";
264 [[fallthrough]];
265 case UnsignedShort:
266 if (getShortWidth() < getIntWidth())
267 return "";
268 [[fallthrough]];
269 case UnsignedInt: return "U";
270 case UnsignedLong: return "UL";
271 case UnsignedLongLong: return "ULL";
272 }
273}
274
275/// getTypeFormatModifier - Return the printf format modifier for the
276/// specified integer type enum. For example, SignedLong -> "l".
277
279 switch (T) {
280 default: llvm_unreachable("not an integer!");
281 case SignedChar:
282 case UnsignedChar: return "hh";
283 case SignedShort:
284 case UnsignedShort: return "h";
285 case SignedInt:
286 case UnsignedInt: return "";
287 case SignedLong:
288 case UnsignedLong: return "l";
289 case SignedLongLong:
290 case UnsignedLongLong: return "ll";
291 }
292}
293
294/// getTypeWidth - Return the width (in bits) of the specified integer type
295/// enum. For example, SignedInt -> getIntWidth().
297 switch (T) {
298 default: llvm_unreachable("not an integer!");
299 case SignedChar:
300 case UnsignedChar: return getCharWidth();
301 case SignedShort:
302 case UnsignedShort: return getShortWidth();
303 case SignedInt:
304 case UnsignedInt: return getIntWidth();
305 case SignedLong:
306 case UnsignedLong: return getLongWidth();
307 case SignedLongLong:
308 case UnsignedLongLong: return getLongLongWidth();
309 };
310}
311
313 unsigned BitWidth, bool IsSigned) const {
314 if (getCharWidth() == BitWidth)
315 return IsSigned ? SignedChar : UnsignedChar;
316 if (getShortWidth() == BitWidth)
317 return IsSigned ? SignedShort : UnsignedShort;
318 if (getIntWidth() == BitWidth)
319 return IsSigned ? SignedInt : UnsignedInt;
320 if (getLongWidth() == BitWidth)
321 return IsSigned ? SignedLong : UnsignedLong;
322 if (getLongLongWidth() == BitWidth)
323 return IsSigned ? SignedLongLong : UnsignedLongLong;
324 return NoInt;
325}
326
328 bool IsSigned) const {
329 if (getCharWidth() >= BitWidth)
330 return IsSigned ? SignedChar : UnsignedChar;
331 if (getShortWidth() >= BitWidth)
332 return IsSigned ? SignedShort : UnsignedShort;
333 if (getIntWidth() >= BitWidth)
334 return IsSigned ? SignedInt : UnsignedInt;
335 if (getLongWidth() >= BitWidth)
336 return IsSigned ? SignedLong : UnsignedLong;
337 if (getLongLongWidth() >= BitWidth)
338 return IsSigned ? SignedLongLong : UnsignedLongLong;
339 return NoInt;
340}
341
343 FloatModeKind ExplicitType) const {
344 if (getHalfWidth() == BitWidth)
345 return FloatModeKind::Half;
346 if (getFloatWidth() == BitWidth)
348 if (getDoubleWidth() == BitWidth)
350
351 switch (BitWidth) {
352 case 96:
353 if (&getLongDoubleFormat() == &llvm::APFloat::x87DoubleExtended())
355 break;
356 case 128:
357 // The caller explicitly asked for an IEEE compliant type but we still
358 // have to check if the target supports it.
359 if (ExplicitType == FloatModeKind::Float128)
362 if (ExplicitType == FloatModeKind::Ibm128)
365 if (&getLongDoubleFormat() == &llvm::APFloat::PPCDoubleDouble() ||
366 &getLongDoubleFormat() == &llvm::APFloat::IEEEquad())
368 if (hasFloat128Type())
370 break;
371 }
372
374}
375
376/// getTypeAlign - Return the alignment (in bits) of the specified integer type
377/// enum. For example, SignedInt -> getIntAlign().
379 switch (T) {
380 default: llvm_unreachable("not an integer!");
381 case SignedChar:
382 case UnsignedChar: return getCharAlign();
383 case SignedShort:
384 case UnsignedShort: return getShortAlign();
385 case SignedInt:
386 case UnsignedInt: return getIntAlign();
387 case SignedLong:
388 case UnsignedLong: return getLongAlign();
389 case SignedLongLong:
390 case UnsignedLongLong: return getLongLongAlign();
391 };
392}
393
394/// isTypeSigned - Return whether an integer types is signed. Returns true if
395/// the type is signed; false otherwise.
397 switch (T) {
398 default: llvm_unreachable("not an integer!");
399 case SignedChar:
400 case SignedShort:
401 case SignedInt:
402 case SignedLong:
403 case SignedLongLong:
404 return true;
405 case UnsignedChar:
406 case UnsignedShort:
407 case UnsignedInt:
408 case UnsignedLong:
409 case UnsignedLongLong:
410 return false;
411 };
412}
413
414/// adjust - Set forced language options.
415/// Apply changes to the target information with respect to certain
416/// language options which change the target configuration and adjust
417/// the language based on the target options where applicable.
419 const TargetInfo *Aux) {
420 if (Opts.NoBitFieldTypeAlign)
422
423 switch (Opts.WCharSize) {
424 default: llvm_unreachable("invalid wchar_t width");
425 case 0: break;
426 case 1: WCharType = Opts.WCharIsSigned ? SignedChar : UnsignedChar; break;
427 case 2: WCharType = Opts.WCharIsSigned ? SignedShort : UnsignedShort; break;
428 case 4: WCharType = Opts.WCharIsSigned ? SignedInt : UnsignedInt; break;
429 }
430
431 if (Opts.AlignDouble) {
433 LongDoubleAlign = 64;
434 }
435
436 // HLSL explicitly defines the sizes and formats of some data types, and we
437 // need to conform to those regardless of what architecture you are targeting.
438 if (Opts.HLSL) {
439 BoolWidth = BoolAlign = 32;
440 LongWidth = LongAlign = 64;
441 if (!Opts.NativeHalfType) {
442 HalfFormat = &llvm::APFloat::IEEEsingle();
443 HalfWidth = HalfAlign = 32;
444 }
445 }
446
447 if (Opts.OpenCL) {
448 // OpenCL C requires specific widths for types, irrespective of
449 // what these normally are for the target.
450 // We also define long long and long double here, although the
451 // OpenCL standard only mentions these as "reserved".
452 ShortWidth = ShortAlign = 16;
453 IntWidth = IntAlign = 32;
454 LongWidth = LongAlign = 64;
456 HalfWidth = HalfAlign = 16;
457 FloatWidth = FloatAlign = 32;
458
459 // Embedded 32-bit targets (OpenCL EP) might have double C type
460 // defined as float. Let's not override this as it might lead
461 // to generating illegal code that uses 64bit doubles.
462 if (DoubleWidth != FloatWidth) {
464 DoubleFormat = &llvm::APFloat::IEEEdouble();
465 }
467
468 unsigned MaxPointerWidth = getMaxPointerWidth();
469 assert(MaxPointerWidth == 32 || MaxPointerWidth == 64);
470 bool Is32BitArch = MaxPointerWidth == 32;
471 SizeType = Is32BitArch ? UnsignedInt : UnsignedLong;
472 PtrDiffType = Is32BitArch ? SignedInt : SignedLong;
473 IntPtrType = Is32BitArch ? SignedInt : SignedLong;
474
477
478 HalfFormat = &llvm::APFloat::IEEEhalf();
479 FloatFormat = &llvm::APFloat::IEEEsingle();
480 LongDoubleFormat = &llvm::APFloat::IEEEquad();
481
482 // OpenCL C v3.0 s6.7.5 - The generic address space requires support for
483 // OpenCL C 2.0 or OpenCL C 3.0 with the __opencl_c_generic_address_space
484 // feature
485 // OpenCL C v3.0 s6.2.1 - OpenCL pipes require support of OpenCL C 2.0
486 // or later and __opencl_c_pipes feature
487 // FIXME: These language options are also defined in setLangDefaults()
488 // for OpenCL C 2.0 but with no access to target capabilities. Target
489 // should be immutable once created and thus these language options need
490 // to be defined only once.
491 if (Opts.getOpenCLCompatibleVersion() == 300) {
492 const auto &OpenCLFeaturesMap = getSupportedOpenCLOpts();
493 Opts.OpenCLGenericAddressSpace = hasFeatureEnabled(
494 OpenCLFeaturesMap, "__opencl_c_generic_address_space");
495 Opts.OpenCLPipes =
496 hasFeatureEnabled(OpenCLFeaturesMap, "__opencl_c_pipes");
497 Opts.Blocks =
498 hasFeatureEnabled(OpenCLFeaturesMap, "__opencl_c_device_enqueue");
499 }
500 }
501
502 if (Opts.DoubleSize) {
503 if (Opts.DoubleSize == 32) {
504 DoubleWidth = 32;
505 LongDoubleWidth = 32;
506 DoubleFormat = &llvm::APFloat::IEEEsingle();
507 LongDoubleFormat = &llvm::APFloat::IEEEsingle();
508 } else if (Opts.DoubleSize == 64) {
509 DoubleWidth = 64;
510 LongDoubleWidth = 64;
511 DoubleFormat = &llvm::APFloat::IEEEdouble();
512 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
513 }
514 }
515
516 if (Opts.LongDoubleSize) {
517 if (Opts.LongDoubleSize == DoubleWidth) {
521 } else if (Opts.LongDoubleSize == 128) {
523 LongDoubleFormat = &llvm::APFloat::IEEEquad();
524 } else if (Opts.LongDoubleSize == 80) {
525 LongDoubleFormat = &llvm::APFloat::x87DoubleExtended();
526 if (getTriple().isWindowsMSVCEnvironment()) {
527 LongDoubleWidth = 128;
528 LongDoubleAlign = 128;
529 } else { // Linux
530 if (getTriple().getArch() == llvm::Triple::x86) {
531 LongDoubleWidth = 96;
532 LongDoubleAlign = 32;
533 } else {
534 LongDoubleWidth = 128;
535 LongDoubleAlign = 128;
536 }
537 }
538 }
539 }
540
541 if (Opts.NewAlignOverride)
542 NewAlign = Opts.NewAlignOverride * getCharWidth();
543
544 // Each unsigned fixed point type has the same number of fractional bits as
545 // its corresponding signed type.
546 PaddingOnUnsignedFixedPoint |= Opts.PaddingOnUnsignedFixedPoint;
547 CheckFixedPointBits();
548
549 if (Opts.ProtectParens && !checkArithmeticFenceSupported()) {
550 Diags.Report(diag::err_opt_not_valid_on_target) << "-fprotect-parens";
551 Opts.ProtectParens = false;
552 }
553
554 if (Opts.MaxBitIntWidth)
555 MaxBitIntWidth = static_cast<unsigned>(Opts.MaxBitIntWidth);
556
557 if (Opts.FakeAddressSpaceMap)
559
560 // Check if it's CUDA device compilation; ensure layout consistency with host.
561 if (Opts.CUDA && Opts.CUDAIsDevice && Aux && !HasMicrosoftRecordLayout)
563}
564
566 llvm::StringMap<bool> &Features, DiagnosticsEngine &Diags, StringRef CPU,
567 const std::vector<std::string> &FeatureVec) const {
568 for (StringRef Name : FeatureVec) {
569 if (Name.empty())
570 continue;
571 // Apply the feature via the target.
572 if (Name[0] != '+' && Name[0] != '-')
573 Diags.Report(diag::warn_fe_backend_invalid_feature_flag) << Name;
574 else
575 setFeatureEnabled(Features, Name.substr(1), Name[0] == '+');
576 }
577 return true;
578}
579
582 if (Features == "default")
583 return Ret;
584 SmallVector<StringRef, 1> AttrFeatures;
585 Features.split(AttrFeatures, ",");
586
587 // Grab the various features and prepend a "+" to turn on the feature to
588 // the backend and add them to our existing set of features.
589 for (auto &Feature : AttrFeatures) {
590 // Go ahead and trim whitespace rather than either erroring or
591 // accepting it weirdly.
592 Feature = Feature.trim();
593
594 // TODO: Support the fpmath option. It will require checking
595 // overall feature validity for the function with the rest of the
596 // attributes on the function.
597 if (Feature.starts_with("fpmath="))
598 continue;
599
600 if (Feature.starts_with("branch-protection=")) {
601 Ret.BranchProtection = Feature.split('=').second.trim();
602 continue;
603 }
604
605 // While we're here iterating check for a different target cpu.
606 if (Feature.starts_with("arch=")) {
607 if (!Ret.CPU.empty())
608 Ret.Duplicate = "arch=";
609 else
610 Ret.CPU = Feature.split("=").second.trim();
611 } else if (Feature.starts_with("tune=")) {
612 if (!Ret.Tune.empty())
613 Ret.Duplicate = "tune=";
614 else
615 Ret.Tune = Feature.split("=").second.trim();
616 } else if (Feature.starts_with("no-"))
617 Ret.Features.push_back("-" + Feature.split("-").second.str());
618 else
619 Ret.Features.push_back("+" + Feature.str());
620 }
621 return Ret;
622}
623
625TargetInfo::getCallingConvKind(bool ClangABICompat4) const {
626 if (getCXXABI() != TargetCXXABI::Microsoft &&
627 (ClangABICompat4 || getTriple().isPS4()))
628 return CCK_ClangABI4OrPS4;
629 return CCK_Default;
630}
631
633 const LangOptions &LangOpts) const {
634 if (getCXXABI() == TargetCXXABI::Microsoft &&
635 LangOpts.getClangABICompat() > LangOptions::ClangABI::Ver21)
636 return true;
637 return false;
638}
639
641 if (getCXXABI() == TargetCXXABI::Microsoft &&
642 LangOpts.getClangABICompat() > LangOptions::ClangABI::Ver21)
643 return true;
644 return false;
645}
646
648 return LangOpts.getClangABICompat() > LangOptions::ClangABI::Ver15;
649}
650
652 auto &Opts = getSupportedOpenCLOpts();
653 if (!hasFeatureEnabled(Opts, "cl_khr_fp64") ||
654 !hasFeatureEnabled(Opts, "__opencl_c_fp64")) {
655 setFeatureEnabled(Opts, "__opencl_c_ext_fp64_global_atomic_add", false);
656 setFeatureEnabled(Opts, "__opencl_c_ext_fp64_local_atomic_add", false);
657 setFeatureEnabled(Opts, "__opencl_c_ext_fp64_global_atomic_min_max", false);
658 setFeatureEnabled(Opts, "__opencl_c_ext_fp64_local_atomic_min_max", false);
659 }
660}
661
663 switch (TK) {
664 case OCLTK_Image:
665 case OCLTK_Pipe:
667
668 case OCLTK_Sampler:
670
671 default:
672 return LangAS::Default;
673 }
674}
675
676//===----------------------------------------------------------------------===//
677
678
679static StringRef removeGCCRegisterPrefix(StringRef Name) {
680 if (Name[0] == '%' || Name[0] == '#')
681 Name = Name.substr(1);
682
683 return Name;
684}
685
686/// isValidClobber - Returns whether the passed in string is
687/// a valid clobber in an inline asm statement. This is used by
688/// Sema.
689bool TargetInfo::isValidClobber(StringRef Name) const {
690 return (isValidGCCRegisterName(Name) || Name == "memory" || Name == "cc" ||
691 Name == "unwind");
692}
693
694/// isValidGCCRegisterName - Returns whether the passed in string
695/// is a valid register name according to GCC. This is used by Sema for
696/// inline asm statements.
697bool TargetInfo::isValidGCCRegisterName(StringRef Name) const {
698 if (Name.empty())
699 return false;
700
701 // Get rid of any register prefix.
702 Name = removeGCCRegisterPrefix(Name);
703 if (Name.empty())
704 return false;
705
707
708 // If we have a number it maps to an entry in the register name array.
709 if (isDigit(Name[0])) {
710 unsigned n;
711 if (!Name.getAsInteger(0, n))
712 return n < Names.size();
713 }
714
715 // Check register names.
716 if (llvm::is_contained(Names, Name))
717 return true;
718
719 // Check any additional names that we have.
720 for (const AddlRegName &ARN : getGCCAddlRegNames())
721 for (const char *AN : ARN.Names) {
722 if (!AN)
723 break;
724 // Make sure the register that the additional name is for is within
725 // the bounds of the register names from above.
726 if (AN == Name && ARN.RegNum < Names.size())
727 return true;
728 }
729
730 // Now check aliases.
731 for (const GCCRegAlias &GRA : getGCCRegAliases())
732 for (const char *A : GRA.Aliases) {
733 if (!A)
734 break;
735 if (A == Name)
736 return true;
737 }
738
739 return false;
740}
741
743 bool ReturnCanonical) const {
744 assert(isValidGCCRegisterName(Name) && "Invalid register passed in");
745
746 // Get rid of any register prefix.
747 Name = removeGCCRegisterPrefix(Name);
748
750
751 // First, check if we have a number.
752 if (isDigit(Name[0])) {
753 unsigned n;
754 if (!Name.getAsInteger(0, n)) {
755 assert(n < Names.size() && "Out of bounds register number!");
756 return Names[n];
757 }
758 }
759
760 // Check any additional names that we have.
761 for (const AddlRegName &ARN : getGCCAddlRegNames())
762 for (const char *AN : ARN.Names) {
763 if (!AN)
764 break;
765 // Make sure the register that the additional name is for is within
766 // the bounds of the register names from above.
767 if (AN == Name && ARN.RegNum < Names.size())
768 return ReturnCanonical ? Names[ARN.RegNum] : Name;
769 }
770
771 // Now check aliases.
772 for (const GCCRegAlias &RA : getGCCRegAliases())
773 for (const char *A : RA.Aliases) {
774 if (!A)
775 break;
776 if (A == Name)
777 return RA.Register;
778 }
779
780 return Name;
781}
782
784 const char *Name = Info.getConstraintStr().c_str();
785 // An output constraint must start with '=' or '+'
786 if (*Name != '=' && *Name != '+')
787 return false;
788
789 if (*Name == '+')
790 Info.setIsReadWrite();
791
792 Name++;
793 while (*Name) {
794 switch (*Name) {
795 default:
796 if (!validateAsmConstraint(Name, Info)) {
797 // FIXME: We temporarily return false
798 // so we can add more constraints as we hit it.
799 // Eventually, an unknown constraint should just be treated as 'g'.
800 return false;
801 }
802 break;
803 case '&': // early clobber.
804 Info.setEarlyClobber();
805 break;
806 case '%': // commutative.
807 // FIXME: Check that there is a another register after this one.
808 break;
809 case 'r': // general register.
810 Info.setAllowsRegister();
811 break;
812 case 'm': // memory operand.
813 case 'o': // offsetable memory operand.
814 case 'V': // non-offsetable memory operand.
815 case '<': // autodecrement memory operand.
816 case '>': // autoincrement memory operand.
817 Info.setAllowsMemory();
818 break;
819 case 'g': // general register, memory operand or immediate integer.
820 case 'X': // any operand.
821 Info.setAllowsRegister();
822 Info.setAllowsMemory();
823 break;
824 case ',': // multiple alternative constraint. Pass it.
825 // Handle additional optional '=' or '+' modifiers.
826 if (Name[1] == '=' || Name[1] == '+')
827 Name++;
828 break;
829 case '#': // Ignore as constraint.
830 while (Name[1] && Name[1] != ',')
831 Name++;
832 break;
833 case '?': // Disparage slightly code.
834 case '!': // Disparage severely.
835 case '*': // Ignore for choosing register preferences.
836 case 'i': // Ignore i,n,E,F as output constraints (match from the other
837 // chars)
838 case 'n':
839 case 'E':
840 case 'F':
841 break; // Pass them.
842 }
843
844 Name++;
845 }
846
847 // Early clobber with a read-write constraint which doesn't permit registers
848 // is invalid.
849 if (Info.earlyClobber() && Info.isReadWrite() && !Info.allowsRegister())
850 return false;
851
852 // If a constraint allows neither memory nor register operands it contains
853 // only modifiers. Reject it.
854 return Info.allowsMemory() || Info.allowsRegister();
855}
856
857bool TargetInfo::resolveSymbolicName(const char *&Name,
858 ArrayRef<ConstraintInfo> OutputConstraints,
859 unsigned &Index) const {
860 assert(*Name == '[' && "Symbolic name did not start with '['");
861 Name++;
862 const char *Start = Name;
863 while (*Name && *Name != ']')
864 Name++;
865
866 if (!*Name) {
867 // Missing ']'
868 return false;
869 }
870
871 std::string SymbolicName(Start, Name - Start);
872
873 for (Index = 0; Index != OutputConstraints.size(); ++Index)
874 if (SymbolicName == OutputConstraints[Index].getName())
875 return true;
876
877 return false;
878}
879
881 MutableArrayRef<ConstraintInfo> OutputConstraints,
882 ConstraintInfo &Info) const {
883 const char *Name = Info.ConstraintStr.c_str();
884
885 if (!*Name)
886 return false;
887
888 while (*Name) {
889 switch (*Name) {
890 default:
891 // Check if we have a matching constraint
892 if (*Name >= '0' && *Name <= '9') {
893 const char *DigitStart = Name;
894 while (Name[1] >= '0' && Name[1] <= '9')
895 Name++;
896 const char *DigitEnd = Name;
897 unsigned i;
898 if (StringRef(DigitStart, DigitEnd - DigitStart + 1)
899 .getAsInteger(10, i))
900 return false;
901
902 // Check if matching constraint is out of bounds.
903 if (i >= OutputConstraints.size()) return false;
904
905 // A number must refer to an output only operand.
906 if (OutputConstraints[i].isReadWrite())
907 return false;
908
909 // If the constraint is already tied, it must be tied to the
910 // same operand referenced to by the number.
911 if (Info.hasTiedOperand() && Info.getTiedOperand() != i)
912 return false;
913
914 // The constraint should have the same info as the respective
915 // output constraint.
916 Info.setTiedOperand(i, OutputConstraints[i]);
917 } else if (!validateAsmConstraint(Name, Info)) {
918 // FIXME: This error return is in place temporarily so we can
919 // add more constraints as we hit it. Eventually, an unknown
920 // constraint should just be treated as 'g'.
921 return false;
922 }
923 break;
924 case '[': {
925 unsigned Index = 0;
926 if (!resolveSymbolicName(Name, OutputConstraints, Index))
927 return false;
928
929 // If the constraint is already tied, it must be tied to the
930 // same operand referenced to by the number.
931 if (Info.hasTiedOperand() && Info.getTiedOperand() != Index)
932 return false;
933
934 // A number must refer to an output only operand.
935 if (OutputConstraints[Index].isReadWrite())
936 return false;
937
938 Info.setTiedOperand(Index, OutputConstraints[Index]);
939 break;
940 }
941 case '%': // commutative
942 // FIXME: Fail if % is used with the last operand.
943 break;
944 case 'i': // immediate integer.
945 break;
946 case 'n': // immediate integer with a known value.
948 break;
949 case 'I': // Various constant constraints with target-specific meanings.
950 case 'J':
951 case 'K':
952 case 'L':
953 case 'M':
954 case 'N':
955 case 'O':
956 case 'P':
957 if (!validateAsmConstraint(Name, Info))
958 return false;
959 break;
960 case 'r': // general register.
961 Info.setAllowsRegister();
962 break;
963 case 'm': // memory operand.
964 case 'o': // offsettable memory operand.
965 case 'V': // non-offsettable memory operand.
966 case '<': // autodecrement memory operand.
967 case '>': // autoincrement memory operand.
968 Info.setAllowsMemory();
969 break;
970 case 'g': // general register, memory operand or immediate integer.
971 case 'X': // any operand.
972 Info.setAllowsRegister();
973 Info.setAllowsMemory();
974 break;
975 case 'E': // immediate floating point.
976 case 'F': // immediate floating point.
977 case 'p': // address operand.
978 break;
979 case ',': // multiple alternative constraint. Ignore comma.
980 break;
981 case '#': // Ignore as constraint.
982 while (Name[1] && Name[1] != ',')
983 Name++;
984 break;
985 case '?': // Disparage slightly code.
986 case '!': // Disparage severely.
987 case '*': // Ignore for choosing register preferences.
988 break; // Pass them.
989 }
990
991 Name++;
992 }
993
994 return true;
995}
996
997bool TargetInfo::validatePointerAuthKey(const llvm::APSInt &value) const {
998 return false;
999}
1000
1001void TargetInfo::CheckFixedPointBits() const {
1002 // Check that the number of fractional and integral bits (and maybe sign) can
1003 // fit into the bits given for a fixed point type.
1005 assert(AccumScale + getAccumIBits() + 1 <= AccumWidth);
1012
1013 assert(getShortFractScale() + 1 <= ShortFractWidth);
1014 assert(getFractScale() + 1 <= FractWidth);
1015 assert(getLongFractScale() + 1 <= LongFractWidth);
1017 assert(getUnsignedFractScale() <= FractWidth);
1019
1020 // Each unsigned fract type has either the same number of fractional bits
1021 // as, or one more fractional bit than, its corresponding signed fract type.
1024 assert(getFractScale() == getUnsignedFractScale() ||
1028
1029 // When arranged in order of increasing rank (see 6.3.1.3a), the number of
1030 // fractional bits is nondecreasing for each of the following sets of
1031 // fixed-point types:
1032 // - signed fract types
1033 // - unsigned fract types
1034 // - signed accum types
1035 // - unsigned accum types.
1036 assert(getLongFractScale() >= getFractScale() &&
1043
1044 // When arranged in order of increasing rank (see 6.3.1.3a), the number of
1045 // integral bits is nondecreasing for each of the following sets of
1046 // fixed-point types:
1047 // - signed accum types
1048 // - unsigned accum types
1049 assert(getLongAccumIBits() >= getAccumIBits() &&
1053
1054 // Each signed accum type has at least as many integral bits as its
1055 // corresponding unsigned accum type.
1057 assert(getAccumIBits() >= getUnsignedAccumIBits());
1059}
1060
1062 auto *Target = static_cast<TransferrableTargetInfo*>(this);
1063 auto *Src = static_cast<const TransferrableTargetInfo*>(Aux);
1064 *Target = *Src;
1065}
1066
1067std::string
1069 SmallVectorImpl<ConstraintInfo> *OutCons) const {
1070 std::string Result;
1071
1072 for (const char *I = Constraint.begin(), *E = Constraint.end(); I < E; I++) {
1073 switch (*I) {
1074 default:
1076 break;
1077 // Ignore these
1078 case '*':
1079 case '?':
1080 case '!':
1081 case '=': // Will see this and the following in mult-alt constraints.
1082 case '+':
1083 break;
1084 case '#': // Ignore the rest of the constraint alternative.
1085 while (I + 1 != E && I[1] != ',')
1086 I++;
1087 break;
1088 case '&':
1089 case '%':
1090 Result += *I;
1091 while (I + 1 != E && I[1] == *I)
1092 I++;
1093 break;
1094 case ',':
1095 Result += "|";
1096 break;
1097 case 'g':
1098 Result += "imr";
1099 break;
1100 case '[': {
1101 assert(OutCons &&
1102 "Must pass output names to constraints with a symbolic name");
1103 unsigned Index;
1104 bool ResolveResult = resolveSymbolicName(I, *OutCons, Index);
1105 assert(ResolveResult && "Could not resolve symbolic name");
1106 (void)ResolveResult;
1107 Result += llvm::utostr(Index);
1108 break;
1109 }
1110 }
1111 }
1112 return Result;
1113}
Provides definitions for the various language-specific address spaces.
Defines the Diagnostic-related interfaces.
static const LangASMap DefaultAddrSpaceMap
static StringRef removeGCCRegisterPrefix(StringRef Name)
static const LangASMap FakeAddrSpaceMap
Defines the clang::LangOptions interface.
Concrete class used by the front-end to report problems and issues.
Definition Diagnostic.h:232
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
unsigned getOpenCLCompatibleVersion() const
Return the OpenCL version that kernel language is compatible with.
bool isMicrosoft() const
Is this ABI an MSVC-compatible ABI?
virtual bool validatePointerAuthKey(const llvm::APSInt &value) const
Determine whether the given pointer-authentication key is valid.
unsigned getUnsignedLongFractScale() const
getUnsignedLongFractScale - Return the number of fractional bits in a 'unsigned long _Fract' type.
Definition TargetInfo.h:670
bool validateInputConstraint(MutableArrayRef< ConstraintInfo > OutputConstraints, ConstraintInfo &info) const
virtual ~TargetInfo()
bool resolveSymbolicName(const char *&Name, ArrayRef< ConstraintInfo > OutputConstraints, unsigned &Index) const
void copyAuxTarget(const TargetInfo *Aux)
Copy type and layout related info.
TargetInfo(const llvm::Triple &T)
virtual bool checkCFProtectionReturnSupported(DiagnosticsEngine &Diags) const
Check if the target supports CFProtection return.
unsigned getShortWidth() const
getShortWidth/Align - Return the size of 'signed short' and 'unsigned short' for this target,...
Definition TargetInfo.h:525
unsigned getUnsignedAccumScale() const
getUnsignedAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned _Accum' ty...
Definition TargetInfo.h:624
unsigned getIntAlign() const
Definition TargetInfo.h:531
virtual ArrayRef< AddlRegName > getGCCAddlRegNames() const
unsigned getUnsignedAccumIBits() const
Definition TargetInfo.h:627
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
const LangASMap * AddrSpaceMap
Definition TargetInfo.h:259
const char * UserLabelPrefix
Definition TargetInfo.h:254
bool HasMicrosoftRecordLayout
Definition TargetInfo.h:294
unsigned getUnsignedFractScale() const
getUnsignedFractScale - Return the number of fractional bits in a 'unsigned _Fract' type.
Definition TargetInfo.h:664
virtual bool checkCFBranchLabelSchemeSupported(const CFBranchLabelSchemeKind Scheme, DiagnosticsEngine &Diags) const
unsigned getLongAlign() const
Definition TargetInfo.h:536
virtual IntType getLeastIntTypeByWidth(unsigned BitWidth, bool IsSigned) const
Return the smallest integer type with at least the specified width.
unsigned getLongLongAlign() const
Definition TargetInfo.h:541
virtual bool hasFeatureEnabled(const llvm::StringMap< bool > &Features, StringRef Name) const
Check if target has a given feature enabled.
virtual CFBranchLabelSchemeKind getDefaultCFBranchLabelScheme() const
Get the target default CFBranchLabelScheme scheme.
unsigned char RegParmMax
Definition TargetInfo.h:256
virtual ArrayRef< const char * > getGCCRegNames() const =0
unsigned getTypeWidth(IntType T) const
Return the width (in bits) of the specified integer type enum.
virtual bool emitVectorDeletingDtors(const LangOptions &) const
Controls whether to emit MSVC vector deleting destructors.
unsigned getLongFractScale() const
getLongFractScale - Return the number of fractional bits in a 'signed long _Fract' type.
Definition TargetInfo.h:653
static bool isTypeSigned(IntType T)
Returns true if the type is signed; false otherwise.
std::optional< unsigned > MaxBitIntWidth
Definition TargetInfo.h:290
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.
unsigned getAccumIBits() const
Definition TargetInfo.h:602
virtual CallingConvKind getCallingConvKind(bool ClangABICompat4) const
std::string simplifyConstraint(StringRef Constraint, SmallVectorImpl< ConstraintInfo > *OutCons=nullptr) const
VersionTuple PlatformMinVersion
Definition TargetInfo.h:262
unsigned getIntWidth() const
getIntWidth/Align - Return the size of 'signed int' and 'unsigned int' for this target,...
Definition TargetInfo.h:530
const char * MCountName
Definition TargetInfo.h:255
unsigned getShortAccumIBits() const
Definition TargetInfo.h:595
unsigned getFloatWidth() const
getFloatWidth/Align/Format - Return the size/align/format of 'float'.
Definition TargetInfo.h:791
virtual ArrayRef< GCCRegAlias > getGCCRegAliases() const =0
StringRef getNormalizedGCCRegisterName(StringRef Name, bool ReturnCanonical=false) const
Returns the "normalized" GCC register name.
unsigned getLongAccumIBits() const
Definition TargetInfo.h:607
FloatModeKind getRealTypeByWidth(unsigned BitWidth, FloatModeKind ExplicitType) const
Return floating point type with specified width.
virtual IntType getIntTypeByWidth(unsigned BitWidth, bool IsSigned) const
Return integer type with specified width.
unsigned getHalfWidth() const
getHalfWidth/Align/Format - Return the size/align/format of 'half'.
Definition TargetInfo.h:786
unsigned char SSERegParmMax
Definition TargetInfo.h:256
unsigned HasUnalignedAccess
Definition TargetInfo.h:284
virtual void adjust(DiagnosticsEngine &Diags, LangOptions &Opts, const TargetInfo *Aux)
Set forced language options.
unsigned char MaxAtomicPromoteWidth
Definition TargetInfo.h:252
virtual LangAS getOpenCLTypeAddrSpace(OpenCLTypeKind TK) const
Get address space for OpenCL type.
static const char * getTypeName(IntType T)
Return the user string for the specified integer type enum.
unsigned getCharAlign() const
Definition TargetInfo.h:521
unsigned RealTypeUsesObjCFPRetMask
Definition TargetInfo.h:267
unsigned MaxOpenCLWorkGroupSize
Definition TargetInfo.h:288
unsigned getLongLongWidth() const
getLongLongWidth/Align - Return the size of 'signed long long' and 'unsigned long long' for this targ...
Definition TargetInfo.h:540
virtual bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &info) const =0
llvm::StringMap< bool > & getSupportedOpenCLOpts()
Get supported OpenCL extensions and optional core features.
StringRef PlatformName
Definition TargetInfo.h:261
bool UseAddrSpaceMapMangling
Specify if mangling based on address space map should be used or not for language specific address sp...
Definition TargetInfo.h:385
void resetDataLayout()
Set the data layout based on current triple and ABI.
virtual void setDependentOpenCLOpts()
Set features that depend on other features.
unsigned ComplexLongDoubleUsesFP2Ret
Definition TargetInfo.h:269
virtual bool hasIbm128Type() const
Determine whether the __ibm128 type is supported on this target.
Definition TargetInfo.h:732
unsigned getUnsignedShortAccumIBits() const
Definition TargetInfo.h:616
std::string DataLayoutString
Definition TargetInfo.h:253
unsigned getUnsignedLongAccumScale() const
getUnsignedLongAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned long _...
Definition TargetInfo.h:634
virtual bool hasFloat128Type() const
Determine whether the __float128 type is supported on this target.
Definition TargetInfo.h:717
unsigned getUnsignedLongAccumIBits() const
Definition TargetInfo.h:637
unsigned getUnsignedShortFractScale() const
getUnsignedShortFractScale - Return the number of fractional bits in a 'unsigned short _Fract' type.
Definition TargetInfo.h:657
unsigned HasAlignMac68kSupport
Definition TargetInfo.h:265
const llvm::fltSemantics & getLongDoubleFormat() const
Definition TargetInfo.h:809
bool validateOutputConstraint(ConstraintInfo &Info) const
TargetCXXABI getCXXABI() const
Get the C++ ABI currently in use.
const char * getTypeConstantSuffix(IntType T) const
Return the constant suffix for the specified integer type enum.
unsigned getDoubleWidth() const
getDoubleWidth/Align/Format - Return the size/align/format of 'double'.
Definition TargetInfo.h:801
virtual bool checkArithmeticFenceSupported() const
Controls if __arithmetic_fence is supported in the targeted backend.
virtual StringRef getABI() const
Get the ABI currently in use.
unsigned HasAArch64ACLETypes
Definition TargetInfo.h:275
bool isValidClobber(StringRef Name) const
Returns whether the passed in string is a valid clobber in an inline asm statement.
virtual bool areDefaultedSMFStillPOD(const LangOptions &) const
Controls whether explicitly defaulted (= default) special member functions disqualify something from ...
unsigned getCharWidth() const
Definition TargetInfo.h:520
unsigned HasRISCVVTypes
Definition TargetInfo.h:278
virtual ParsedTargetAttr parseTargetAttr(StringRef Str) const
unsigned getLongWidth() const
getLongWidth/Align - Return the size of 'signed long' and 'unsigned long' for this target,...
Definition TargetInfo.h:535
unsigned getFractScale() const
getFractScale - Return the number of fractional bits in a 'signed _Fract' type.
Definition TargetInfo.h:649
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 ...
virtual bool checkCFProtectionBranchSupported(DiagnosticsEngine &Diags) const
Check if the target supports CFProtection branch.
virtual std::string convertConstraint(const char *&Constraint) const
unsigned char MaxAtomicInlineWidth
Definition TargetInfo.h:252
unsigned AllowAMDGPUUnsafeFPAtomics
Definition TargetInfo.h:281
unsigned getShortFractScale() const
getShortFractScale - Return the number of fractional bits in a 'signed short _Fract' type.
Definition TargetInfo.h:645
virtual uint64_t getMaxPointerWidth() const
Return the maximum width of pointers on this target.
Definition TargetInfo.h:499
TargetCXXABI TheCXXABI
Definition TargetInfo.h:257
unsigned ARMCDECoprocMask
Definition TargetInfo.h:286
static const char * getTypeFormatModifier(IntType T)
Return the printf format modifier for the specified integer type enum.
unsigned getUnsignedShortAccumScale() const
getUnsignedShortAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned short...
Definition TargetInfo.h:613
unsigned HasBuiltinMSVaList
Definition TargetInfo.h:272
unsigned getTypeAlign(IntType T) const
Return the alignment (in bits) of the specified integer type enum.
unsigned getShortAlign() const
Definition TargetInfo.h:526
virtual bool callGlobalDeleteInDeletingDtor(const LangOptions &) const
Controls whether global operator delete is called by the deleting destructor or at the point where de...
virtual bool isValidGCCRegisterName(StringRef Name) const
Returns whether the passed in string is a valid register name according to GCC.
Defines the clang::TargetInfo interface.
The JSON file list parser is used to communicate input to InstallAPI.
if(T->getSizeExpr()) TRY_TO(TraverseStmt(const_cast< Expr * >(T -> getSizeExpr())))
OpenCLTypeKind
OpenCL type kinds.
Definition TargetInfo.h:212
@ OCLTK_Image
Definition TargetInfo.h:216
@ OCLTK_Sampler
Definition TargetInfo.h:220
@ OCLTK_Pipe
Definition TargetInfo.h:217
@ Result
The result type of a method or function.
Definition TypeBase.h:905
const FunctionProtoType * T
LLVM_READONLY bool isDigit(unsigned char c)
Return true if this character is an ASCII digit: [0-9].
Definition CharInfo.h:114
LangAS
Defines the address space values used by the address space qualifier of QualType.
static const char * getCFBranchLabelSchemeFlagVal(const CFBranchLabelSchemeKind Scheme)
FloatModeKind
Definition TargetInfo.h:75
unsigned[(unsigned) LangAS::FirstTargetAddressSpace] LangASMap
The type of a lookup table which maps from language-specific address spaces to target-specific ones.
Contains information gathered from parsing the contents of TargetAttr.
Definition TargetInfo.h:60
const std::string & getConstraintStr() const
void setTiedOperand(unsigned N, ConstraintInfo &Output)
Indicate that this is an input operand that is tied to the specified output operand.
bool hasTiedOperand() const
Return true if this input operand is a matching constraint that ties it to an output operand.
void setRequiresImmediate(int Min, int Max)
Fields controlling how types are laid out in memory; these may need to be copied for targets like AMD...
Definition TargetInfo.h:89
const llvm::fltSemantics * DoubleFormat
Definition TargetInfo.h:143
unsigned UseZeroLengthBitfieldAlignment
Whether zero length bitfields (e.g., int : 0;) force alignment of the next bitfield.
Definition TargetInfo.h:187
unsigned UseExplicitBitFieldAlignment
Whether explicit bit field alignment attributes are honored.
Definition TargetInfo.h:196
IntType
===-— Target Data Type Query Methods ----------------------------—===//
Definition TargetInfo.h:146
const llvm::fltSemantics * LongDoubleFormat
Definition TargetInfo.h:143
unsigned ZeroLengthBitfieldBoundary
If non-zero, specifies a fixed alignment value for bitfields that follow zero length bitfield,...
Definition TargetInfo.h:200
const llvm::fltSemantics * Float128Format
Definition TargetInfo.h:143
unsigned LargestOverSizedBitfieldContainer
The largest container size which should be used for an over-sized bitfield, in bits.
Definition TargetInfo.h:204
unsigned UseLeadingZeroLengthBitfield
Whether zero length bitfield alignment is respected if they are the leading members.
Definition TargetInfo.h:192
unsigned UseBitFieldTypeAlignment
Control whether the alignment of bit-field types is respected when laying out structures.
Definition TargetInfo.h:178
unsigned MaxAlignedAttribute
If non-zero, specifies a maximum alignment to truncate alignment specified in the aligned attribute o...
Definition TargetInfo.h:208
const llvm::fltSemantics * Ibm128Format
Definition TargetInfo.h:143
const llvm::fltSemantics * FloatFormat
Definition TargetInfo.h:142
const llvm::fltSemantics * HalfFormat
Definition TargetInfo.h:142
unsigned UseSignedCharForObjCBool
Whether Objective-C's built-in boolean type should be signed char.
Definition TargetInfo.h:170
unsigned char DefaultAlignForAttributeAligned
Definition TargetInfo.h:134