[BOLT] Modify the print option to a meaningful value
authorhezuoqiang <hezuoqiang2@huawei.com>
Tue, 10 Jan 2023 03:03:05 +0000 (19:03 -0800)
committerMaksim Panchenko <maks@fb.com>
Tue, 10 Jan 2023 03:05:21 +0000 (19:05 -0800)
Using the option `-print-sorted-by=.` cause to core dump, so change to a legal value.

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D140847

bolt/lib/Passes/BinaryPasses.cpp

index 8afd619..6d5c8bb 100644 (file)
@@ -122,22 +122,19 @@ static cl::opt<unsigned>
                   cl::desc("print statistics about basic block ordering"),
                   cl::init(0), cl::cat(BoltOptCategory));
 
-static cl::list<bolt::DynoStats::Category>
-PrintSortedBy("print-sorted-by",
-  cl::CommaSeparated,
-  cl::desc("print functions sorted by order of dyno stats"),
-  cl::value_desc("key1,key2,key3,..."),
-  cl::values(
+static cl::list<bolt::DynoStats::Category> PrintSortedBy(
+    "print-sorted-by", cl::CommaSeparated,
+    cl::desc("print functions sorted by order of dyno stats"),
+    cl::value_desc("key1,key2,key3,..."),
+    cl::values(
 #define D(name, ...)                                        \
     clEnumValN(bolt::DynoStats::name,                     \
                dynoStatsOptName(bolt::DynoStats::name),   \
                dynoStatsOptDesc(bolt::DynoStats::name)),
-    DYNO_STATS
+        DYNO_STATS
 #undef D
-    clEnumValN(0xffff, ".", ".")
-    ),
-  cl::ZeroOrMore,
-  cl::cat(BoltOptCategory));
+            clEnumValN(bolt::DynoStats::LAST_DYNO_STAT, ".", ".")),
+    cl::ZeroOrMore, cl::cat(BoltOptCategory));
 
 static cl::opt<bool>
     PrintUnknown("print-unknown",