Lines Matching refs:Str

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