[PATCH] D151273: [llvm-debuginfod] Switch cl to OptTable

Andres Villegas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 24 15:47:32 PDT 2023


avillega 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);
+    }
----------------
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.


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