Lines Matching refs:Str
133 size_t StringRef::find(StringRef Str, size_t From) const { in find() argument
140 const char *Needle = Str.data(); in find()
141 size_t N = Str.size(); in find()
167 BadCharSkip[(uint8_t)Str[i]] = N-1-i; in find()
182 size_t StringRef::find_lower(StringRef Str, size_t From) const { in find_lower() argument
184 while (This.size() >= Str.size()) { in find_lower()
185 if (This.startswith_lower(Str)) in find_lower()
208 size_t StringRef::rfind(StringRef Str) const { in rfind()
209 size_t N = Str.size(); in rfind()
214 if (substr(i, N).equals(Str)) in rfind()
220 size_t StringRef::rfind_lower(StringRef Str) const { in rfind_lower()
221 size_t N = Str.size(); in rfind_lower()
226 if (substr(i, N).equals_lower(Str)) in rfind_lower()
373 size_t StringRef::count(StringRef Str) const { in count()
375 size_t N = Str.size(); in count()
379 if (substr(i, N).equals(Str)) in count()
384 static unsigned GetAutoSenseRadix(StringRef &Str) { in GetAutoSenseRadix() argument
385 if (Str.empty()) in GetAutoSenseRadix()
388 if (Str.startswith("0x") || Str.startswith("0X")) { in GetAutoSenseRadix()
389 Str = Str.substr(2); in GetAutoSenseRadix()
393 if (Str.startswith("0b") || Str.startswith("0B")) { in GetAutoSenseRadix()
394 Str = Str.substr(2); in GetAutoSenseRadix()
398 if (Str.startswith("0o")) { in GetAutoSenseRadix()
399 Str = Str.substr(2); in GetAutoSenseRadix()
403 if (Str[0] == '0' && Str.size() > 1 && isDigit(Str[1])) { in GetAutoSenseRadix()
404 Str = Str.substr(1); in GetAutoSenseRadix()
411 bool llvm::consumeUnsignedInteger(StringRef &Str, unsigned Radix, in consumeUnsignedInteger() argument
415 Radix = GetAutoSenseRadix(Str); in consumeUnsignedInteger()
418 if (Str.empty()) return true; in consumeUnsignedInteger()
421 StringRef Str2 = Str; in consumeUnsignedInteger()
452 if (Str.size() == Str2.size()) in consumeUnsignedInteger()
455 Str = Str2; in consumeUnsignedInteger()
459 bool llvm::consumeSignedInteger(StringRef &Str, unsigned Radix, in consumeSignedInteger() argument
464 if (Str.empty() || Str.front() != '-') { in consumeSignedInteger()
465 if (consumeUnsignedInteger(Str, Radix, ULLVal) || in consumeSignedInteger()
474 StringRef Str2 = Str.drop_front(1); in consumeSignedInteger()
482 Str = Str2; in consumeSignedInteger()
489 bool llvm::getAsUnsignedInteger(StringRef Str, unsigned Radix, in getAsUnsignedInteger() argument
491 if (consumeUnsignedInteger(Str, Radix, Result)) in getAsUnsignedInteger()
496 return !Str.empty(); in getAsUnsignedInteger()
499 bool llvm::getAsSignedInteger(StringRef Str, unsigned Radix, in getAsSignedInteger() argument
501 if (consumeSignedInteger(Str, Radix, Result)) in getAsSignedInteger()
506 return !Str.empty(); in getAsSignedInteger()
510 StringRef Str = *this; in getAsInteger() local
514 Radix = GetAutoSenseRadix(Str); in getAsInteger()
519 if (Str.empty()) return true; in getAsInteger()
523 while (!Str.empty() && Str.front() == '0') in getAsInteger()
524 Str = Str.substr(1); in getAsInteger()
527 if (Str.empty()) { in getAsInteger()
537 unsigned BitWidth = Log2Radix * Str.size(); in getAsInteger()
552 while (!Str.empty()) { in getAsInteger()
554 if (Str[0] >= '0' && Str[0] <= '9') in getAsInteger()
555 CharVal = Str[0]-'0'; in getAsInteger()
556 else if (Str[0] >= 'a' && Str[0] <= 'z') in getAsInteger()
557 CharVal = Str[0]-'a'+10; in getAsInteger()
558 else if (Str[0] >= 'A' && Str[0] <= 'Z') in getAsInteger()
559 CharVal = Str[0]-'A'+10; in getAsInteger()
578 Str = Str.substr(1); in getAsInteger()