clang 8.0.0

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