Skip to content

Commit 59523f3

Browse files
committed
[LLDB][NFC] Make getAutoSenseRadix in StringRef global
1 parent ef98e24 commit 59523f3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

llvm/include/llvm/ADT/StringRef.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ namespace llvm {
3838
LLVM_ABI bool getAsSignedInteger(StringRef Str, unsigned Radix,
3939
long long &Result);
4040

41+
LLVM_ABI unsigned getAutoSenseRadix(StringRef &Str);
42+
4143
LLVM_ABI bool consumeUnsignedInteger(StringRef &Str, unsigned Radix,
4244
unsigned long long &Result);
4345
LLVM_ABI bool consumeSignedInteger(StringRef &Str, unsigned Radix,

llvm/lib/Support/StringRef.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ size_t StringRef::count(StringRef Str) const {
385385
return Count;
386386
}
387387

388-
static unsigned GetAutoSenseRadix(StringRef &Str) {
388+
unsigned llvm::getAutoSenseRadix(StringRef &Str) {
389389
if (Str.empty())
390390
return 10;
391391

@@ -410,7 +410,7 @@ bool llvm::consumeUnsignedInteger(StringRef &Str, unsigned Radix,
410410
unsigned long long &Result) {
411411
// Autosense radix if not specified.
412412
if (Radix == 0)
413-
Radix = GetAutoSenseRadix(Str);
413+
Radix = getAutoSenseRadix(Str);
414414

415415
// Empty strings (after the radix autosense) are invalid.
416416
if (Str.empty()) return true;
@@ -509,7 +509,7 @@ bool StringRef::consumeInteger(unsigned Radix, APInt &Result) {
509509

510510
// Autosense radix if not specified.
511511
if (Radix == 0)
512-
Radix = GetAutoSenseRadix(Str);
512+
Radix = getAutoSenseRadix(Str);
513513

514514
assert(Radix > 1 && Radix <= 36);
515515

0 commit comments

Comments
 (0)