Move true/false StringRef helper to StringExtras

StringRef is a low-level data wrapper that shouldn't know about language
strings like 'true' and 'false' whereas StringExtras is just the place for
higher-level utilities.

llvm-svn: 200188
This commit is contained in:
Alp Toker 2014-01-27 04:07:36 +00:00
parent 042f41b047
commit 3bb1de7885
2 changed files with 5 additions and 5 deletions

View File

@ -28,6 +28,11 @@ static inline char hexdigit(unsigned X, bool LowerCase = false) {
return X < 10 ? '0' + X : HexChar + X - 10;
}
/// Construct a string ref from a boolean.
static inline StringRef toStringRef(bool B) {
return StringRef(B ? "true" : "false");
}
/// Interpret the given character \p C as a hexadecimal digit and return its
/// value.
///

View File

@ -561,11 +561,6 @@ namespace llvm {
// StringRefs can be treated like a POD type.
template <typename T> struct isPodLike;
template <> struct isPodLike<StringRef> { static const bool value = true; };
/// Construct a string ref from a boolean.
inline StringRef toStringRef(bool B) {
return StringRef(B ? "true" : "false");
}
}
#endif