From 810a9cffb4c926c73e9aed78a7cc117a1abeeebe Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Mon, 27 Jan 2014 04:07:36 +0000 Subject: [PATCH] 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 --- include/llvm/ADT/StringExtras.h | 5 +++++ include/llvm/ADT/StringRef.h | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/llvm/ADT/StringExtras.h b/include/llvm/ADT/StringExtras.h index dccf3e809d4..a0b3fe7a06c 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 a35dfbfebac..4491dc3ae16 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 struct isPodLike; template <> struct isPodLike { static const bool value = true; }; - - /// Construct a string ref from a boolean. - inline StringRef toStringRef(bool B) { - return StringRef(B ? "true" : "false"); - } } #endif