Include llvm/ADT/STLExtras.h from lldb/Utility/Utils.h and use llvm::array_lengthof(), instead.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@156876 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Interpreter/OptionGroupArchitecture.cpp b/source/Interpreter/OptionGroupArchitecture.cpp
index a94d1fc..1756051 100644
--- a/source/Interpreter/OptionGroupArchitecture.cpp
+++ b/source/Interpreter/OptionGroupArchitecture.cpp
@@ -36,7 +36,7 @@
 uint32_t
 OptionGroupArchitecture::GetNumDefinitions ()
 {
-    return arraysize(g_option_table);
+    return llvm::array_lengthof(g_option_table);
 }
 
 const OptionDefinition *
diff --git a/source/Interpreter/OptionGroupOutputFile.cpp b/source/Interpreter/OptionGroupOutputFile.cpp
index 9c8eb94..93c0ffb 100644
--- a/source/Interpreter/OptionGroupOutputFile.cpp
+++ b/source/Interpreter/OptionGroupOutputFile.cpp
@@ -38,7 +38,7 @@
 uint32_t
 OptionGroupOutputFile::GetNumDefinitions ()
 {
-    return arraysize(g_option_table);
+    return llvm::array_lengthof(g_option_table);
 }
 
 const OptionDefinition *
diff --git a/source/Interpreter/OptionGroupPlatform.cpp b/source/Interpreter/OptionGroupPlatform.cpp
index e6d4e7f..b3c419c 100644
--- a/source/Interpreter/OptionGroupPlatform.cpp
+++ b/source/Interpreter/OptionGroupPlatform.cpp
@@ -99,8 +99,8 @@
 OptionGroupPlatform::GetNumDefinitions ()
 {
     if (m_include_platform_option)
-        return arraysize(g_option_table);
-    return arraysize(g_option_table) - 1;
+        return llvm::array_lengthof(g_option_table);
+    return llvm::array_lengthof(g_option_table) - 1;
 }
 
 
diff --git a/source/Interpreter/OptionGroupUUID.cpp b/source/Interpreter/OptionGroupUUID.cpp
index d4ae9e9..48b0edf 100644
--- a/source/Interpreter/OptionGroupUUID.cpp
+++ b/source/Interpreter/OptionGroupUUID.cpp
@@ -36,7 +36,7 @@
 uint32_t
 OptionGroupUUID::GetNumDefinitions ()
 {
-    return arraysize(g_option_table);
+    return llvm::array_lengthof(g_option_table);
 }
 
 const OptionDefinition *
diff --git a/source/Interpreter/OptionGroupValueObjectDisplay.cpp b/source/Interpreter/OptionGroupValueObjectDisplay.cpp
index 7626310..28c31ce 100644
--- a/source/Interpreter/OptionGroupValueObjectDisplay.cpp
+++ b/source/Interpreter/OptionGroupValueObjectDisplay.cpp
@@ -49,7 +49,7 @@
 uint32_t
 OptionGroupValueObjectDisplay::GetNumDefinitions ()
 {
-    return arraysize(g_option_table);
+    return llvm::array_lengthof(g_option_table);
 }
 
 const OptionDefinition *
diff --git a/source/Interpreter/OptionGroupVariable.cpp b/source/Interpreter/OptionGroupVariable.cpp
index ee5aa3b..a68a98f 100644
--- a/source/Interpreter/OptionGroupVariable.cpp
+++ b/source/Interpreter/OptionGroupVariable.cpp
@@ -107,9 +107,9 @@
     // Count the "--no-args", "--no-locals" and "--show-globals" 
     // options if we are showing frame specific options.
     if (include_frame_options)
-        return arraysize(g_option_table);
+        return llvm::array_lengthof(g_option_table);
     else
-        return arraysize(g_option_table) - NUM_FRAME_OPTS;
+        return llvm::array_lengthof(g_option_table) - NUM_FRAME_OPTS;
 }
 
 
diff --git a/source/Interpreter/OptionGroupWatchpoint.cpp b/source/Interpreter/OptionGroupWatchpoint.cpp
index 469a216..e041620 100644
--- a/source/Interpreter/OptionGroupWatchpoint.cpp
+++ b/source/Interpreter/OptionGroupWatchpoint.cpp
@@ -99,5 +99,5 @@
 uint32_t
 OptionGroupWatchpoint::GetNumDefinitions ()
 {
-    return arraysize(g_option_table);
+    return llvm::array_lengthof(g_option_table);
 }
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
index bb57bce..e961a60 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
@@ -848,7 +848,7 @@
     { "q15",  NULL,   16,  0, eEncodingVector,  eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q15,   LLDB_INVALID_REGNUM,   106,    106 },  g_q15_regs,              NULL}
     };
 
-    static const uint32_t num_registers = arraysize(g_register_infos);
+    static const uint32_t num_registers = llvm::array_lengthof(g_register_infos);
     static ConstString gpr_reg_set ("General Purpose Registers");
     static ConstString sfp_reg_set ("Software Floating Point Registers");
     static ConstString vfp_reg_set ("Floating Point Registers");
@@ -900,7 +900,7 @@
     else
     {
         // Add composite registers to our primordial registers, then.
-        const uint32_t num_composites = arraysize(g_composites);
+        const uint32_t num_composites = llvm::array_lengthof(g_composites);
         const uint32_t num_primordials = GetNumRegisters();
         RegisterInfo *g_comp_register_infos = g_register_infos + (num_registers - num_composites);
         for (i=0; i<num_composites; ++i)