Lines Matching refs:Str
142 size_t StringRef::find(StringRef Str, size_t From) const { in find() argument
143 size_t N = Str.size(); in find()
150 if (substr(i, N).equals(Str)) in find()
162 BadCharSkip[(uint8_t)Str[i]] = N-1-i; in find()
166 if (substr(Pos, N).equals(Str)) // See if this is the correct substring. in find()
182 size_t StringRef::rfind(StringRef Str) const { in rfind()
183 size_t N = Str.size(); in rfind()
188 if (substr(i, N).equals(Str)) in rfind()
303 size_t StringRef::count(StringRef Str) const { in count()
305 size_t N = Str.size(); in count()
309 if (substr(i, N).equals(Str)) in count()
314 static unsigned GetAutoSenseRadix(StringRef &Str) { in GetAutoSenseRadix() argument
315 if (Str.startswith("0x")) { in GetAutoSenseRadix()
316 Str = Str.substr(2); in GetAutoSenseRadix()
320 if (Str.startswith("0b")) { in GetAutoSenseRadix()
321 Str = Str.substr(2); in GetAutoSenseRadix()
325 if (Str.startswith("0o")) { in GetAutoSenseRadix()
326 Str = Str.substr(2); in GetAutoSenseRadix()
330 if (Str.startswith("0")) in GetAutoSenseRadix()
339 bool llvm::getAsUnsignedInteger(StringRef Str, unsigned Radix, in getAsUnsignedInteger() argument
343 Radix = GetAutoSenseRadix(Str); in getAsUnsignedInteger()
346 if (Str.empty()) return true; in getAsUnsignedInteger()
350 while (!Str.empty()) { in getAsUnsignedInteger()
352 if (Str[0] >= '0' && Str[0] <= '9') in getAsUnsignedInteger()
353 CharVal = Str[0]-'0'; in getAsUnsignedInteger()
354 else if (Str[0] >= 'a' && Str[0] <= 'z') in getAsUnsignedInteger()
355 CharVal = Str[0]-'a'+10; in getAsUnsignedInteger()
356 else if (Str[0] >= 'A' && Str[0] <= 'Z') in getAsUnsignedInteger()
357 CharVal = Str[0]-'A'+10; in getAsUnsignedInteger()
374 Str = Str.substr(1); in getAsUnsignedInteger()
380 bool llvm::getAsSignedInteger(StringRef Str, unsigned Radix, in getAsSignedInteger() argument
385 if (Str.empty() || Str.front() != '-') { in getAsSignedInteger()
386 if (getAsUnsignedInteger(Str, Radix, ULLVal) || in getAsSignedInteger()
395 if (getAsUnsignedInteger(Str.substr(1), Radix, ULLVal) || in getAsSignedInteger()
407 StringRef Str = *this; in getAsInteger() local
411 Radix = GetAutoSenseRadix(Str); in getAsInteger()
416 if (Str.empty()) return true; in getAsInteger()
420 while (!Str.empty() && Str.front() == '0') in getAsInteger()
421 Str = Str.substr(1); in getAsInteger()
424 if (Str.empty()) { in getAsInteger()
434 unsigned BitWidth = Log2Radix * Str.size(); in getAsInteger()
449 while (!Str.empty()) { in getAsInteger()
451 if (Str[0] >= '0' && Str[0] <= '9') in getAsInteger()
452 CharVal = Str[0]-'0'; in getAsInteger()
453 else if (Str[0] >= 'a' && Str[0] <= 'z') in getAsInteger()
454 CharVal = Str[0]-'a'+10; in getAsInteger()
455 else if (Str[0] >= 'A' && Str[0] <= 'Z') in getAsInteger()
456 CharVal = Str[0]-'A'+10; in getAsInteger()
475 Str = Str.substr(1); in getAsInteger()