summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-06-27 05:17:41 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-06-27 05:17:41 +0000
commit28606954bfe08ab4fb146cc85f2d4c0aff5cf1c2 (patch)
tree2c3f2fd83144860783b0f5cc3b82c0f3a3d3912f /lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
parent040c0da57830c5bb0a99be4eb1c2a97d38c78be0 (diff)
downloadbcm5719-llvm-28606954bfe08ab4fb146cc85f2d4c0aff5cf1c2.tar.gz
bcm5719-llvm-28606954bfe08ab4fb146cc85f2d4c0aff5cf1c2.zip
lldb: remove adhoc implementation of array_sizeof
Replace adhoc inline implementation of llvm::array_lengthof in favour of the implementation in LLVM. This is simply a cleanup change, no functional change intended. llvm-svn: 211868
Diffstat (limited to 'lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp')
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
index 4d77b6f20fd..4f908171f58 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
@@ -37,6 +37,8 @@
#include "ARM_GCC_Registers.h"
#include "ARM_DWARF_Registers.h"
+#include "llvm/ADT/STLExtras.h"
+
using namespace lldb;
using namespace lldb_private;
@@ -399,7 +401,7 @@ g_exc_regnums[] =
exc_far,
};
-static size_t k_num_register_infos = (sizeof(g_register_infos)/sizeof(RegisterInfo));
+static size_t k_num_register_infos = llvm::array_lengthof(g_register_infos);
void
RegisterContextDarwin_arm::InvalidateAllRegisters ()
@@ -438,9 +440,9 @@ RegisterContextDarwin_arm::GetRegisterInfos ()
// Number of registers in each register set
-const size_t k_num_gpr_registers = sizeof(g_gpr_regnums) / sizeof(uint32_t);
-const size_t k_num_fpu_registers = sizeof(g_fpu_regnums) / sizeof(uint32_t);
-const size_t k_num_exc_registers = sizeof(g_exc_regnums) / sizeof(uint32_t);
+const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums);
+const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums);
+const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums);
//----------------------------------------------------------------------
// Register set definitions. The first definitions at register set index
@@ -454,7 +456,7 @@ static const RegisterSet g_reg_sets[] =
{ "Exception State Registers", "exc", k_num_exc_registers, g_exc_regnums }
};
-const size_t k_num_regsets = sizeof(g_reg_sets) / sizeof(RegisterSet);
+const size_t k_num_regsets = llvm::array_lengthof(g_reg_sets);
size_t
OpenPOWER on IntegriCloud