[PATCH] D53799: [llvm-size] Reject unknown radix values

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 30 04:55:05 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL345588: [llvm-size] Reject unknown radix values (authored by jhenderson, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D53799?vs=171656&id=171673#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D53799

Files:
  llvm/trunk/tools/llvm-size/llvm-size.cpp


Index: llvm/trunk/tools/llvm-size/llvm-size.cpp
===================================================================
--- llvm/trunk/tools/llvm-size/llvm-size.cpp
+++ llvm/trunk/tools/llvm-size/llvm-size.cpp
@@ -71,9 +71,11 @@
 static bool ArchAll = false;
 
 enum RadixTy { octal = 8, decimal = 10, hexadecimal = 16 };
-static cl::opt<unsigned int>
-Radix("radix", cl::desc("Print size in radix. Only 8, 10, and 16 are valid"),
-      cl::init(decimal));
+static cl::opt<RadixTy> Radix(
+    "radix", cl::desc("Print size in radix"), cl::init(decimal),
+    cl::values(clEnumValN(octal, "8", "Print size in octal"),
+               clEnumValN(decimal, "10", "Print size in decimal"),
+               clEnumValN(hexadecimal, "16", "Print size in hexadecimal")));
 
 static cl::opt<RadixTy>
 RadixShort(cl::desc("Print size in radix:"),
@@ -865,7 +867,7 @@
   if (OutputFormatShort.getNumOccurrences())
     OutputFormat = static_cast<OutputFormatTy>(OutputFormatShort);
   if (RadixShort.getNumOccurrences())
-    Radix = RadixShort;
+    Radix = RadixShort.getValue();
 
   for (unsigned i = 0; i < ArchFlags.size(); ++i) {
     if (ArchFlags[i] == "all") {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53799.171673.patch
Type: text/x-patch
Size: 1157 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181030/9ae6f23e/attachment.bin>


More information about the llvm-commits mailing list