mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Use a non-c'tor for converting a boolean into a StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187250 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0c326f07ca
commit
e130dc6cc9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user