summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-01-27 04:07:36 +0000
committerAlp Toker <alp@nuanti.com>2014-01-27 04:07:36 +0000
commit810a9cffb4c926c73e9aed78a7cc117a1abeeebe (patch)
tree1713378e74df980daa4384da3ebd3d31de9ebe99 /include
parentbad91954cf7c2caae19728bed33729a390d88725 (diff)
downloadllvm-810a9cffb4c926c73e9aed78a7cc117a1abeeebe.tar.gz
llvm-810a9cffb4c926c73e9aed78a7cc117a1abeeebe.tar.bz2
llvm-810a9cffb4c926c73e9aed78a7cc117a1abeeebe.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200188 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/StringExtras.h5
-rw-r--r--include/llvm/ADT/StringRef.h5
2 files changed, 5 insertions, 5 deletions
diff --git a/include/llvm/ADT/StringExtras.h b/include/llvm/ADT/StringExtras.h
index dccf3e809d..a0b3fe7a06 100644
--- a/include/llvm/ADT/StringExtras.h
+++ b/include/llvm/ADT/StringExtras.h
@@ -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.
///
diff --git a/include/llvm/ADT/StringRef.h b/include/llvm/ADT/StringRef.h
index a35dfbfeba..4491dc3ae1 100644
--- a/include/llvm/ADT/StringRef.h
+++ b/include/llvm/ADT/StringRef.h
@@ -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