[Lldb-commits] [lldb] r139452 - /lldb/trunk/source/Interpreter/OptionGroupVariable.cpp

Johnny Chen johnny.chen at apple.com
Fri Sep 9 18:19:02 PDT 2011


Author: johnny
Date: Fri Sep  9 20:19:01 2011
New Revision: 139452

URL: http://llvm.org/viewvc/llvm-project?rev=139452&view=rev
Log:
Convert OptionGroupVariable.cpp to use the arraysize() template function, as well.

Modified:
    lldb/trunk/source/Interpreter/OptionGroupVariable.cpp

Modified: lldb/trunk/source/Interpreter/OptionGroupVariable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionGroupVariable.cpp?rev=139452&r1=139451&r2=139452&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/OptionGroupVariable.cpp (original)
+++ lldb/trunk/source/Interpreter/OptionGroupVariable.cpp Fri Sep  9 20:19:01 2011
@@ -15,6 +15,7 @@
 // Project includes
 #include "lldb/Target/Target.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Utility/Utils.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -88,6 +89,7 @@
     summary       = "";
 }
 
+#define NUM_FRAME_OPTS 3
 
 const OptionDefinition*
 OptionGroupVariable::GetDefinitions ()
@@ -99,16 +101,18 @@
 
     // Skip the "--no-args", "--no-locals" and "--show-globals" 
     // options if we are not showing frame specific options (globals only)
-    return &g_option_table[3];
+    return &g_option_table[NUM_FRAME_OPTS];
 }
 
 uint32_t
 OptionGroupVariable::GetNumDefinitions ()
 {
+    // Count the "--no-args", "--no-locals" and "--show-globals" 
+    // options if we are showing frame specific options.
     if (include_frame_options)
-        return 8;
+        return arraysize(g_option_table);
     else
-        return 5;
+        return arraysize(g_option_table) - NUM_FRAME_OPTS;
 }
 
 





More information about the lldb-commits mailing list