forked from OSchip/llvm-project
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:
parent
042f41b047
commit
3bb1de7885
|
@ -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.
|
||||
///
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue