blob: 7fcf372a368c427e6db278236b40a750f9640964 [file] [log] [blame]
Reid Spencer5f016e22007-07-11 17:01:13 +00001//===--- TargetInfo.cpp - Information about Target machine ----------------===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner0bc735f2007-12-29 19:59:25 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Reid Spencer5f016e22007-07-11 17:01:13 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file implements the TargetInfo and TargetInfoImpl interfaces.
11//
12//===----------------------------------------------------------------------===//
13
14#include "clang/Basic/TargetInfo.h"
John Thompsona6fda122009-11-05 20:14:16 +000015#include "clang/Basic/LangOptions.h"
Chris Lattner525a0502007-09-22 18:29:59 +000016#include "llvm/ADT/APFloat.h"
Anders Carlsson6fa90862007-11-25 00:25:21 +000017#include "llvm/ADT/STLExtras.h"
Chris Lattner5483bdf2008-04-06 04:02:29 +000018#include <cstdlib>
Reid Spencer5f016e22007-07-11 17:01:13 +000019using namespace clang;
20
Chris Lattnercd4fc422008-03-08 08:59:43 +000021// TargetInfo Constructor.
22TargetInfo::TargetInfo(const std::string &T) : Triple(T) {
Daniel Dunbarb6a16932010-04-15 06:18:39 +000023 // Set defaults. Defaults are set for a 32-bit RISC platform, like PPC or
24 // SPARC. These should be overridden by concrete targets as needed.
Eli Friedmanb030f022009-04-19 21:38:35 +000025 TLSSupported = true;
Chris Lattner9bffb072010-04-23 16:29:58 +000026 NoAsmVariants = false;
Chris Lattner927686f2008-05-09 06:08:39 +000027 PointerWidth = PointerAlign = 32;
Chris Lattner2621fd12008-05-08 05:58:21 +000028 IntWidth = IntAlign = 32;
Chris Lattnerec10f582008-05-09 05:50:02 +000029 LongWidth = LongAlign = 32;
30 LongLongWidth = LongLongAlign = 64;
Eli Friedman61538a72008-05-20 14:21:01 +000031 FloatWidth = 32;
32 FloatAlign = 32;
Nate Begeman3d292062008-04-18 17:17:24 +000033 DoubleWidth = 64;
Eli Friedman61538a72008-05-20 14:21:01 +000034 DoubleAlign = 64;
35 LongDoubleWidth = 64;
36 LongDoubleAlign = 64;
Rafael Espindola6deecb02010-06-04 23:15:27 +000037 LargeArrayMinWidth = 0;
38 LargeArrayAlign = 0;
Anders Carlsson6a3615c2008-10-31 16:05:19 +000039 SizeType = UnsignedLong;
Eli Friedmanf509d732008-11-02 02:43:55 +000040 PtrDiffType = SignedLong;
Sanjiv Gupta31fc07d2008-10-31 09:52:39 +000041 IntMaxType = SignedLongLong;
42 UIntMaxType = UnsignedLongLong;
Chris Lattner6ad474f2009-02-13 22:28:55 +000043 IntPtrType = SignedLong;
Eli Friedmanf509d732008-11-02 02:43:55 +000044 WCharType = SignedInt;
Chris Lattnere64ef802009-10-21 04:59:34 +000045 WIntType = SignedInt;
Alisdair Meredithf5c209d2009-07-14 06:30:34 +000046 Char16Type = UnsignedShort;
47 Char32Type = UnsignedInt;
Eli Friedman3c7b6e42009-07-01 03:36:11 +000048 Int64Type = SignedLongLong;
Edward O'Callaghan9cf910e2009-11-21 00:49:54 +000049 SigAtomicType = SignedInt;
Daniel Dunbarb6830d62010-04-15 15:06:18 +000050 UseBitFieldTypeAlignment = true;
Chris Lattnercd4fc422008-03-08 08:59:43 +000051 FloatFormat = &llvm::APFloat::IEEEsingle;
52 DoubleFormat = &llvm::APFloat::IEEEdouble;
53 LongDoubleFormat = &llvm::APFloat::IEEEdouble;
Eli Friedmaned855cb2008-08-21 00:13:15 +000054 DescriptionString = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-"
Chris Lattner1932e122009-11-07 18:59:41 +000055 "i64:64:64-f32:32:32-f64:64:64-n32";
Chris Lattner3fdf4672008-10-05 19:22:37 +000056 UserLabelPrefix = "_";
Daniel Dunbar613fd672010-05-27 00:35:16 +000057 HasAlignMac68kSupport = false;
Daniel Dunbardacf9dd2010-07-14 23:39:36 +000058
59 // Default to no types using fpret.
60 RealTypeUsesObjCFPRet = 0;
Chris Lattnercd4fc422008-03-08 08:59:43 +000061}
62
Chris Lattner0eaed122008-03-08 08:24:01 +000063// Out of line virtual dtor for TargetInfo.
64TargetInfo::~TargetInfo() {}
Reid Spencer5f016e22007-07-11 17:01:13 +000065
Chris Lattner2b5abf52009-02-06 05:04:11 +000066/// getTypeName - Return the user string for the specified integer type enum.
67/// For example, SignedShort -> "short".
68const char *TargetInfo::getTypeName(IntType T) {
69 switch (T) {
70 default: assert(0 && "not an integer!");
71 case SignedShort: return "short";
72 case UnsignedShort: return "unsigned short";
73 case SignedInt: return "int";
74 case UnsignedInt: return "unsigned int";
75 case SignedLong: return "long int";
76 case UnsignedLong: return "long unsigned int";
77 case SignedLongLong: return "long long int";
78 case UnsignedLongLong: return "long long unsigned int";
79 }
80}
81
Chris Lattnerb304f772009-10-21 06:24:21 +000082/// getTypeConstantSuffix - Return the constant suffix for the specified
83/// integer type enum. For example, SignedLong -> "L".
84const char *TargetInfo::getTypeConstantSuffix(IntType T) {
85 switch (T) {
86 default: assert(0 && "not an integer!");
87 case SignedShort:
88 case SignedInt: return "";
89 case SignedLong: return "L";
90 case SignedLongLong: return "LL";
91 case UnsignedShort:
92 case UnsignedInt: return "U";
93 case UnsignedLong: return "UL";
94 case UnsignedLongLong: return "ULL";
95 }
96}
97
98/// getTypeWidth - Return the width (in bits) of the specified integer type
99/// enum. For example, SignedInt -> getIntWidth().
100unsigned TargetInfo::getTypeWidth(IntType T) const {
101 switch (T) {
102 default: assert(0 && "not an integer!");
Chris Lattner9099e7b2009-11-05 21:21:32 +0000103 case SignedShort:
Chris Lattnerb304f772009-10-21 06:24:21 +0000104 case UnsignedShort: return getShortWidth();
Chris Lattner9099e7b2009-11-05 21:21:32 +0000105 case SignedInt:
Chris Lattnerb304f772009-10-21 06:24:21 +0000106 case UnsignedInt: return getIntWidth();
Chris Lattner9099e7b2009-11-05 21:21:32 +0000107 case SignedLong:
Chris Lattnerb304f772009-10-21 06:24:21 +0000108 case UnsignedLong: return getLongWidth();
Chris Lattner9099e7b2009-11-05 21:21:32 +0000109 case SignedLongLong:
Chris Lattnerb304f772009-10-21 06:24:21 +0000110 case UnsignedLongLong: return getLongLongWidth();
111 };
112}
113
Chris Lattner9099e7b2009-11-05 21:21:32 +0000114/// getTypeAlign - Return the alignment (in bits) of the specified integer type
115/// enum. For example, SignedInt -> getIntAlign().
116unsigned TargetInfo::getTypeAlign(IntType T) const {
117 switch (T) {
118 default: assert(0 && "not an integer!");
119 case SignedShort:
120 case UnsignedShort: return getShortAlign();
121 case SignedInt:
122 case UnsignedInt: return getIntAlign();
123 case SignedLong:
124 case UnsignedLong: return getLongAlign();
125 case SignedLongLong:
126 case UnsignedLongLong: return getLongLongAlign();
127 };
128}
129
Chris Lattner961f0702009-10-25 22:49:18 +0000130/// isTypeSigned - Return whether an integer types is signed. Returns true if
Chris Lattnerb304f772009-10-21 06:24:21 +0000131/// the type is signed; false otherwise.
Chris Lattner961f0702009-10-25 22:49:18 +0000132bool TargetInfo::isTypeSigned(IntType T) const {
Chris Lattnerb304f772009-10-21 06:24:21 +0000133 switch (T) {
134 default: assert(0 && "not an integer!");
135 case SignedShort:
136 case SignedInt:
137 case SignedLong:
138 case SignedLongLong:
139 return true;
140 case UnsignedShort:
141 case UnsignedInt:
142 case UnsignedLong:
143 case UnsignedLongLong:
144 return false;
145 };
146}
147
John Thompsona6fda122009-11-05 20:14:16 +0000148/// setForcedLangOptions - Set forced language options.
149/// Apply changes to the target information with respect to certain
150/// language options which change the target configuration.
151void TargetInfo::setForcedLangOptions(LangOptions &Opts) {
Daniel Dunbarfb937b82010-04-15 15:06:22 +0000152 if (Opts.NoBitFieldTypeAlign)
153 UseBitFieldTypeAlignment = false;
154 if (Opts.ShortWChar)
John Thompsona6fda122009-11-05 20:14:16 +0000155 WCharType = UnsignedShort;
John Thompsona6fda122009-11-05 20:14:16 +0000156}
Chris Lattnerb304f772009-10-21 06:24:21 +0000157
Chris Lattner525a0502007-09-22 18:29:59 +0000158//===----------------------------------------------------------------------===//
Chris Lattner525a0502007-09-22 18:29:59 +0000159
Reid Spencer5f016e22007-07-11 17:01:13 +0000160
Anders Carlsson83c021c2010-01-30 19:12:25 +0000161static llvm::StringRef removeGCCRegisterPrefix(llvm::StringRef Name) {
Anders Carlssonea041752008-02-06 00:11:32 +0000162 if (Name[0] == '%' || Name[0] == '#')
Anders Carlsson83c021c2010-01-30 19:12:25 +0000163 Name = Name.substr(1);
164
165 return Name;
Anders Carlssonea041752008-02-06 00:11:32 +0000166}
167
Anders Carlsson3346ae62007-11-24 23:38:12 +0000168/// isValidGCCRegisterName - Returns whether the passed in string
169/// is a valid register name according to GCC. This is used by Sema for
170/// inline asm statements.
Anders Carlsson83c021c2010-01-30 19:12:25 +0000171bool TargetInfo::isValidGCCRegisterName(llvm::StringRef Name) const {
172 if (Name.empty())
173 return false;
174
Anders Carlsson6fa90862007-11-25 00:25:21 +0000175 const char * const *Names;
176 unsigned NumNames;
Mike Stump1eb44332009-09-09 15:08:12 +0000177
Anders Carlsson6fa90862007-11-25 00:25:21 +0000178 // Get rid of any register prefix.
Anders Carlsson83c021c2010-01-30 19:12:25 +0000179 Name = removeGCCRegisterPrefix(Name);
Anders Carlssonea041752008-02-06 00:11:32 +0000180
Anders Carlsson83c021c2010-01-30 19:12:25 +0000181 if (Name == "memory" || Name == "cc")
Anders Carlsson6fa90862007-11-25 00:25:21 +0000182 return true;
Mike Stump1eb44332009-09-09 15:08:12 +0000183
Chris Lattner0eaed122008-03-08 08:24:01 +0000184 getGCCRegNames(Names, NumNames);
Mike Stump1eb44332009-09-09 15:08:12 +0000185
Anders Carlsson6fa90862007-11-25 00:25:21 +0000186 // If we have a number it maps to an entry in the register name array.
187 if (isdigit(Name[0])) {
Anders Carlsson83c021c2010-01-30 19:12:25 +0000188 int n;
189 if (!Name.getAsInteger(0, n))
Anders Carlsson6fa90862007-11-25 00:25:21 +0000190 return n >= 0 && (unsigned)n < NumNames;
191 }
192
193 // Check register names.
194 for (unsigned i = 0; i < NumNames; i++) {
Anders Carlsson83c021c2010-01-30 19:12:25 +0000195 if (Name == Names[i])
Anders Carlsson6fa90862007-11-25 00:25:21 +0000196 return true;
197 }
Mike Stump1eb44332009-09-09 15:08:12 +0000198
Anders Carlsson6fa90862007-11-25 00:25:21 +0000199 // Now check aliases.
Chris Lattner0eaed122008-03-08 08:24:01 +0000200 const GCCRegAlias *Aliases;
Anders Carlsson6fa90862007-11-25 00:25:21 +0000201 unsigned NumAliases;
Mike Stump1eb44332009-09-09 15:08:12 +0000202
Chris Lattner0eaed122008-03-08 08:24:01 +0000203 getGCCRegAliases(Aliases, NumAliases);
Anders Carlsson6fa90862007-11-25 00:25:21 +0000204 for (unsigned i = 0; i < NumAliases; i++) {
205 for (unsigned j = 0 ; j < llvm::array_lengthof(Aliases[i].Aliases); j++) {
206 if (!Aliases[i].Aliases[j])
207 break;
Anders Carlsson83c021c2010-01-30 19:12:25 +0000208 if (Aliases[i].Aliases[j] == Name)
Anders Carlsson6fa90862007-11-25 00:25:21 +0000209 return true;
210 }
211 }
Mike Stump1eb44332009-09-09 15:08:12 +0000212
Anders Carlsson3346ae62007-11-24 23:38:12 +0000213 return false;
214}
Anders Carlssond04c6e22007-11-27 04:11:28 +0000215
Anders Carlsson83c021c2010-01-30 19:12:25 +0000216llvm::StringRef
217TargetInfo::getNormalizedGCCRegisterName(llvm::StringRef Name) const {
Anders Carlssond04c6e22007-11-27 04:11:28 +0000218 assert(isValidGCCRegisterName(Name) && "Invalid register passed in");
Mike Stump1eb44332009-09-09 15:08:12 +0000219
Anders Carlsson83c021c2010-01-30 19:12:25 +0000220 // Get rid of any register prefix.
221 Name = removeGCCRegisterPrefix(Name);
Mike Stump1eb44332009-09-09 15:08:12 +0000222
Anders Carlssond04c6e22007-11-27 04:11:28 +0000223 const char * const *Names;
224 unsigned NumNames;
225
Chris Lattner0eaed122008-03-08 08:24:01 +0000226 getGCCRegNames(Names, NumNames);
Anders Carlssond04c6e22007-11-27 04:11:28 +0000227
228 // First, check if we have a number.
229 if (isdigit(Name[0])) {
Anders Carlsson83c021c2010-01-30 19:12:25 +0000230 int n;
231 if (!Name.getAsInteger(0, n)) {
Mike Stump1eb44332009-09-09 15:08:12 +0000232 assert(n >= 0 && (unsigned)n < NumNames &&
Anders Carlssond04c6e22007-11-27 04:11:28 +0000233 "Out of bounds register number!");
234 return Names[n];
235 }
236 }
Mike Stump1eb44332009-09-09 15:08:12 +0000237
Anders Carlssond04c6e22007-11-27 04:11:28 +0000238 // Now check aliases.
Chris Lattner0eaed122008-03-08 08:24:01 +0000239 const GCCRegAlias *Aliases;
Anders Carlssond04c6e22007-11-27 04:11:28 +0000240 unsigned NumAliases;
Mike Stump1eb44332009-09-09 15:08:12 +0000241
Chris Lattner0eaed122008-03-08 08:24:01 +0000242 getGCCRegAliases(Aliases, NumAliases);
Anders Carlssond04c6e22007-11-27 04:11:28 +0000243 for (unsigned i = 0; i < NumAliases; i++) {
244 for (unsigned j = 0 ; j < llvm::array_lengthof(Aliases[i].Aliases); j++) {
245 if (!Aliases[i].Aliases[j])
246 break;
Anders Carlsson83c021c2010-01-30 19:12:25 +0000247 if (Aliases[i].Aliases[j] == Name)
Anders Carlssond04c6e22007-11-27 04:11:28 +0000248 return Aliases[i].Register;
249 }
250 }
Mike Stump1eb44332009-09-09 15:08:12 +0000251
Anders Carlssond04c6e22007-11-27 04:11:28 +0000252 return Name;
253}
254
Chris Lattner432c8692009-04-26 17:19:08 +0000255bool TargetInfo::validateOutputConstraint(ConstraintInfo &Info) const {
256 const char *Name = Info.getConstraintStr().c_str();
Anders Carlssond04c6e22007-11-27 04:11:28 +0000257 // An output constraint must start with '=' or '+'
258 if (*Name != '=' && *Name != '+')
259 return false;
260
261 if (*Name == '+')
Chris Lattner44def072009-04-26 07:16:29 +0000262 Info.setIsReadWrite();
Anders Carlssond04c6e22007-11-27 04:11:28 +0000263
264 Name++;
265 while (*Name) {
266 switch (*Name) {
267 default:
Chris Lattner44def072009-04-26 07:16:29 +0000268 if (!validateAsmConstraint(Name, Info)) {
Ted Kremenek5ab201a2008-04-24 16:36:38 +0000269 // FIXME: We temporarily return false
Anders Carlssond04c6e22007-11-27 04:11:28 +0000270 // so we can add more constraints as we hit it.
271 // Eventually, an unknown constraint should just be treated as 'g'.
Ted Kremenek5ab201a2008-04-24 16:36:38 +0000272 return false;
Anders Carlssond04c6e22007-11-27 04:11:28 +0000273 }
274 case '&': // early clobber.
275 break;
Chris Lattner40539832009-10-13 04:32:07 +0000276 case '%': // commutative.
277 // FIXME: Check that there is a another register after this one.
278 break;
Anders Carlssond04c6e22007-11-27 04:11:28 +0000279 case 'r': // general register.
Chris Lattner44def072009-04-26 07:16:29 +0000280 Info.setAllowsRegister();
Anders Carlssond04c6e22007-11-27 04:11:28 +0000281 break;
282 case 'm': // memory operand.
Chris Lattner44def072009-04-26 07:16:29 +0000283 Info.setAllowsMemory();
Anders Carlssond04c6e22007-11-27 04:11:28 +0000284 break;
285 case 'g': // general register, memory operand or immediate integer.
Anders Carlsson775841f2009-01-18 02:12:04 +0000286 case 'X': // any operand.
Chris Lattner44def072009-04-26 07:16:29 +0000287 Info.setAllowsRegister();
288 Info.setAllowsMemory();
Anders Carlssond04c6e22007-11-27 04:11:28 +0000289 break;
John Thompsonbb0cf4a2010-07-09 22:49:34 +0000290 case ',': // FIXME: Until we handle multiple alternative constraints,
291 return true; // ignore everything after the first comma.
Anders Carlssond04c6e22007-11-27 04:11:28 +0000292 }
Mike Stump1eb44332009-09-09 15:08:12 +0000293
Anders Carlssond04c6e22007-11-27 04:11:28 +0000294 Name++;
295 }
Mike Stump1eb44332009-09-09 15:08:12 +0000296
Anders Carlssond04c6e22007-11-27 04:11:28 +0000297 return true;
298}
299
Anders Carlsson42e1ee02009-01-18 01:56:57 +0000300bool TargetInfo::resolveSymbolicName(const char *&Name,
Chris Lattner2819fa82009-04-26 17:57:12 +0000301 ConstraintInfo *OutputConstraints,
302 unsigned NumOutputs,
Chris Lattner44def072009-04-26 07:16:29 +0000303 unsigned &Index) const {
Anders Carlsson42e1ee02009-01-18 01:56:57 +0000304 assert(*Name == '[' && "Symbolic name did not start with '['");
Anders Carlsson42e1ee02009-01-18 01:56:57 +0000305 Name++;
306 const char *Start = Name;
307 while (*Name && *Name != ']')
308 Name++;
Mike Stump1eb44332009-09-09 15:08:12 +0000309
Anders Carlsson42e1ee02009-01-18 01:56:57 +0000310 if (!*Name) {
311 // Missing ']'
312 return false;
313 }
Mike Stump1eb44332009-09-09 15:08:12 +0000314
Anders Carlsson42e1ee02009-01-18 01:56:57 +0000315 std::string SymbolicName(Start, Name - Start);
Mike Stump1eb44332009-09-09 15:08:12 +0000316
Chris Lattner2819fa82009-04-26 17:57:12 +0000317 for (Index = 0; Index != NumOutputs; ++Index)
318 if (SymbolicName == OutputConstraints[Index].getName())
Anders Carlsson42e1ee02009-01-18 01:56:57 +0000319 return true;
Anders Carlsson42e1ee02009-01-18 01:56:57 +0000320
321 return false;
322}
323
Chris Lattner2819fa82009-04-26 17:57:12 +0000324bool TargetInfo::validateInputConstraint(ConstraintInfo *OutputConstraints,
325 unsigned NumOutputs,
Chris Lattner44def072009-04-26 07:16:29 +0000326 ConstraintInfo &Info) const {
Chris Lattner432c8692009-04-26 17:19:08 +0000327 const char *Name = Info.ConstraintStr.c_str();
328
Anders Carlssond04c6e22007-11-27 04:11:28 +0000329 while (*Name) {
330 switch (*Name) {
331 default:
332 // Check if we have a matching constraint
333 if (*Name >= '0' && *Name <= '9') {
334 unsigned i = *Name - '0';
Mike Stump1eb44332009-09-09 15:08:12 +0000335
Anders Carlssond04c6e22007-11-27 04:11:28 +0000336 // Check if matching constraint is out of bounds.
337 if (i >= NumOutputs)
338 return false;
Mike Stump1eb44332009-09-09 15:08:12 +0000339
340 // The constraint should have the same info as the respective
Anders Carlsson03eb5432009-01-27 20:38:24 +0000341 // output constraint.
Chris Lattnerd6887612009-04-26 18:05:25 +0000342 Info.setTiedOperand(i, OutputConstraints[i]);
Chris Lattner44def072009-04-26 07:16:29 +0000343 } else if (!validateAsmConstraint(Name, Info)) {
Daniel Dunbar302684c2008-08-25 09:46:27 +0000344 // FIXME: This error return is in place temporarily so we can
345 // add more constraints as we hit it. Eventually, an unknown
346 // constraint should just be treated as 'g'.
347 return false;
Anders Carlsson42e1ee02009-01-18 01:56:57 +0000348 }
349 break;
350 case '[': {
351 unsigned Index = 0;
Chris Lattner2819fa82009-04-26 17:57:12 +0000352 if (!resolveSymbolicName(Name, OutputConstraints, NumOutputs, Index))
Anders Carlsson42e1ee02009-01-18 01:56:57 +0000353 return false;
Mike Stump1eb44332009-09-09 15:08:12 +0000354
Anders Carlsson42e1ee02009-01-18 01:56:57 +0000355 break;
Mike Stump1eb44332009-09-09 15:08:12 +0000356 }
Anders Carlsson44fe49c2007-12-08 19:32:57 +0000357 case '%': // commutative
358 // FIXME: Fail if % is used with the last operand.
359 break;
Anders Carlssond04c6e22007-11-27 04:11:28 +0000360 case 'i': // immediate integer.
Anders Carlssonefdfa772008-03-09 06:02:02 +0000361 case 'n': // immediate integer with a known value.
Anders Carlssond04c6e22007-11-27 04:11:28 +0000362 break;
Chris Lattner1d138792009-05-06 04:33:31 +0000363 case 'I': // Various constant constraints with target-specific meanings.
364 case 'J':
365 case 'K':
366 case 'L':
367 case 'M':
368 case 'N':
369 case 'O':
370 case 'P':
371 break;
Anders Carlssond04c6e22007-11-27 04:11:28 +0000372 case 'r': // general register.
Chris Lattner44def072009-04-26 07:16:29 +0000373 Info.setAllowsRegister();
Anders Carlssond04c6e22007-11-27 04:11:28 +0000374 break;
375 case 'm': // memory operand.
Nuno Lopesaa8e3612009-12-16 14:28:21 +0000376 case 'o': // offsettable memory operand
377 case 'V': // non-offsettable memory operand
Chris Lattner44def072009-04-26 07:16:29 +0000378 Info.setAllowsMemory();
Anders Carlssond04c6e22007-11-27 04:11:28 +0000379 break;
380 case 'g': // general register, memory operand or immediate integer.
Anders Carlsson775841f2009-01-18 02:12:04 +0000381 case 'X': // any operand.
Chris Lattner44def072009-04-26 07:16:29 +0000382 Info.setAllowsRegister();
383 Info.setAllowsMemory();
Anders Carlssond04c6e22007-11-27 04:11:28 +0000384 break;
John Thompsonbb0cf4a2010-07-09 22:49:34 +0000385 case ',': // FIXME: Until we handle multiple alternative constraints,
386 return true; // ignore everything after the first comma.
Anders Carlssond04c6e22007-11-27 04:11:28 +0000387 }
Mike Stump1eb44332009-09-09 15:08:12 +0000388
Anders Carlssond04c6e22007-11-27 04:11:28 +0000389 Name++;
390 }
Mike Stump1eb44332009-09-09 15:08:12 +0000391
Anders Carlssond04c6e22007-11-27 04:11:28 +0000392 return true;
393}