<div dir="ltr">I think you need to mark this inline otherwise you're going to get multiple definitions no?</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Apr 16, 2018 at 11:29 AM Davide Italiano via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: davide<br>
Date: Mon Apr 16 11:25:57 2018<br>
New Revision: 330147<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=330147&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=330147&view=rev</a><br>
Log:<br>
[Statistics] Move GetStatDescription to an header file.<br>
<br>
In preparation for using it in the API.<br>
<br>
<rdar://problem/36555975><br>
<br>
Modified:<br>
    lldb/trunk/include/lldb/lldb-private-enumerations.h<br>
    lldb/trunk/source/Commands/CommandObjectStats.cpp<br>
<br>
Modified: lldb/trunk/include/lldb/lldb-private-enumerations.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-enumerations.h?rev=330147&r1=330146&r2=330147&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-enumerations.h?rev=330147&r1=330146&r2=330147&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/lldb-private-enumerations.h (original)<br>
+++ lldb/trunk/include/lldb/lldb-private-enumerations.h Mon Apr 16 11:25:57 2018<br>
@@ -246,6 +246,23 @@ enum StatisticKind {<br>
   StatisticMax = 4<br>
 };<br>
<br>
+<br>
+std::string GetStatDescription(lldb_private::StatisticKind K) {<br>
+   switch (K) {<br>
+   case StatisticKind::ExpressionSuccessful:<br>
+     return "Number of expr evaluation successes";<br>
+   case StatisticKind::ExpressionFailure:<br>
+     return "Number of expr evaluation failures";<br>
+   case StatisticKind::FrameVarSuccess:<br>
+     return "Number of frame var successes";<br>
+   case StatisticKind::FrameVarFailure:<br>
+     return "Number of frame var failures";<br>
+   case StatisticKind::StatisticMax:<br>
+     return "";<br>
+   }<br>
+   llvm_unreachable("Statistic not registered!");<br>
+}<br>
+<br>
 } // namespace lldb_private<br>
<br>
 namespace llvm {<br>
<br>
Modified: lldb/trunk/source/Commands/CommandObjectStats.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectStats.cpp?rev=330147&r1=330146&r2=330147&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectStats.cpp?rev=330147&r1=330146&r2=330147&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Commands/CommandObjectStats.cpp (original)<br>
+++ lldb/trunk/source/Commands/CommandObjectStats.cpp Mon Apr 16 11:25:57 2018<br>
@@ -67,23 +67,6 @@ protected:<br>
 };<br>
<br>
 class CommandObjectStatsDump : public CommandObjectParsed {<br>
-private:<br>
-  std::string GetStatDescription(lldb_private::StatisticKind K) {<br>
-    switch (K) {<br>
-    case StatisticKind::ExpressionSuccessful:<br>
-      return "Number of expr evaluation successes";<br>
-    case StatisticKind::ExpressionFailure:<br>
-      return "Number of expr evaluation failures";<br>
-    case StatisticKind::FrameVarSuccess:<br>
-      return "Number of frame var successes";<br>
-    case StatisticKind::FrameVarFailure:<br>
-      return "Number of frame var failures";<br>
-    case StatisticKind::StatisticMax:<br>
-      return "";<br>
-    }<br>
-    llvm_unreachable("Statistic not registered!");<br>
-  }<br>
-<br>
 public:<br>
   CommandObjectStatsDump(CommandInterpreter &interpreter)<br>
       : CommandObjectParsed(interpreter, "dump", "Dump statistics results",<br>
@@ -99,7 +82,7 @@ protected:<br>
     for (auto &stat : target->GetStatistics()) {<br>
       result.AppendMessageWithFormat(<br>
           "%s : %u\n",<br>
-          GetStatDescription(static_cast<lldb_private::StatisticKind>(i))<br>
+          lldb_private::GetStatDescription(static_cast<lldb_private::StatisticKind>(i))<br>
               .c_str(),<br>
           stat);<br>
       i += 1;<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div>