diff options
| author | Michał Górny <mgorny@moritz.systems> | 2021-09-24 23:36:49 +0200 |
|---|---|---|
| committer | Michał Górny <mgorny@moritz.systems> | 2021-09-25 14:19:19 +0200 |
| commit | 3a6ba3675177cb5e47dee325f300aced4cd864ed (patch) | |
| tree | 2beb8e402b78598b299587f1022b189992602939 /lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp | |
| parent | 2c28e3f008b6b93a58635999ff20572de01e8392 (diff) | |
[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
Diffstat (limited to 'lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp')
| -rw-r--r-- | lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
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; |
