projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
36e6ae6
)
Add a bool->StringRef c'tor to StringRef.
author
Bill Wendling
<isanbard@gmail.com>
Thu, 25 Jul 2013 23:06:39 +0000
(23:06 +0000)
committer
Bill Wendling
<isanbard@gmail.com>
Thu, 25 Jul 2013 23:06:39 +0000
(23:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187166
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/StringRef.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/StringRef.h
b/include/llvm/ADT/StringRef.h
index d013d0562325287ba39baa189f321fd72ba9c21f..56848fb61672dc16027827b30983231881ea2d79 100644
(file)
--- 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
/// @{