From 3bb1de7885fd065668d3eeecd73c91157286fcd6 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. llvm-svn: 200188 --- llvm/include/llvm/ADT/StringExtras.h | 5 +++++ llvm/include/llvm/ADT/StringRef.h | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/llvm/include/llvm/ADT/StringExtras.h b/llvm/include/llvm/ADT/StringExtras.h index dccf3e809d4f..a0b3fe7a06cd 100644 --- a/llvm/include/llvm/ADT/StringExtras.h +++ b/llvm/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/llvm/include/llvm/ADT/StringRef.h b/llvm/include/llvm/ADT/StringRef.h index a35dfbfebac9..4491dc3ae16d 100644 --- a/llvm/include/llvm/ADT/StringRef.h +++ b/llvm/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