From 3a6ba3675177cb5e47dee325f300aced4cd864ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Fri, 24 Sep 2021 23:36:49 +0200 Subject: [lldb] Convert misc. StringConvert uses Replace misc. StringConvert uses with llvm::to_integer() and llvm::to_float(), except for cases where further refactoring is planned. The purpose of this change is to eliminate the StringConvert API that is duplicate to LLVM, and less correct in behavior at the same time. Differential Revision: https://reviews.llvm.org/D110447 --- .../RenderScriptRuntime/RenderScriptRuntime.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp') diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp index 53ba68aca4e4..ba52b8dac075 100644 --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -17,7 +17,6 @@ #include "lldb/DataFormatters/DumpValueObjectOptions.h" #include "lldb/Expression/UserExpression.h" #include "lldb/Host/OptionParser.h" -#include "lldb/Host/StringConvert.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandObjectMultiword.h" #include "lldb/Interpreter/CommandReturnObject.h" @@ -4566,10 +4565,8 @@ public: eLanguageTypeExtRenderScript)); const char *id_cstr = command.GetArgumentAtIndex(0); - bool success = false; - const uint32_t id = - StringConvert::ToUInt32(id_cstr, UINT32_MAX, 0, &success); - if (!success) { + uint32_t id; + if (!llvm::to_integer(id_cstr, id)) { result.AppendErrorWithFormat("invalid allocation id argument '%s'", id_cstr); return false; @@ -4713,10 +4710,8 @@ public: eLanguageTypeExtRenderScript)); const char *id_cstr = command.GetArgumentAtIndex(0); - bool success = false; - const uint32_t id = - StringConvert::ToUInt32(id_cstr, UINT32_MAX, 0, &success); - if (!success) { + uint32_t id; + if (!llvm::to_integer(id_cstr, id)) { result.AppendErrorWithFormat("invalid allocation id argument '%s'", id_cstr); return false; @@ -4762,10 +4757,8 @@ public: eLanguageTypeExtRenderScript)); const char *id_cstr = command.GetArgumentAtIndex(0); - bool success = false; - const uint32_t id = - StringConvert::ToUInt32(id_cstr, UINT32_MAX, 0, &success); - if (!success) { + uint32_t id; + if (!llvm::to_integer(id_cstr, id)) { result.AppendErrorWithFormat("invalid allocation id argument '%s'", id_cstr); return false; -- cgit v1.2.3