Lines Matching refs:Str
130 size_t StringRef::find(StringRef Str, size_t From) const { in find() argument
137 const char *Needle = Str.data(); in find()
138 size_t N = Str.size(); in find()
176 BadCharSkip[(uint8_t)Str[i]] = N-1-i; in find()
191 size_t StringRef::find_insensitive(StringRef Str, size_t From) const { in find_insensitive() argument
193 while (This.size() >= Str.size()) { in find_insensitive()
194 if (This.starts_with_insensitive(Str)) in find_insensitive()
217 size_t StringRef::rfind(StringRef Str) const { in rfind()
218 return std::string_view(*this).rfind(Str); in rfind()
221 size_t StringRef::rfind_insensitive(StringRef Str) const { in rfind_insensitive()
222 size_t N = Str.size(); in rfind_insensitive()
227 if (substr(i, N).equals_insensitive(Str)) in rfind_insensitive()
371 size_t StringRef::count(StringRef Str) const { in count()
374 size_t N = Str.size(); in count()
380 while ((Pos = find(Str, Pos)) != npos) { in count()
387 static unsigned GetAutoSenseRadix(StringRef &Str) { in GetAutoSenseRadix() argument
388 if (Str.empty()) in GetAutoSenseRadix()
391 if (Str.consume_front_insensitive("0x")) in GetAutoSenseRadix()
394 if (Str.consume_front_insensitive("0b")) in GetAutoSenseRadix()
397 if (Str.consume_front("0o")) in GetAutoSenseRadix()
400 if (Str[0] == '0' && Str.size() > 1 && isDigit(Str[1])) { in GetAutoSenseRadix()
401 Str = Str.substr(1); in GetAutoSenseRadix()
408 bool llvm::consumeUnsignedInteger(StringRef &Str, unsigned Radix, in consumeUnsignedInteger() argument
412 Radix = GetAutoSenseRadix(Str); in consumeUnsignedInteger()
415 if (Str.empty()) return true; in consumeUnsignedInteger()
418 StringRef Str2 = Str; in consumeUnsignedInteger()
449 if (Str.size() == Str2.size()) in consumeUnsignedInteger()
452 Str = Str2; in consumeUnsignedInteger()
456 bool llvm::consumeSignedInteger(StringRef &Str, unsigned Radix, in consumeSignedInteger() argument
461 if (!Str.starts_with("-")) { in consumeSignedInteger()
462 if (consumeUnsignedInteger(Str, Radix, ULLVal) || in consumeSignedInteger()
471 StringRef Str2 = Str.drop_front(1); in consumeSignedInteger()
479 Str = Str2; in consumeSignedInteger()
486 bool llvm::getAsUnsignedInteger(StringRef Str, unsigned Radix, in getAsUnsignedInteger() argument
488 if (consumeUnsignedInteger(Str, Radix, Result)) in getAsUnsignedInteger()
493 return !Str.empty(); in getAsUnsignedInteger()
496 bool llvm::getAsSignedInteger(StringRef Str, unsigned Radix, in getAsSignedInteger() argument
498 if (consumeSignedInteger(Str, Radix, Result)) in getAsSignedInteger()
503 return !Str.empty(); in getAsSignedInteger()
507 StringRef Str = *this; in consumeInteger() local
511 Radix = GetAutoSenseRadix(Str); in consumeInteger()
516 if (Str.empty()) return true; in consumeInteger()
520 Str = Str.ltrim('0'); in consumeInteger()
523 if (Str.empty()) { in consumeInteger()
525 *this = Str; in consumeInteger()
534 unsigned BitWidth = Log2Radix * Str.size(); in consumeInteger()
549 while (!Str.empty()) { in consumeInteger()
551 if (Str[0] >= '0' && Str[0] <= '9') in consumeInteger()
552 CharVal = Str[0]-'0'; in consumeInteger()
553 else if (Str[0] >= 'a' && Str[0] <= 'z') in consumeInteger()
554 CharVal = Str[0]-'a'+10; in consumeInteger()
555 else if (Str[0] >= 'A' && Str[0] <= 'Z') in consumeInteger()
556 CharVal = Str[0]-'A'+10; in consumeInteger()
575 Str = Str.substr(1); in consumeInteger()
580 if (size() == Str.size()) in consumeInteger()
583 *this = Str; in consumeInteger()
588 StringRef Str = *this; in getAsInteger() local
589 if (Str.consumeInteger(Radix, Result)) in getAsInteger()
594 return !Str.empty(); in getAsInteger()