[Lldb-commits] [PATCH] D11052: [lldb-mi] Simplify MICmnMIResultRecord implementation.

Ilia K ki.stfu at gmail.com
Thu Jul 9 04:52:06 PDT 2015


ki.stfu requested changes to this revision.
This revision now requires changes to proceed.

================
Comment at: tools/lldb-mi/MICmnMIResultRecord.cpp:14-20
@@ -13,9 +13,9 @@
 
-// Instantiations:
-CMICmnMIResultRecord::MapResultClassToResultClassText_t ms_MapResultClassToResultClassText = {
-    {CMICmnMIResultRecord::eResultClass_Done, "done"},
-    {CMICmnMIResultRecord::eResultClass_Running, "running"},
-    {CMICmnMIResultRecord::eResultClass_Connected, "connected"},
-    {CMICmnMIResultRecord::eResultClass_Error, "error"},
-    {CMICmnMIResultRecord::eResultClass_Exit, "exit"}};
-const CMIUtilString CMICmnMIResultRecord::ms_constStrResultRecordHat("^");
+const char* s_MapResultClassToResultClassText[] = {
+    "done",
+    "running",
+    "connected",
+    "error",
+    "exit"
+};
+
----------------
Revert please. It will not give us any speed-up, but it does an addition of new ResultRecords harder. + It's much simpler to shift all enums by mistake.

================
Comment at: tools/lldb-mi/MICmnMIResultRecord.cpp:54
@@ -38,3 +53,3 @@
 // Args:    vrToken - (R) The command's transaction ID or token.
-//          veType  - (R) A MI result class enumeration.
+//          veType  - A MI result class enumeration.
 // Return:  None.
----------------
(R) means 'readonly' variable. i.e. you will not plan to return anything through that variable.

================
Comment at: tools/lldb-mi/MICmnMIResultRecord.cpp:67
@@ -54,3 +66,3 @@
 // Args:    vrToken     - (R) The command's transaction ID or token.
-//          veType      - (R) A MI result class enumeration.
+//          veType      - A MI result class enumeration.
 //          vMIResult   - (R) A MI result object.
----------------
(R) means 'readonly' variable. i.e. you will not plan to return anything through that variable.

================
Comment at: tools/lldb-mi/MICmnMIResultRecord.cpp:72
@@ -59,6 +71,3 @@
 //--
-CMICmnMIResultRecord::CMICmnMIResultRecord(const CMIUtilString &vrToken, const ResultClass_e veType, const CMICmnMIValueResult &vValue)
-    : m_strResultRecordToken(vrToken)
-    , m_eResultRecordResultClass(veType)
-    , m_strResultRecord(MIRSRC(IDS_CMD_ERR_CMD_RUN_BUT_NO_ACTION))
-    , m_partResult(vValue)
+CMICmnMIResultRecord::CMICmnMIResultRecord(const CMIUtilString &vrToken, ResultClass_e veType, const CMICmnMIValueResult &vValue)
+    : m_strResultRecord(BuildResultRecord(vrToken, veType))
----------------
Why did you remove the `const` qualifier?

================
Comment at: tools/lldb-mi/MICmnMIResultRecord.h:66-67
@@ -69,4 +65,4 @@
     /* ctor */ CMICmnMIResultRecord(void);
-    /* ctor */ CMICmnMIResultRecord(const CMIUtilString &vrToken, const ResultClass_e veType);
-    /* ctor */ CMICmnMIResultRecord(const CMIUtilString &vrToken, const ResultClass_e veType, const CMICmnMIValueResult &vValue);
+    /* ctor */ CMICmnMIResultRecord(const CMIUtilString &vrToken, ResultClass_e veType);
+    /* ctor */ CMICmnMIResultRecord(const CMIUtilString &vrToken, ResultClass_e veType, const CMICmnMIValueResult &vValue);
     //
----------------
What is wrong with `const` for scalar types? It does a expression stricter.


http://reviews.llvm.org/D11052







More information about the lldb-commits mailing list