[Lldb-commits] [PATCH] D82382: [lldb][NFC] Replace most uses of StringConvert in LLDB with LLVM's to_integer
Shafik Yaghmour via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Jun 23 11:48:40 PDT 2020
shafik added inline comments.
================
Comment at: lldb/source/Interpreter/OptionValueArray.cpp:209
for (i = 0; i < argc; ++i) {
- const size_t idx =
- StringConvert::ToSInt32(args.GetArgumentAtIndex(i), INT32_MAX);
- if (idx >= size) {
+ size_t idx;
+ if (!llvm::to_integer(args.GetArgumentAtIndex(i), idx) || idx >= size) {
----------------
I am curious why we are using `size_t` here but it looks like we are using `uint32_t` in other places.
================
Comment at: lldb/source/Interpreter/OptionValueFileSpecList.cpp:132
size_t i;
+ const std::size_t size = m_current_value.GetSize();
for (i = 0; all_indexes_valid && i < argc; ++i) {
----------------
We use `uint32_t` to hold the result of `m_current_value.GetSize()` above, but `size_t` here.
These should be consistent.
================
Comment at: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:4643
+ if (!llvm::to_integer(main_lm, list.m_link_map))
+ list.m_link_map = 0;
}
----------------
Should this be `LLDB_INVALID_ADDRESS`?
Repository:
rLLDB LLDB
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82382/new/
https://reviews.llvm.org/D82382
More information about the lldb-commits
mailing list