[lldb] Change the CommandArgumentData ctor (NFC)
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 21 Jul 2020 16:49:12 +0000 (09:49 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 21 Jul 2020 16:50:30 +0000 (09:50 -0700)
By using default arguments the caller can specify a subset without the
need for overloads. This is particularly useful in combination with
emplace_back as these objects are generally stored in a vector.

lldb/include/lldb/Interpreter/CommandObject.h

index cc4d40b..b927c7e 100644 (file)
@@ -90,14 +90,13 @@ public:
   {
     lldb::CommandArgumentType arg_type;
     ArgumentRepetitionType arg_repetition;
-    uint32_t arg_opt_set_association; // This arg might be associated only with
-                                      // some particular option set(s).
-    CommandArgumentData()
-        : arg_type(lldb::eArgTypeNone), arg_repetition(eArgRepeatPlain),
-          arg_opt_set_association(LLDB_OPT_SET_ALL) // By default, the arg
-                                                    // associates to all option
-                                                    // sets.
-    {}
+    /// This arg might be associated only with some particular option set(s). By
+    /// default the arg associates to all option sets.
+    uint32_t arg_opt_set_association;
+
+    CommandArgumentData(lldb::CommandArgumentType type = lldb::eArgTypeNone,
+                        ArgumentRepetitionType repetition = eArgRepeatPlain,
+                        uint32_t opt_set = LLDB_OPT_SET_ALL) {}
   };
 
   typedef std::vector<CommandArgumentData>