diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-07-26 21:50:30 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-07-26 21:50:30 +0000 |
commit | 61b1a3553f90dfebb7b90757282149cc58feea71 (patch) | |
tree | 1498a2e7691335c4b02a53a860640a12ccce9e56 /llvm/include | |
parent | e37c2e4d11a4bbd34a7908774a12e4666687d087 (diff) | |
download | bcm5719-llvm-61b1a3553f90dfebb7b90757282149cc58feea71.tar.gz bcm5719-llvm-61b1a3553f90dfebb7b90757282149cc58feea71.zip |
Use a non-c'tor for converting a boolean into a StringRef.
llvm-svn: 187250
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/ADT/StringRef.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/include/llvm/ADT/StringRef.h b/llvm/include/llvm/ADT/StringRef.h index 56848fb6167..6215d3f6eae 100644 --- a/llvm/include/llvm/ADT/StringRef.h +++ b/llvm/include/llvm/ADT/StringRef.h @@ -90,10 +90,6 @@ namespace llvm { /*implicit*/ StringRef(const std::string &Str) : Data(Str.data()), Length(Str.length()) {} - /// Construct a string ref from a boolean. - explicit StringRef(bool B) - : Data(B ? "true" : "false"), Length(::strlen(Data)) {} - /// @} /// @name Iterators /// @{ @@ -552,6 +548,10 @@ namespace llvm { 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 |