[PATCH] D151273: [llvm-debuginfod] Switch cl to OptTable
Daniel Thornburgh via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 24 16:24:55 PDT 2023
mysterymath added inline comments.
================
Comment at: llvm/tools/llvm-debuginfod/llvm-debuginfod.cpp:81-85
+ if (!llvm::to_integer(V, Value, 0)) {
+ errs() << A->getSpelling() +
+ ": expected a non-negative integer, but got '" + V + "'";
+ exit(1);
+ }
----------------
avillega wrote:
> mysterymath wrote:
> > This should actually check that the integer is nonnegative, and the name should reflect this (NonNegInt?)
> What are your thoughts on me changing the types of the Options to also be non-negative types. in this case `ScanInterval` and `MaxConcurrency` will become `unsigned` and `usize_t` respectivelly, which will catch the error of passing non-negative integers at parse time.
Hmm, actually if this is intended to be a NFC change (oh, which should probably have the [NFC] commit label, as a nit-pick), it would probably be better to just change the error message to ": expected an integer...".
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D151273/new/
https://reviews.llvm.org/D151273
More information about the llvm-commits
mailing list