From e3b47d31ae8aaedff8ef74976eb9497d97df5ac2 Mon Sep 17 00:00:00 2001 From: hezuoqiang Date: Mon, 9 Jan 2023 19:03:05 -0800 Subject: [PATCH] [BOLT] Modify the print option to a meaningful value 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 | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/bolt/lib/Passes/BinaryPasses.cpp b/bolt/lib/Passes/BinaryPasses.cpp index 8afd619..6d5c8bb 100644 --- a/bolt/lib/Passes/BinaryPasses.cpp +++ b/bolt/lib/Passes/BinaryPasses.cpp @@ -122,22 +122,19 @@ static cl::opt cl::desc("print statistics about basic block ordering"), cl::init(0), cl::cat(BoltOptCategory)); -static cl::list -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 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 PrintUnknown("print-unknown", -- 2.7.4