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