From: Bill Wendling Date: Thu, 25 Jul 2013 23:06:39 +0000 (+0000) Subject: Add a bool->StringRef c'tor to StringRef. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=fb5b3eaacbc65603b436279300c32512176150fe;p=oota-llvm.git Add a bool->StringRef c'tor to StringRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187166 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/StringRef.h b/include/llvm/ADT/StringRef.h index d013d056232..56848fb6167 100644 --- a/include/llvm/ADT/StringRef.h +++ b/include/llvm/ADT/StringRef.h @@ -90,6 +90,10 @@ 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 /// @{