forked from OSchip/llvm-project
[Statistics] Move GetStatDescription to an header file.
In preparation for using it in the API. <rdar://problem/36555975> llvm-svn: 330147
This commit is contained in:
parent
25eae5c879
commit
70539360e6
|
@ -246,6 +246,23 @@ enum StatisticKind {
|
|||
StatisticMax = 4
|
||||
};
|
||||
|
||||
|
||||
std::string GetStatDescription(lldb_private::StatisticKind K) {
|
||||
switch (K) {
|
||||
case StatisticKind::ExpressionSuccessful:
|
||||
return "Number of expr evaluation successes";
|
||||
case StatisticKind::ExpressionFailure:
|
||||
return "Number of expr evaluation failures";
|
||||
case StatisticKind::FrameVarSuccess:
|
||||
return "Number of frame var successes";
|
||||
case StatisticKind::FrameVarFailure:
|
||||
return "Number of frame var failures";
|
||||
case StatisticKind::StatisticMax:
|
||||
return "";
|
||||
}
|
||||
llvm_unreachable("Statistic not registered!");
|
||||
}
|
||||
|
||||
} // namespace lldb_private
|
||||
|
||||
namespace llvm {
|
||||
|
|
|
@ -67,23 +67,6 @@ protected:
|
|||
};
|
||||
|
||||
class CommandObjectStatsDump : public CommandObjectParsed {
|
||||
private:
|
||||
std::string GetStatDescription(lldb_private::StatisticKind K) {
|
||||
switch (K) {
|
||||
case StatisticKind::ExpressionSuccessful:
|
||||
return "Number of expr evaluation successes";
|
||||
case StatisticKind::ExpressionFailure:
|
||||
return "Number of expr evaluation failures";
|
||||
case StatisticKind::FrameVarSuccess:
|
||||
return "Number of frame var successes";
|
||||
case StatisticKind::FrameVarFailure:
|
||||
return "Number of frame var failures";
|
||||
case StatisticKind::StatisticMax:
|
||||
return "";
|
||||
}
|
||||
llvm_unreachable("Statistic not registered!");
|
||||
}
|
||||
|
||||
public:
|
||||
CommandObjectStatsDump(CommandInterpreter &interpreter)
|
||||
: CommandObjectParsed(interpreter, "dump", "Dump statistics results",
|
||||
|
@ -99,7 +82,7 @@ protected:
|
|||
for (auto &stat : target->GetStatistics()) {
|
||||
result.AppendMessageWithFormat(
|
||||
"%s : %u\n",
|
||||
GetStatDescription(static_cast<lldb_private::StatisticKind>(i))
|
||||
lldb_private::GetStatDescription(static_cast<lldb_private::StatisticKind>(i))
|
||||
.c_str(),
|
||||
stat);
|
||||
i += 1;
|
||||
|
|
Loading…
Reference in New Issue