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/AST/Type.h"
16 #include "clang/Basic/AddressSpaces.h"
17 #include "clang/Basic/CharInfo.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   NoAsmVariants = false;
35   HasFloat128 = false;
36   PointerWidth = PointerAlign = 32;
37   BoolWidth = BoolAlign = 8;
38   IntWidth = IntAlign = 32;
39   LongWidth = LongAlign = 32;
40   LongLongWidth = LongLongAlign = 64;
41   SuitableAlign = 64;
42   DefaultAlignForAttributeAligned = 128;
43   MinGlobalAlign = 0;
44   // From the glibc documentation, on GNU systems, malloc guarantees 16-byte
45   // alignment on 64-bit systems and 8-byte alignment on 32-bit systems. See
46   // https://www.gnu.org/software/libc/manual/html_node/Malloc-Examples.html
47   if (T.isGNUEnvironment())
48     NewAlign = Triple.isArch64Bit() ? 128 : Triple.isArch32Bit() ? 64 : 0;
49   else
50     NewAlign = 0; // Infer from basic type alignment.
51   HalfWidth = 16;
52   HalfAlign = 16;
53   FloatWidth = 32;
54   FloatAlign = 32;
55   DoubleWidth = 64;
56   DoubleAlign = 64;
57   LongDoubleWidth = 64;
58   LongDoubleAlign = 64;
59   Float128Align = 128;
60   LargeArrayMinWidth = 0;
61   LargeArrayAlign = 0;
62   MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 0;
63   MaxVectorAlign = 0;
64   MaxTLSAlign = 0;
65   SimdDefaultAlign = 0;
66   SizeType = UnsignedLong;
67   PtrDiffType = SignedLong;
68   IntMaxType = SignedLongLong;
69   IntPtrType = SignedLong;
70   WCharType = SignedInt;
71   WIntType = SignedInt;
72   Char16Type = UnsignedShort;
73   Char32Type = UnsignedInt;
74   Int64Type = SignedLongLong;
75   SigAtomicType = SignedInt;
76   ProcessIDType = SignedInt;
77   UseSignedCharForObjCBool = true;
78   UseBitFieldTypeAlignment = true;
79   UseZeroLengthBitfieldAlignment = false;
80   UseExplicitBitFieldAlignment = true;
81   ZeroLengthBitfieldBoundary = 0;
82   HalfFormat = &llvm::APFloat::IEEEhalf();
83   FloatFormat = &llvm::APFloat::IEEEsingle();
84   DoubleFormat = &llvm::APFloat::IEEEdouble();
85   LongDoubleFormat = &llvm::APFloat::IEEEdouble();
86   Float128Format = &llvm::APFloat::IEEEquad();
87   MCountName = "mcount";
88   RegParmMax = 0;
89   SSERegParmMax = 0;
90   HasAlignMac68kSupport = false;
91   HasBuiltinMSVaList = false;
92   IsRenderScriptTarget = false;
93 
94   // Default to no types using fpret.
95   RealTypeUsesObjCFPRet = 0;
96 
97   // Default to not using fp2ret for __Complex long double
98   ComplexLongDoubleUsesFP2Ret = false;
99 
100   // Set the C++ ABI based on the triple.
101   TheCXXABI.set(Triple.isKnownWindowsMSVCEnvironment()
102                     ? TargetCXXABI::Microsoft
103                     : TargetCXXABI::GenericItanium);
104 
105   // Default to an empty address space map.
106   AddrSpaceMap = &DefaultAddrSpaceMap;
107   UseAddrSpaceMapMangling = false;
108 
109   // Default to an unknown platform name.
110   PlatformName = "unknown";
111   PlatformMinVersion = VersionTuple();
112 }
113 
114 // Out of line virtual dtor for TargetInfo.
115 TargetInfo::~TargetInfo() {}
116 
117 /// getTypeName - Return the user string for the specified integer type enum.
118 /// For example, SignedShort -> "short".
119 const char *TargetInfo::getTypeName(IntType T) {
120   switch (T) {
121   default: llvm_unreachable("not an integer!");
122   case SignedChar:       return "signed char";
123   case UnsignedChar:     return "unsigned char";
124   case SignedShort:      return "short";
125   case UnsignedShort:    return "unsigned short";
126   case SignedInt:        return "int";
127   case UnsignedInt:      return "unsigned int";
128   case SignedLong:       return "long int";
129   case UnsignedLong:     return "long unsigned int";
130   case SignedLongLong:   return "long long int";
131   case UnsignedLongLong: return "long long unsigned int";
132   }
133 }
134 
135 /// getTypeConstantSuffix - Return the constant suffix for the specified
136 /// integer type enum. For example, SignedLong -> "L".
137 const char *TargetInfo::getTypeConstantSuffix(IntType T) const {
138   switch (T) {
139   default: llvm_unreachable("not an integer!");
140   case SignedChar:
141   case SignedShort:
142   case SignedInt:        return "";
143   case SignedLong:       return "L";
144   case SignedLongLong:   return "LL";
145   case UnsignedChar:
146     if (getCharWidth() < getIntWidth())
147       return "";
148     LLVM_FALLTHROUGH;
149   case UnsignedShort:
150     if (getShortWidth() < getIntWidth())
151       return "";
152     LLVM_FALLTHROUGH;
153   case UnsignedInt:      return "U";
154   case UnsignedLong:     return "UL";
155   case UnsignedLongLong: return "ULL";
156   }
157 }
158 
159 /// getTypeFormatModifier - Return the printf format modifier for the
160 /// specified integer type enum. For example, SignedLong -> "l".
161 
162 const char *TargetInfo::getTypeFormatModifier(IntType T) {
163   switch (T) {
164   default: llvm_unreachable("not an integer!");
165   case SignedChar:
166   case UnsignedChar:     return "hh";
167   case SignedShort:
168   case UnsignedShort:    return "h";
169   case SignedInt:
170   case UnsignedInt:      return "";
171   case SignedLong:
172   case UnsignedLong:     return "l";
173   case SignedLongLong:
174   case UnsignedLongLong: return "ll";
175   }
176 }
177 
178 /// getTypeWidth - Return the width (in bits) of the specified integer type
179 /// enum. For example, SignedInt -> getIntWidth().
180 unsigned TargetInfo::getTypeWidth(IntType T) const {
181   switch (T) {
182   default: llvm_unreachable("not an integer!");
183   case SignedChar:
184   case UnsignedChar:     return getCharWidth();
185   case SignedShort:
186   case UnsignedShort:    return getShortWidth();
187   case SignedInt:
188   case UnsignedInt:      return getIntWidth();
189   case SignedLong:
190   case UnsignedLong:     return getLongWidth();
191   case SignedLongLong:
192   case UnsignedLongLong: return getLongLongWidth();
193   };
194 }
195 
196 TargetInfo::IntType TargetInfo::getIntTypeByWidth(
197     unsigned BitWidth, bool IsSigned) const {
198   if (getCharWidth() == BitWidth)
199     return IsSigned ? SignedChar : UnsignedChar;
200   if (getShortWidth() == BitWidth)
201     return IsSigned ? SignedShort : UnsignedShort;
202   if (getIntWidth() == BitWidth)
203     return IsSigned ? SignedInt : UnsignedInt;
204   if (getLongWidth() == BitWidth)
205     return IsSigned ? SignedLong : UnsignedLong;
206   if (getLongLongWidth() == BitWidth)
207     return IsSigned ? SignedLongLong : UnsignedLongLong;
208   return NoInt;
209 }
210 
211 TargetInfo::IntType TargetInfo::getLeastIntTypeByWidth(unsigned BitWidth,
212                                                        bool IsSigned) const {
213   if (getCharWidth() >= BitWidth)
214     return IsSigned ? SignedChar : UnsignedChar;
215   if (getShortWidth() >= BitWidth)
216     return IsSigned ? SignedShort : UnsignedShort;
217   if (getIntWidth() >= BitWidth)
218     return IsSigned ? SignedInt : UnsignedInt;
219   if (getLongWidth() >= BitWidth)
220     return IsSigned ? SignedLong : UnsignedLong;
221   if (getLongLongWidth() >= BitWidth)
222     return IsSigned ? SignedLongLong : UnsignedLongLong;
223   return NoInt;
224 }
225 
226 TargetInfo::RealType TargetInfo::getRealTypeByWidth(unsigned BitWidth) const {
227   if (getFloatWidth() == BitWidth)
228     return Float;
229   if (getDoubleWidth() == BitWidth)
230     return Double;
231 
232   switch (BitWidth) {
233   case 96:
234     if (&getLongDoubleFormat() == &llvm::APFloat::x87DoubleExtended())
235       return LongDouble;
236     break;
237   case 128:
238     if (&getLongDoubleFormat() == &llvm::APFloat::PPCDoubleDouble() ||
239         &getLongDoubleFormat() == &llvm::APFloat::IEEEquad())
240       return LongDouble;
241     if (hasFloat128Type())
242       return Float128;
243     break;
244   }
245 
246   return NoFloat;
247 }
248 
249 /// getTypeAlign - Return the alignment (in bits) of the specified integer type
250 /// enum. For example, SignedInt -> getIntAlign().
251 unsigned TargetInfo::getTypeAlign(IntType T) const {
252   switch (T) {
253   default: llvm_unreachable("not an integer!");
254   case SignedChar:
255   case UnsignedChar:     return getCharAlign();
256   case SignedShort:
257   case UnsignedShort:    return getShortAlign();
258   case SignedInt:
259   case UnsignedInt:      return getIntAlign();
260   case SignedLong:
261   case UnsignedLong:     return getLongAlign();
262   case SignedLongLong:
263   case UnsignedLongLong: return getLongLongAlign();
264   };
265 }
266 
267 /// isTypeSigned - Return whether an integer types is signed. Returns true if
268 /// the type is signed; false otherwise.
269 bool TargetInfo::isTypeSigned(IntType T) {
270   switch (T) {
271   default: llvm_unreachable("not an integer!");
272   case SignedChar:
273   case SignedShort:
274   case SignedInt:
275   case SignedLong:
276   case SignedLongLong:
277     return true;
278   case UnsignedChar:
279   case UnsignedShort:
280   case UnsignedInt:
281   case UnsignedLong:
282   case UnsignedLongLong:
283     return false;
284   };
285 }
286 
287 /// adjust - Set forced language options.
288 /// Apply changes to the target information with respect to certain
289 /// language options which change the target configuration and adjust
290 /// the language based on the target options where applicable.
291 void TargetInfo::adjust(LangOptions &Opts) {
292   if (Opts.NoBitFieldTypeAlign)
293     UseBitFieldTypeAlignment = false;
294 
295   switch (Opts.WCharSize) {
296   default: llvm_unreachable("invalid wchar_t width");
297   case 0: break;
298   case 1: WCharType = Opts.WCharIsSigned ? SignedChar : UnsignedChar; break;
299   case 2: WCharType = Opts.WCharIsSigned ? SignedShort : UnsignedShort; break;
300   case 4: WCharType = Opts.WCharIsSigned ? SignedInt : UnsignedInt; break;
301   }
302 
303   if (Opts.AlignDouble) {
304     DoubleAlign = LongLongAlign = 64;
305     LongDoubleAlign = 64;
306   }
307 
308   if (Opts.OpenCL) {
309     // OpenCL C requires specific widths for types, irrespective of
310     // what these normally are for the target.
311     // We also define long long and long double here, although the
312     // OpenCL standard only mentions these as "reserved".
313     IntWidth = IntAlign = 32;
314     LongWidth = LongAlign = 64;
315     LongLongWidth = LongLongAlign = 128;
316     HalfWidth = HalfAlign = 16;
317     FloatWidth = FloatAlign = 32;
318 
319     // Embedded 32-bit targets (OpenCL EP) might have double C type
320     // defined as float. Let's not override this as it might lead
321     // to generating illegal code that uses 64bit doubles.
322     if (DoubleWidth != FloatWidth) {
323       DoubleWidth = DoubleAlign = 64;
324       DoubleFormat = &llvm::APFloat::IEEEdouble();
325     }
326     LongDoubleWidth = LongDoubleAlign = 128;
327 
328     unsigned MaxPointerWidth = getMaxPointerWidth();
329     assert(MaxPointerWidth == 32 || MaxPointerWidth == 64);
330     bool Is32BitArch = MaxPointerWidth == 32;
331     SizeType = Is32BitArch ? UnsignedInt : UnsignedLong;
332     PtrDiffType = Is32BitArch ? SignedInt : SignedLong;
333     IntPtrType = Is32BitArch ? SignedInt : SignedLong;
334 
335     IntMaxType = SignedLongLong;
336     Int64Type = SignedLong;
337 
338     HalfFormat = &llvm::APFloat::IEEEhalf();
339     FloatFormat = &llvm::APFloat::IEEEsingle();
340     LongDoubleFormat = &llvm::APFloat::IEEEquad();
341   }
342 
343   if (Opts.NewAlignOverride)
344     NewAlign = Opts.NewAlignOverride * getCharWidth();
345 }
346 
347 bool TargetInfo::initFeatureMap(
348     llvm::StringMap<bool> &Features, DiagnosticsEngine &Diags, StringRef CPU,
349     const std::vector<std::string> &FeatureVec) const {
350   for (const auto &F : FeatureVec) {
351     StringRef Name = F;
352     // Apply the feature via the target.
353     bool Enabled = Name[0] == '+';
354     setFeatureEnabled(Features, Name.substr(1), Enabled);
355   }
356   return true;
357 }
358 
359 LangAS TargetInfo::getOpenCLTypeAddrSpace(const Type *T) const {
360   auto BT = dyn_cast<BuiltinType>(T);
361 
362   if (!BT) {
363     if (isa<PipeType>(T))
364       return LangAS::opencl_global;
365 
366     return LangAS::Default;
367   }
368 
369   switch (BT->getKind()) {
370 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix)                   \
371   case BuiltinType::Id:                                                        \
372     return LangAS::opencl_global;
373 #include "clang/Basic/OpenCLImageTypes.def"
374 
375   case BuiltinType::OCLSampler:
376     return LangAS::opencl_constant;
377 
378   default:
379     return LangAS::Default;
380   }
381 }
382 
383 //===----------------------------------------------------------------------===//
384 
385 
386 static StringRef removeGCCRegisterPrefix(StringRef Name) {
387   if (Name[0] == '%' || Name[0] == '#')
388     Name = Name.substr(1);
389 
390   return Name;
391 }
392 
393 /// isValidClobber - Returns whether the passed in string is
394 /// a valid clobber in an inline asm statement. This is used by
395 /// Sema.
396 bool TargetInfo::isValidClobber(StringRef Name) const {
397   return (isValidGCCRegisterName(Name) ||
398           Name == "memory" || Name == "cc");
399 }
400 
401 /// isValidGCCRegisterName - Returns whether the passed in string
402 /// is a valid register name according to GCC. This is used by Sema for
403 /// inline asm statements.
404 bool TargetInfo::isValidGCCRegisterName(StringRef Name) const {
405   if (Name.empty())
406     return false;
407 
408   // Get rid of any register prefix.
409   Name = removeGCCRegisterPrefix(Name);
410   if (Name.empty())
411     return false;
412 
413   ArrayRef<const char *> Names = getGCCRegNames();
414 
415   // If we have a number it maps to an entry in the register name array.
416   if (isDigit(Name[0])) {
417     unsigned n;
418     if (!Name.getAsInteger(0, n))
419       return n < Names.size();
420   }
421 
422   // Check register names.
423   if (std::find(Names.begin(), Names.end(), Name) != Names.end())
424     return true;
425 
426   // Check any additional names that we have.
427   for (const AddlRegName &ARN : getGCCAddlRegNames())
428     for (const char *AN : ARN.Names) {
429       if (!AN)
430         break;
431       // Make sure the register that the additional name is for is within
432       // the bounds of the register names from above.
433       if (AN == Name && ARN.RegNum < Names.size())
434         return true;
435     }
436 
437   // Now check aliases.
438   for (const GCCRegAlias &GRA : getGCCRegAliases())
439     for (const char *A : GRA.Aliases) {
440       if (!A)
441         break;
442       if (A == Name)
443         return true;
444     }
445 
446   return false;
447 }
448 
449 StringRef TargetInfo::getNormalizedGCCRegisterName(StringRef Name,
450                                                    bool ReturnCanonical) const {
451   assert(isValidGCCRegisterName(Name) && "Invalid register passed in");
452 
453   // Get rid of any register prefix.
454   Name = removeGCCRegisterPrefix(Name);
455 
456   ArrayRef<const char *> Names = getGCCRegNames();
457 
458   // First, check if we have a number.
459   if (isDigit(Name[0])) {
460     unsigned n;
461     if (!Name.getAsInteger(0, n)) {
462       assert(n < Names.size() && "Out of bounds register number!");
463       return Names[n];
464     }
465   }
466 
467   // Check any additional names that we have.
468   for (const AddlRegName &ARN : getGCCAddlRegNames())
469     for (const char *AN : ARN.Names) {
470       if (!AN)
471         break;
472       // Make sure the register that the additional name is for is within
473       // the bounds of the register names from above.
474       if (AN == Name && ARN.RegNum < Names.size())
475         return ReturnCanonical ? Names[ARN.RegNum] : Name;
476     }
477 
478   // Now check aliases.
479   for (const GCCRegAlias &RA : getGCCRegAliases())
480     for (const char *A : RA.Aliases) {
481       if (!A)
482         break;
483       if (A == Name)
484         return RA.Register;
485     }
486 
487   return Name;
488 }
489 
490 bool TargetInfo::validateOutputConstraint(ConstraintInfo &Info) const {
491   const char *Name = Info.getConstraintStr().c_str();
492   // An output constraint must start with '=' or '+'
493   if (*Name != '=' && *Name != '+')
494     return false;
495 
496   if (*Name == '+')
497     Info.setIsReadWrite();
498 
499   Name++;
500   while (*Name) {
501     switch (*Name) {
502     default:
503       if (!validateAsmConstraint(Name, Info)) {
504         // FIXME: We temporarily return false
505         // so we can add more constraints as we hit it.
506         // Eventually, an unknown constraint should just be treated as 'g'.
507         return false;
508       }
509       break;
510     case '&': // early clobber.
511       Info.setEarlyClobber();
512       break;
513     case '%': // commutative.
514       // FIXME: Check that there is a another register after this one.
515       break;
516     case 'r': // general register.
517       Info.setAllowsRegister();
518       break;
519     case 'm': // memory operand.
520     case 'o': // offsetable memory operand.
521     case 'V': // non-offsetable memory operand.
522     case '<': // autodecrement memory operand.
523     case '>': // autoincrement memory operand.
524       Info.setAllowsMemory();
525       break;
526     case 'g': // general register, memory operand or immediate integer.
527     case 'X': // any operand.
528       Info.setAllowsRegister();
529       Info.setAllowsMemory();
530       break;
531     case ',': // multiple alternative constraint.  Pass it.
532       // Handle additional optional '=' or '+' modifiers.
533       if (Name[1] == '=' || Name[1] == '+')
534         Name++;
535       break;
536     case '#': // Ignore as constraint.
537       while (Name[1] && Name[1] != ',')
538         Name++;
539       break;
540     case '?': // Disparage slightly code.
541     case '!': // Disparage severely.
542     case '*': // Ignore for choosing register preferences.
543     case 'i': // Ignore i,n,E,F as output constraints (match from the other
544               // chars)
545     case 'n':
546     case 'E':
547     case 'F':
548       break;  // Pass them.
549     }
550 
551     Name++;
552   }
553 
554   // Early clobber with a read-write constraint which doesn't permit registers
555   // is invalid.
556   if (Info.earlyClobber() && Info.isReadWrite() && !Info.allowsRegister())
557     return false;
558 
559   // If a constraint allows neither memory nor register operands it contains
560   // only modifiers. Reject it.
561   return Info.allowsMemory() || Info.allowsRegister();
562 }
563 
564 bool TargetInfo::resolveSymbolicName(const char *&Name,
565                                      ArrayRef<ConstraintInfo> OutputConstraints,
566                                      unsigned &Index) const {
567   assert(*Name == '[' && "Symbolic name did not start with '['");
568   Name++;
569   const char *Start = Name;
570   while (*Name && *Name != ']')
571     Name++;
572 
573   if (!*Name) {
574     // Missing ']'
575     return false;
576   }
577 
578   std::string SymbolicName(Start, Name - Start);
579 
580   for (Index = 0; Index != OutputConstraints.size(); ++Index)
581     if (SymbolicName == OutputConstraints[Index].getName())
582       return true;
583 
584   return false;
585 }
586 
587 bool TargetInfo::validateInputConstraint(
588                               MutableArrayRef<ConstraintInfo> OutputConstraints,
589                               ConstraintInfo &Info) const {
590   const char *Name = Info.ConstraintStr.c_str();
591 
592   if (!*Name)
593     return false;
594 
595   while (*Name) {
596     switch (*Name) {
597     default:
598       // Check if we have a matching constraint
599       if (*Name >= '0' && *Name <= '9') {
600         const char *DigitStart = Name;
601         while (Name[1] >= '0' && Name[1] <= '9')
602           Name++;
603         const char *DigitEnd = Name;
604         unsigned i;
605         if (StringRef(DigitStart, DigitEnd - DigitStart + 1)
606                 .getAsInteger(10, i))
607           return false;
608 
609         // Check if matching constraint is out of bounds.
610         if (i >= OutputConstraints.size()) return false;
611 
612         // A number must refer to an output only operand.
613         if (OutputConstraints[i].isReadWrite())
614           return false;
615 
616         // If the constraint is already tied, it must be tied to the
617         // same operand referenced to by the number.
618         if (Info.hasTiedOperand() && Info.getTiedOperand() != i)
619           return false;
620 
621         // The constraint should have the same info as the respective
622         // output constraint.
623         Info.setTiedOperand(i, OutputConstraints[i]);
624       } else if (!validateAsmConstraint(Name, Info)) {
625         // FIXME: This error return is in place temporarily so we can
626         // add more constraints as we hit it.  Eventually, an unknown
627         // constraint should just be treated as 'g'.
628         return false;
629       }
630       break;
631     case '[': {
632       unsigned Index = 0;
633       if (!resolveSymbolicName(Name, OutputConstraints, Index))
634         return false;
635 
636       // If the constraint is already tied, it must be tied to the
637       // same operand referenced to by the number.
638       if (Info.hasTiedOperand() && Info.getTiedOperand() != Index)
639         return false;
640 
641       // A number must refer to an output only operand.
642       if (OutputConstraints[Index].isReadWrite())
643         return false;
644 
645       Info.setTiedOperand(Index, OutputConstraints[Index]);
646       break;
647     }
648     case '%': // commutative
649       // FIXME: Fail if % is used with the last operand.
650       break;
651     case 'i': // immediate integer.
652     case 'n': // immediate integer with a known value.
653       break;
654     case 'I':  // Various constant constraints with target-specific meanings.
655     case 'J':
656     case 'K':
657     case 'L':
658     case 'M':
659     case 'N':
660     case 'O':
661     case 'P':
662       if (!validateAsmConstraint(Name, Info))
663         return false;
664       break;
665     case 'r': // general register.
666       Info.setAllowsRegister();
667       break;
668     case 'm': // memory operand.
669     case 'o': // offsettable memory operand.
670     case 'V': // non-offsettable memory operand.
671     case '<': // autodecrement memory operand.
672     case '>': // autoincrement memory operand.
673       Info.setAllowsMemory();
674       break;
675     case 'g': // general register, memory operand or immediate integer.
676     case 'X': // any operand.
677       Info.setAllowsRegister();
678       Info.setAllowsMemory();
679       break;
680     case 'E': // immediate floating point.
681     case 'F': // immediate floating point.
682     case 'p': // address operand.
683       break;
684     case ',': // multiple alternative constraint.  Ignore comma.
685       break;
686     case '#': // Ignore as constraint.
687       while (Name[1] && Name[1] != ',')
688         Name++;
689       break;
690     case '?': // Disparage slightly code.
691     case '!': // Disparage severely.
692     case '*': // Ignore for choosing register preferences.
693       break;  // Pass them.
694     }
695 
696     Name++;
697   }
698 
699   return true;
700 }
701