[PATCH] D60933: [CommandLine] Provide parser<unsigned long> instantiation to allow cl::opt<uint64_t> on LP64 platforms

Julian Lettner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 09:59:48 PDT 2019


yln marked an inline comment as done.
yln added inline comments.


================
Comment at: include/llvm/Support/CommandLine.h:1012
   // getValueName - Overload in subclass to provide a better default value.
-  StringRef getValueName() const override { return "uint"; }
+  StringRef getValueName() const override { return "ullong"; }
 
----------------

Is this the "data type" or just the "kind" of the value? I am asking because float/double are just labeled "number".

Where is this string used? Is it included in the user error message on parse error?


================
Comment at: lib/Support/CommandLine.cpp:1674
+  if (Arg.getAsInteger(0, Value))
+    return O.error("'" + Arg + "' value invalid for uint argument!");
+  return false;
----------------
uint used here, but not above.
Best would probably be to use the exact data type everywhere (+ existing parsers)


================
Comment at: lib/Support/RandomNumberGenerator.cpp:30
-// Tracking BUG: 19665
-// http://llvm.org/bugs/show_bug.cgi?id=19665
-//
----------------
Thanks! Fixing a 5 year old issue. I am delighted! :)


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60933/new/

https://reviews.llvm.org/D60933





More information about the llvm-commits mailing list