<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jun 27, 2014 at 9:12 AM,  <span dir="ltr"><<a href="mailto:jingham@apple.com" target="_blank">jingham@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hey, Saleem.<br>
<br>
I reverted the debugserver part of this change.  Debugserver doesn't currently depend on llvm (actually it really doesn't depend on lldb either) and<br>
I'd rather not add that dependence unless there's some strong reason.<br></blockquote><div><br></div><div>Sure, thats fine.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Jim<br>
<div class="im HOEnZb"><br>
> On Jun 26, 2014, at 10:17 PM, Saleem Abdulrasool <<a href="mailto:compnerd@compnerd.org">compnerd@compnerd.org</a>> wrote:<br>
><br>
</div><div class="HOEnZb"><div class="h5">> Author: compnerd<br>
> Date: Fri Jun 27 00:17:41 2014<br>
> New Revision: 211868<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=211868&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=211868&view=rev</a><br>
> Log:<br>
> lldb: remove adhoc implementation of array_sizeof<br>
><br>
> Replace adhoc inline implementation of llvm::array_lengthof in favour of the<br>
> implementation in LLVM.  This is simply a cleanup change, no functional change<br>
> intended.<br>
><br>
> Modified:<br>
>    lldb/trunk/source/Commands/CommandObjectExpression.cpp<br>
>    lldb/trunk/source/Commands/CommandObjectRegister.cpp<br>
>    lldb/trunk/source/Core/ArchSpec.cpp<br>
>    lldb/trunk/source/Core/Language.cpp<br>
>    lldb/trunk/source/DataFormatters/FormatManager.cpp<br>
>    lldb/trunk/source/Host/common/Host.cpp<br>
>    lldb/trunk/source/Host/common/Terminal.cpp<br>
>    lldb/trunk/source/Interpreter/CommandInterpreter.cpp<br>
>    lldb/trunk/source/Interpreter/OptionValueBoolean.cpp<br>
>    lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp<br>
>    lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp<br>
>    lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp<br>
>    lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp<br>
>    lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp<br>
>    lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp<br>
>    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp<br>
>    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp<br>
>    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp<br>
>    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp<br>
>    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp<br>
>    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp<br>
>    lldb/trunk/source/Utility/SharingPtr.cpp<br>
>    lldb/trunk/tools/debugserver/source/DNB.cpp<br>
>    lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp<br>
>    lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp<br>
>    lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp<br>
>    lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp<br>
>    lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp<br>
>    lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp<br>
>    lldb/trunk/tools/debugserver/source/TTYState.h<br>
>    lldb/trunk/tools/lldb-perf/common/clang/lldb_perf_clang.cpp<br>
><br>
> Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Commands/CommandObjectExpression.cpp (original)<br>
> +++ lldb/trunk/source/Commands/CommandObjectExpression.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -34,6 +34,7 @@<br>
> #include "lldb/Target/StackFrame.h"<br>
> #include "lldb/Target/Target.h"<br>
> #include "lldb/Target/Thread.h"<br>
> +#include "llvm/ADT/STLExtras.h"<br>
> #include "llvm/ADT/StringRef.h"<br>
><br>
> using namespace lldb;<br>
> @@ -71,7 +72,7 @@ CommandObjectExpression::CommandOptions:<br>
> uint32_t<br>
> CommandObjectExpression::CommandOptions::GetNumDefinitions ()<br>
> {<br>
> -    return sizeof(g_option_table)/sizeof(OptionDefinition);<br>
> +    return llvm::array_lengthof(g_option_table);<br>
> }<br>
><br>
> Error<br>
><br>
> Modified: lldb/trunk/source/Commands/CommandObjectRegister.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectRegister.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectRegister.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Commands/CommandObjectRegister.cpp (original)<br>
> +++ lldb/trunk/source/Commands/CommandObjectRegister.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -31,6 +31,7 @@<br>
> #include "lldb/Target/RegisterContext.h"<br>
> #include "lldb/Target/SectionLoadList.h"<br>
> #include "lldb/Target/Thread.h"<br>
> +#include "llvm/ADT/STLExtras.h"<br>
><br>
> using namespace lldb;<br>
> using namespace lldb_private;<br>
> @@ -360,7 +361,7 @@ CommandObjectRegisterRead::CommandOption<br>
> uint32_t<br>
> CommandObjectRegisterRead::CommandOptions::GetNumDefinitions ()<br>
> {<br>
> -    return sizeof(g_option_table)/sizeof(OptionDefinition);<br>
> +    return llvm::array_lengthof(g_option_table);<br>
> }<br>
><br>
><br>
><br>
> Modified: lldb/trunk/source/Core/ArchSpec.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ArchSpec.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ArchSpec.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Core/ArchSpec.cpp (original)<br>
> +++ lldb/trunk/source/Core/ArchSpec.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -14,6 +14,7 @@<br>
><br>
> #include <string><br>
><br>
> +#include "llvm/ADT/STLExtras.h"<br>
> #include "llvm/Support/COFF.h"<br>
> #include "llvm/Support/ELF.h"<br>
> #include "llvm/Support/Host.h"<br>
> @@ -227,7 +228,7 @@ static const ArchDefinitionEntry g_macho<br>
> };<br>
> static const ArchDefinition g_macho_arch_def = {<br>
>     eArchTypeMachO,<br>
> -    sizeof(g_macho_arch_entries)/sizeof(g_macho_arch_entries[0]),<br>
> +    llvm::array_lengthof(g_macho_arch_entries),<br>
>     g_macho_arch_entries,<br>
>     "mach-o"<br>
> };<br>
> @@ -253,7 +254,7 @@ static const ArchDefinitionEntry g_elf_a<br>
><br>
> static const ArchDefinition g_elf_arch_def = {<br>
>     eArchTypeELF,<br>
> -    sizeof(g_elf_arch_entries)/sizeof(g_elf_arch_entries[0]),<br>
> +    llvm::array_lengthof(g_elf_arch_entries),<br>
>     g_elf_arch_entries,<br>
>     "elf",<br>
> };<br>
> @@ -271,7 +272,7 @@ static const ArchDefinitionEntry g_coff_<br>
><br>
> static const ArchDefinition g_coff_arch_def = {<br>
>     eArchTypeCOFF,<br>
> -    sizeof(g_coff_arch_entries)/sizeof(g_coff_arch_entries[0]),<br>
> +    llvm::array_lengthof(g_coff_arch_entries),<br>
>     g_coff_arch_entries,<br>
>     "pe-coff",<br>
> };<br>
> @@ -284,8 +285,7 @@ static const ArchDefinition *g_arch_defi<br>
>     &g_coff_arch_def<br>
> };<br>
><br>
> -static const size_t k_num_arch_definitions =<br>
> -    sizeof(g_arch_definitions) / sizeof(g_arch_definitions[0]);<br>
> +static const size_t k_num_arch_definitions = llvm::array_lengthof(g_arch_definitions);<br>
><br>
> //===----------------------------------------------------------------------===//<br>
> // Static helper functions.<br>
><br>
> Modified: lldb/trunk/source/Core/Language.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Language.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Language.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Core/Language.cpp (original)<br>
> +++ lldb/trunk/source/Core/Language.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -10,6 +10,7 @@<br>
> #include "lldb/lldb-private.h"<br>
> #include "lldb/Core/Language.h"<br>
> #include "lldb/Core/Stream.h"<br>
> +#include "llvm/ADT/STLExtras.h"<br>
> #include <string.h><br>
><br>
> using namespace lldb;<br>
> @@ -48,8 +49,7 @@ g_languages[] =<br>
>     { { "python"  , NULL          , "Python"              } }<br>
> };<br>
><br>
> -static const size_t<br>
> -g_num_languages = sizeof(g_languages)/sizeof(LanguageStrings);<br>
> +static const size_t g_num_languages = llvm::array_lengthof(g_languages);<br>
><br>
> Language::Language(LanguageType language) :<br>
>     m_language (language)<br>
><br>
> Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)<br>
> +++ lldb/trunk/source/DataFormatters/FormatManager.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -21,6 +21,7 @@<br>
> #include "lldb/Interpreter/ScriptInterpreterPython.h"<br>
> #include "lldb/Target/ExecutionContext.h"<br>
> #include "lldb/Target/Platform.h"<br>
> +#include "llvm/ADT/STLExtras.h"<br>
><br>
> using namespace lldb;<br>
> using namespace lldb_private;<br>
> @@ -76,8 +77,7 @@ g_format_infos[] =<br>
>     { eFormatVoid           , 'v'   , "void"                }<br>
> };<br>
><br>
> -static uint32_t<br>
> -g_num_format_infos = sizeof(g_format_infos)/sizeof(FormatInfo);<br>
> +static uint32_t g_num_format_infos = llvm::array_lengthof(g_format_infos);<br>
><br>
> static bool<br>
> GetFormatFromFormatChar (char format_char, Format &format)<br>
><br>
> Modified: lldb/trunk/source/Host/common/Host.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Host/common/Host.cpp (original)<br>
> +++ lldb/trunk/source/Host/common/Host.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -66,6 +66,7 @@<br>
> #include "lldb/Target/TargetList.h"<br>
> #include "lldb/Utility/CleanUp.h"<br>
><br>
> +#include "llvm/ADT/STLExtras.h"<br>
> #include "llvm/ADT/SmallString.h"<br>
> #include "llvm/Support/Host.h"<br>
> #include "llvm/Support/raw_ostream.h"<br>
> @@ -2063,7 +2064,7 @@ Host::GetNumberCPUS ()<br>
> #endif<br>
><br>
>         /* get the number of CPUs from the system */<br>
> -        if (sysctl(mib, sizeof(mib)/sizeof(int), &num_cores, &num_cores_len, NULL, 0) == 0 && (num_cores > 0))<br>
> +        if (sysctl(mib, llvm::array_lengthof(mib), &num_cores, &num_cores_len, NULL, 0) == 0 && (num_cores > 0))<br>
>         {<br>
>             g_num_cores = num_cores;<br>
>         }<br>
> @@ -2071,7 +2072,7 @@ Host::GetNumberCPUS ()<br>
>         {<br>
>             mib[1] = HW_NCPU;<br>
>             num_cores_len = sizeof(num_cores);<br>
> -            if (sysctl(mib, sizeof(mib)/sizeof(int), &num_cores, &num_cores_len, NULL, 0) == 0 && (num_cores > 0))<br>
> +            if (sysctl(mib, llvm::array_lengthof(mib), &num_cores, &num_cores_len, NULL, 0) == 0 && (num_cores > 0))<br>
>             {<br>
>                 if (num_cores > 0)<br>
>                     g_num_cores = num_cores;<br>
><br>
> Modified: lldb/trunk/source/Host/common/Terminal.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Terminal.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Terminal.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Host/common/Terminal.cpp (original)<br>
> +++ lldb/trunk/source/Host/common/Terminal.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -8,6 +8,7 @@<br>
> //===----------------------------------------------------------------------===//<br>
><br>
> #include "lldb/Host/Terminal.h"<br>
> +#include "llvm/ADT/STLExtras.h"<br>
><br>
> #include <fcntl.h><br>
> #include <signal.h><br>
> @@ -274,7 +275,7 @@ TerminalStateSwitcher::~TerminalStateSwi<br>
> uint32_t<br>
> TerminalStateSwitcher::GetNumberOfStates() const<br>
> {<br>
> -    return sizeof(m_ttystates)/sizeof(TerminalState);<br>
> +    return llvm::array_lengthof(m_ttystates);<br>
> }<br>
><br>
> //------------------------------------------------------------------<br>
><br>
> Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)<br>
> +++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -67,6 +67,8 @@<br>
><br>
> #include "lldb/Utility/CleanUp.h"<br>
><br>
> +#include "llvm/ADT/STLExtras.h"<br>
> +<br>
> using namespace lldb;<br>
> using namespace lldb_private;<br>
><br>
> @@ -417,7 +419,7 @@ CommandInterpreter::LoadCommandDictionar<br>
>                                       {"^\\&(.*[^[:space:]])[[:space:]]*$", "breakpoint set --name '%1' --skip-prologue=0"},<br>
>                                       {"^(.*[^[:space:]])[[:space:]]*$", "breakpoint set --name '%1'"}};<br>
><br>
> -    size_t num_regexes = sizeof break_regexes/sizeof(char *[2]);<br>
> +    size_t num_regexes = llvm::array_lengthof(break_regexes);<br>
><br>
>     std::unique_ptr<CommandObjectRegexCommand><br>
>     break_regex_cmd_ap(new CommandObjectRegexCommand (*this,<br>
><br>
> Modified: lldb/trunk/source/Interpreter/OptionValueBoolean.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueBoolean.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueBoolean.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Interpreter/OptionValueBoolean.cpp (original)<br>
> +++ lldb/trunk/source/Interpreter/OptionValueBoolean.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -16,6 +16,7 @@<br>
> #include "lldb/Core/Stream.h"<br>
> #include "lldb/Core/StringList.h"<br>
> #include "lldb/Interpreter/Args.h"<br>
> +#include "llvm/ADT/STLExtras.h"<br>
><br>
> using namespace lldb;<br>
> using namespace lldb_private;<br>
> @@ -110,7 +111,7 @@ OptionValueBoolean::AutoComplete (Comman<br>
>         { "1"    , 1 },<br>
>         { "0"    , 1 },<br>
>     };<br>
> -    const size_t k_num_autocomplete_entries = sizeof(g_autocomplete_entries)/sizeof(StringEntry);<br>
> +    const size_t k_num_autocomplete_entries = llvm::array_lengthof(g_autocomplete_entries);<br>
><br>
>     if (s && s[0])<br>
>     {<br>
><br>
> Modified: lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp (original)<br>
> +++ lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -24,6 +24,7 @@<br>
> #include "lldb/Target/Target.h"<br>
> #include "lldb/Target/Thread.h"<br>
><br>
> +#include "llvm/ADT/STLExtras.h"<br>
> #include "llvm/ADT/Triple.h"<br>
><br>
> #include "Utility/ARM_DWARF_Registers.h"<br>
> @@ -144,7 +145,7 @@ static RegisterInfo g_register_infos[] =<br>
>     {   "r13_svc", "sp_svc",  4, 0, eEncodingUint    , eFormatHex,   { LLDB_INVALID_REGNUM,  dwarf_r13_svc,      LLDB_INVALID_REGNUM,        LLDB_INVALID_REGNUM,    LLDB_INVALID_REGNUM },      NULL,              NULL},<br>

>     {   "r14_svc", "lr_svc",  4, 0, eEncodingUint    , eFormatHex,   { LLDB_INVALID_REGNUM,  dwarf_r14_svc,      LLDB_INVALID_REGNUM,        LLDB_INVALID_REGNUM,    LLDB_INVALID_REGNUM },      NULL,              NULL}<br>

> };<br>
> -static const uint32_t k_num_register_infos = sizeof(g_register_infos)/sizeof(RegisterInfo);<br>
> +static const uint32_t k_num_register_infos = llvm::array_lengthof(g_register_infos);<br>
> static bool g_register_info_names_constified = false;<br>
><br>
> const lldb_private::RegisterInfo *<br>
> @@ -214,7 +215,7 @@ ABIMacOSX_arm::PrepareTrivialCall (Threa<br>
><br>
>     llvm::ArrayRef<addr_t>::iterator ai = args.begin(), ae = args.end();<br>
><br>
> -    for (size_t i = 0; i < (sizeof(reg_names) / sizeof(reg_names[0])); ++i)<br>
> +    for (size_t i = 0; i < llvm::array_lengthof(reg_names); ++i)<br>
>     {<br>
>         if (ai == ae)<br>
>             break;<br>
><br>
> Modified: lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp (original)<br>
> +++ lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -26,7 +26,7 @@<br>
> #include "lldb/Target/Target.h"<br>
> #include "lldb/Target/Thread.h"<br>
><br>
> -<br>
> +#include "llvm/ADT/STLExtras.h"<br>
> #include "llvm/ADT/Triple.h"<br>
><br>
> #include "Utility/ARM64_DWARF_Registers.h"<br>
> @@ -182,7 +182,7 @@ static RegisterInfo g_register_infos[] =<br>
>     {   "d31",     NULL,     8, 0, eEncodingIEEE754 , eFormatFloat         , { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,    LLDB_INVALID_REGNUM,        LLDB_INVALID_REGNUM,    LLDB_INVALID_REGNUM }, NULL, NULL }<br>

> };<br>
><br>
> -static const uint32_t k_num_register_infos = sizeof(g_register_infos)/sizeof(RegisterInfo);<br>
> +static const uint32_t k_num_register_infos = llvm::array_lengthof(g_register_infos);<br>
> static bool g_register_info_names_constified = false;<br>
><br>
> const lldb_private::RegisterInfo *<br>
><br>
> Modified: lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp (original)<br>
> +++ lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -199,7 +199,7 @@ static RegisterInfo g_register_infos[] =<br>
>     { "ymm7"  , NULL,   32,  0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , dwarf_ymm7          , LLDB_INVALID_REGNUM       , gdb_ymm7           , LLDB_INVALID_REGNUM },      NULL,              NULL}<br>

> };<br>
><br>
> -static const uint32_t k_num_register_infos = sizeof(g_register_infos)/sizeof(RegisterInfo);<br>
> +static const uint32_t k_num_register_infos = llvm::array_lengthof(g_register_infos);<br>
> static bool g_register_info_names_constified = false;<br>
><br>
> const lldb_private::RegisterInfo *<br>
><br>
> Modified: lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp (original)<br>
> +++ lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -28,6 +28,7 @@<br>
> #include "lldb/Target/StackFrame.h"<br>
> #include "lldb/Target/Thread.h"<br>
><br>
> +#include "llvm/ADT/STLExtras.h"<br>
> #include "llvm/ADT/Triple.h"<br>
><br>
> using namespace lldb;<br>
> @@ -251,7 +252,7 @@ static RegisterInfo g_register_infos[] =<br>
>     { "ymm15" , NULL,   32,  0, eEncodingVector, eFormatVectorOfUInt8, { gcc_dwarf_ymm15     , gcc_dwarf_ymm15     , LLDB_INVALID_REGNUM       , gdb_ymm15          , LLDB_INVALID_REGNUM },      NULL,              NULL}<br>

> };<br>
><br>
> -static const uint32_t k_num_register_infos = sizeof(g_register_infos)/sizeof(RegisterInfo);<br>
> +static const uint32_t k_num_register_infos = llvm::array_lengthof(g_register_infos);<br>
> static bool g_register_info_names_constified = false;<br>
><br>
> const lldb_private::RegisterInfo *<br>
><br>
> Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (original)<br>
> +++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -24,6 +24,7 @@<br>
> #include "Plugins/Process/Utility/ARMUtils.h"<br>
> #include "Utility/ARM_DWARF_Registers.h"<br>
><br>
> +#include "llvm/ADT/STLExtras.h"<br>
> #include "llvm/Support/MathExtras.h" // for SignExtend32 template function<br>
>                                      // and countTrailingZeros function<br>
><br>
> @@ -12506,7 +12507,7 @@ EmulateInstructionARM::GetARMOpcodeForIn<br>
>         { 0xfe500000, 0xf8100000, ARMV6_ABOVE,  eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateRFE, "rfe{<amode>} <Rn>{!}" }<br>
><br>
>     };<br>
> -    static const size_t k_num_arm_opcodes = sizeof(g_arm_opcodes)/sizeof(ARMOpcode);<br>
> +    static const size_t k_num_arm_opcodes = llvm::array_lengthof(g_arm_opcodes);<br>
><br>
>     for (size_t i=0; i<k_num_arm_opcodes; ++i)<br>
>     {<br>
> @@ -12832,7 +12833,7 @@ EmulateInstructionARM::GetThumbOpcodeFor<br>
>         { 0xfffff080, 0xfa1ff080, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, &EmulateInstructionARM::EmulateUXTH, "uxth<c>.w <Rd>,<Rm>{,<rotation>}" },<br>
>     };<br>
><br>
> -    const size_t k_num_thumb_opcodes = sizeof(g_thumb_opcodes)/sizeof(ARMOpcode);<br>
> +    const size_t k_num_thumb_opcodes = llvm::array_lengthof(g_thumb_opcodes);<br>
>     for (size_t i=0; i<k_num_thumb_opcodes; ++i)<br>
>     {<br>
>         if ((g_thumb_opcodes[i].mask & opcode) == g_thumb_opcodes[i].value &&<br>
><br>
> Modified: lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp (original)<br>
> +++ lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -22,6 +22,7 @@<br>
> #include "Plugins/Process/Utility/ARMUtils.h"<br>
> #include "Utility/ARM64_DWARF_Registers.h"<br>
><br>
> +#include "llvm/ADT/STLExtras.h"<br>
> #include "llvm/Support/MathExtras.h" // for SignExtend32 template function<br>
>                                      // and CountTrailingZeros_32 function<br>
><br>
> @@ -254,7 +255,7 @@ EmulateInstructionARM64::GetOpcodeForIns<br>
>         { 0xffc00000, 0xa9800000, No_VFP, &EmulateInstructionARM64::Emulate_ldstpair_pre, "STP  <Xt>, <Xt2>, [<Xn|SP>, #<imm>]!" },<br>
><br>
>     };<br>
> -    static const size_t k_num_arm_opcodes = sizeof(g_opcodes)/sizeof(EmulateInstructionARM64::Opcode);<br>
> +    static const size_t k_num_arm_opcodes = llvm::array_lengthof(g_opcodes);<br>
><br>
>     for (size_t i=0; i<k_num_arm_opcodes; ++i)<br>
>     {<br>
><br>
> Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)<br>
> +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -28,6 +28,7 @@<br>
> #include "lldb/Symbol/SymbolFile.h"<br>
> #include "lldb/Symbol/SymbolVendor.h"<br>
> #include "lldb/Target/Target.h"<br>
> +#include "llvm/ADT/STLExtras.h"<br>
><br>
> using namespace lldb;<br>
> using namespace lldb_private;<br>
> @@ -1327,7 +1328,7 @@ PlatformDarwin::SetThreadCreationBreakpo<br>
>     };<br>
><br>
>     FileSpecList bp_modules;<br>
> -    for (size_t i = 0; i < sizeof(g_bp_modules)/sizeof(const char *); i++)<br>
> +    for (size_t i = 0; i < llvm::array_lengthof(g_bp_modules); i++)<br>
>     {<br>
>         const char *bp_module = g_bp_modules[i];<br>
>         bp_modules.Append(FileSpec(bp_module, false));<br>
> @@ -1339,7 +1340,7 @@ PlatformDarwin::SetThreadCreationBreakpo<br>
>     bp_sp = target.CreateBreakpoint (&bp_modules,<br>
>                                      NULL,<br>
>                                      g_bp_names,<br>
> -                                     sizeof(g_bp_names)/sizeof(const char *),<br>
> +                                     llvm::array_lengthof(g_bp_names),<br>
>                                      eFunctionNameTypeFull,<br>
>                                      skip_prologue,<br>
>                                      internal,<br>
><br>
> Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp (original)<br>
> +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -37,6 +37,8 @@<br>
> #include "ARM_GCC_Registers.h"<br>
> #include "ARM_DWARF_Registers.h"<br>
><br>
> +#include "llvm/ADT/STLExtras.h"<br>
> +<br>
> using namespace lldb;<br>
> using namespace lldb_private;<br>
><br>
> @@ -399,7 +401,7 @@ g_exc_regnums[] =<br>
>     exc_far,<br>
> };<br>
><br>
> -static size_t k_num_register_infos = (sizeof(g_register_infos)/sizeof(RegisterInfo));<br>
> +static size_t k_num_register_infos = llvm::array_lengthof(g_register_infos);<br>
><br>
> void<br>
> RegisterContextDarwin_arm::InvalidateAllRegisters ()<br>
> @@ -438,9 +440,9 @@ RegisterContextDarwin_arm::GetRegisterIn<br>
><br>
><br>
> // Number of registers in each register set<br>
> -const size_t k_num_gpr_registers = sizeof(g_gpr_regnums) / sizeof(uint32_t);<br>
> -const size_t k_num_fpu_registers = sizeof(g_fpu_regnums) / sizeof(uint32_t);<br>
> -const size_t k_num_exc_registers = sizeof(g_exc_regnums) / sizeof(uint32_t);<br>
> +const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums);<br>
> +const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums);<br>
> +const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums);<br>
><br>
> //----------------------------------------------------------------------<br>
> // Register set definitions. The first definitions at register set index<br>
> @@ -454,7 +456,7 @@ static const RegisterSet g_reg_sets[] =<br>
>     { "Exception State Registers",  "exc",  k_num_exc_registers,    g_exc_regnums       }<br>
> };<br>
><br>
> -const size_t k_num_regsets = sizeof(g_reg_sets) / sizeof(RegisterSet);<br>
> +const size_t k_num_regsets = llvm::array_lengthof(g_reg_sets);<br>
><br>
><br>
> size_t<br>
><br>
> Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp (original)<br>
> +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -24,6 +24,7 @@<br>
> #include "lldb/Core/RegisterValue.h"<br>
> #include "lldb/Core/Scalar.h"<br>
> #include "lldb/Host/Endian.h"<br>
> +#include "llvm/ADT/STLExtras.h"<br>
> #include "llvm/Support/Compiler.h"<br>
><br>
> #include "Plugins/Process/Utility/InstructionUtils.h"<br>
> @@ -462,7 +463,7 @@ g_exc_regnums[] =<br>
>     exc_exception<br>
> };<br>
><br>
> -static size_t k_num_register_infos = (sizeof(g_register_infos)/sizeof(RegisterInfo));<br>
> +static size_t k_num_register_infos = llvm::array_lengthof(g_register_infos);<br>
><br>
> void<br>
> RegisterContextDarwin_arm64::InvalidateAllRegisters ()<br>
> @@ -501,9 +502,9 @@ RegisterContextDarwin_arm64::GetRegister<br>
><br>
><br>
> // Number of registers in each register set<br>
> -const size_t k_num_gpr_registers = sizeof(g_gpr_regnums) / sizeof(uint32_t);<br>
> -const size_t k_num_fpu_registers = sizeof(g_fpu_regnums) / sizeof(uint32_t);<br>
> -const size_t k_num_exc_registers = sizeof(g_exc_regnums) / sizeof(uint32_t);<br>
> +const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums);<br>
> +const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums);<br>
> +const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums);<br>
><br>
> //----------------------------------------------------------------------<br>
> // Register set definitions. The first definitions at register set index<br>
> @@ -517,7 +518,7 @@ static const RegisterSet g_reg_sets[] =<br>
>     { "Exception State Registers",  "exc",  k_num_exc_registers,    g_exc_regnums       }<br>
> };<br>
><br>
> -const size_t k_num_regsets = sizeof(g_reg_sets) / sizeof(RegisterSet);<br>
> +const size_t k_num_regsets = llvm::array_lengthof(g_reg_sets);<br>
><br>
><br>
> size_t<br>
><br>
> Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp (original)<br>
> +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -19,6 +19,7 @@<br>
> #include "lldb/Core/RegisterValue.h"<br>
> #include "lldb/Core/Scalar.h"<br>
> #include "lldb/Host/Endian.h"<br>
> +#include "llvm/ADT/STLExtras.h"<br>
> #include "llvm/Support/Compiler.h"<br>
><br>
> // Support building against older versions of LLVM, this macro was added<br>
> @@ -281,7 +282,7 @@ static RegisterInfo g_register_infos[] =<br>
>     { DEFINE_EXC(faultvaddr)        , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM   , LLDB_INVALID_REGNUM     , LLDB_INVALID_REGNUM, exc_faultvaddr },   NULL,              NULL}<br>
> };<br>
><br>
> -static size_t k_num_register_infos = (sizeof(g_register_infos)/sizeof(RegisterInfo));<br>
> +static size_t k_num_register_infos = llvm::array_lengthof(g_register_infos);<br>
><br>
> void<br>
> RegisterContextDarwin_i386::InvalidateAllRegisters ()<br>
> @@ -384,9 +385,9 @@ g_exc_regnums[] =<br>
> };<br>
><br>
> // Number of registers in each register set<br>
> -const size_t k_num_gpr_registers = sizeof(g_gpr_regnums) / sizeof(uint32_t);<br>
> -const size_t k_num_fpu_registers = sizeof(g_fpu_regnums) / sizeof(uint32_t);<br>
> -const size_t k_num_exc_registers = sizeof(g_exc_regnums) / sizeof(uint32_t);<br>
> +const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums);<br>
> +const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums);<br>
> +const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums);<br>
><br>
> //----------------------------------------------------------------------<br>
> // Register set definitions. The first definitions at register set index<br>
> @@ -400,7 +401,7 @@ static const RegisterSet g_reg_sets[] =<br>
>     { "Exception State Registers",  "exc",  k_num_exc_registers,    g_exc_regnums       }<br>
> };<br>
><br>
> -const size_t k_num_regsets = sizeof(g_reg_sets) / sizeof(RegisterSet);<br>
> +const size_t k_num_regsets = llvm::array_lengthof(g_reg_sets);<br>
><br>
><br>
> size_t<br>
><br>
> Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp (original)<br>
> +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -21,6 +21,7 @@<br>
> #include "lldb/Core/RegisterValue.h"<br>
> #include "lldb/Core/Scalar.h"<br>
> #include "lldb/Host/Endian.h"<br>
> +#include "llvm/ADT/STLExtras.h"<br>
> #include "llvm/Support/Compiler.h"<br>
><br>
> // Support building against older versions of LLVM, this macro was added<br>
> @@ -318,7 +319,7 @@ static RegisterInfo g_register_infos[] =<br>
>     { DEFINE_EXC(faultvaddr)        , { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM      , LLDB_INVALID_REGNUM, exc_faultvaddr },      NULL,              NULL}<br>
> };<br>
><br>
> -static size_t k_num_register_infos = (sizeof(g_register_infos)/sizeof(RegisterInfo));<br>
> +static size_t k_num_register_infos = llvm::array_lengthof(g_register_infos);<br>
><br>
><br>
> void<br>
> @@ -432,9 +433,9 @@ g_exc_regnums[] =<br>
> };<br>
><br>
> // Number of registers in each register set<br>
> -const size_t k_num_gpr_registers = sizeof(g_gpr_regnums) / sizeof(uint32_t);<br>
> -const size_t k_num_fpu_registers = sizeof(g_fpu_regnums) / sizeof(uint32_t);<br>
> -const size_t k_num_exc_registers = sizeof(g_exc_regnums) / sizeof(uint32_t);<br>
> +const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums);<br>
> +const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums);<br>
> +const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums);<br>
><br>
> //----------------------------------------------------------------------<br>
> // Register set definitions. The first definitions at register set index<br>
> @@ -448,7 +449,7 @@ static const RegisterSet g_reg_sets[] =<br>
>     { "Exception State Registers",  "exc",  k_num_exc_registers,    g_exc_regnums       }<br>
> };<br>
><br>
> -const size_t k_num_regsets = sizeof(g_reg_sets) / sizeof(RegisterSet);<br>
> +const size_t k_num_regsets = llvm::array_lengthof(g_reg_sets);<br>
><br>
><br>
> size_t<br>
><br>
> Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)<br>
> +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -17,6 +17,7 @@<br>
> #include <sstream><br>
><br>
> // Other libraries and framework includes<br>
> +#include "llvm/ADT/STLExtras.h"<br>
> #include "llvm/ADT/Triple.h"<br>
> #include "lldb/Interpreter/Args.h"<br>
> #include "lldb/Core/ConnectionFileDescriptor.h"<br>
> @@ -2660,8 +2661,8 @@ GDBRemoteCommunicationClient::TestPacket<br>
>     {<br>
>         static uint32_t g_send_sizes[] = { 0, 64, 128, 512, 1024 };<br>
>         static uint32_t g_recv_sizes[] = { 0, 64, 128, 512, 1024 }; //, 4*1024, 8*1024, 16*1024, 32*1024, 48*1024, 64*1024, 96*1024, 128*1024 };<br>
> -        const size_t k_num_send_sizes = sizeof(g_send_sizes)/sizeof(uint32_t);<br>
> -        const size_t k_num_recv_sizes = sizeof(g_recv_sizes)/sizeof(uint32_t);<br>
> +        const size_t k_num_send_sizes = llvm::array_lengthof(g_send_sizes);<br>
> +        const size_t k_num_recv_sizes = llvm::array_lengthof(g_recv_sizes);<br>
>         const uint64_t k_recv_amount = 4*1024*1024; // Receive 4MB<br>
>         for (uint32_t send_idx = 0; send_idx < k_num_send_sizes; ++send_idx)<br>
>         {<br>
><br>
> Modified: lldb/trunk/source/Utility/SharingPtr.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/SharingPtr.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/SharingPtr.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Utility/SharingPtr.cpp (original)<br>
> +++ lldb/trunk/source/Utility/SharingPtr.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -18,6 +18,8 @@<br>
> #include <assert.h><br>
> #include "lldb/Host/Mutex.h"<br>
><br>
> +#include "llvm/ADT/STLExtras.h"<br>
> +<br>
> #include <vector><br>
><br>
> class Backtrace<br>
> @@ -51,7 +53,7 @@ void<br>
> Backtrace::GetFrames ()<br>
> {<br>
>     void *frames[1024];<br>
> -    const int count = ::backtrace (frames, sizeof(frames)/sizeof(void*));<br>
> +    const int count = ::backtrace (frames, llvm::array_lengthof(frames));<br>
>     if (count > 2)<br>
>         m_frames.assign (frames + 2, frames + (count - 2));<br>
> }<br>
><br>
> Modified: lldb/trunk/tools/debugserver/source/DNB.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNB.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNB.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/tools/debugserver/source/DNB.cpp (original)<br>
> +++ lldb/trunk/tools/debugserver/source/DNB.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -47,6 +47,7 @@<br>
> #include "DNBTimer.h"<br>
> #include "CFBundle.h"<br>
><br>
> +#include "llvm/ADT/STLExtras.h"<br>
><br>
> typedef std::shared_ptr<MachProcess> MachProcessSP;<br>
> typedef std::map<nub_process_t, MachProcessSP> ProcessMap;<br>
> @@ -542,7 +543,7 @@ GetAllInfos (std::vector<struct kinfo_pr<br>
> {<br>
>     size_t size = 0;<br>
>     int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL };<br>
> -    u_int namelen = sizeof(name)/sizeof(int);<br>
> +    u_int namelen = llvm::array_lengthof(name);<br>
>     int err;<br>
><br>
>     // Try to find out how many processes are around so we can<br>
><br>
> Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp (original)<br>
> +++ lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -20,6 +20,8 @@<br>
> #include "DNBThreadResumeActions.h"<br>
> #include "MachProcess.h"<br>
><br>
> +#include "llvm/ADT/STLExtras.h"<br>
> +<br>
> MachThreadList::MachThreadList() :<br>
>     m_threads(),<br>
>     m_threads_mutex(PTHREAD_MUTEX_RECURSIVE),<br>
> @@ -313,7 +315,7 @@ MachThreadList::UpdateThreadList(MachPro<br>
>         int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process->ProcessID() };<br>
>         struct kinfo_proc processInfo;<br>
>         size_t bufsize = sizeof(processInfo);<br>
> -        if (sysctl(mib, (unsigned)(sizeof(mib)/sizeof(int)), &processInfo, &bufsize, NULL, 0) == 0 && bufsize > 0)<br>
> +        if (sysctl(mib, llvm::array_lengthof(mib), &processInfo, &bufsize, NULL, 0) == 0 && bufsize > 0)<br>
>         {<br>
>             if (processInfo.kp_proc.p_flag & P_LP64)<br>
>                 m_is_64_bit = true;<br>
><br>
> Modified: lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp (original)<br>
> +++ lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -23,6 +23,8 @@<br>
> #include "ARM_GCC_Registers.h"<br>
> #include "ARM_DWARF_Registers.h"<br>
><br>
> +#include "llvm/ADT/STLExtras.h"<br>
> +<br>
> #include <inttypes.h><br>
> #include <sys/sysctl.h><br>
><br>
> @@ -1555,9 +1557,9 @@ DNBArchMachARM::g_exc_registers[] =<br>
> };<br>
><br>
> // Number of registers in each register set<br>
> -const size_t DNBArchMachARM::k_num_gpr_registers = sizeof(g_gpr_registers)/sizeof(DNBRegisterInfo);<br>
> -const size_t DNBArchMachARM::k_num_vfp_registers = sizeof(g_vfp_registers)/sizeof(DNBRegisterInfo);<br>
> -const size_t DNBArchMachARM::k_num_exc_registers = sizeof(g_exc_registers)/sizeof(DNBRegisterInfo);<br>
> +const size_t DNBArchMachARM::k_num_gpr_registers = llvm::array_lengthof(g_gpr_registers);<br>
> +const size_t DNBArchMachARM::k_num_vfp_registers = llvm::array_lengthof(g_vfp_registers);<br>
> +const size_t DNBArchMachARM::k_num_exc_registers = llvm::array_lengthof(g_exc_registers);<br>
> const size_t DNBArchMachARM::k_num_all_registers = k_num_gpr_registers + k_num_vfp_registers + k_num_exc_registers;<br>
><br>
> //----------------------------------------------------------------------<br>
> @@ -1574,7 +1576,7 @@ DNBArchMachARM::g_reg_sets[] =<br>
>     { "Exception State Registers",  g_exc_registers,    k_num_exc_registers     }<br>
> };<br>
> // Total number of register sets for this architecture<br>
> -const size_t DNBArchMachARM::k_num_register_sets = sizeof(g_reg_sets)/sizeof(DNBRegisterSetInfo);<br>
> +const size_t DNBArchMachARM::k_num_register_sets = llvm::array_lengthof(g_reg_sets);<br>
><br>
><br>
> const DNBRegisterSetInfo *<br>
><br>
> Modified: lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp (original)<br>
> +++ lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -24,6 +24,8 @@<br>
> #include "DNBRegisterInfo.h"<br>
> #include "DNB.h"<br>
><br>
> +#include "llvm/ADT/STLExtras.h"<br>
> +<br>
> #include <inttypes.h><br>
> #include <sys/sysctl.h><br>
><br>
> @@ -1644,9 +1646,9 @@ DNBArchMachARM64::g_exc_registers[] =<br>
> };<br>
><br>
> // Number of registers in each register set<br>
> -const size_t DNBArchMachARM64::k_num_gpr_registers = sizeof(g_gpr_registers)/sizeof(DNBRegisterInfo);<br>
> -const size_t DNBArchMachARM64::k_num_vfp_registers = sizeof(g_vfp_registers)/sizeof(DNBRegisterInfo);<br>
> -const size_t DNBArchMachARM64::k_num_exc_registers = sizeof(g_exc_registers)/sizeof(DNBRegisterInfo);<br>
> +const size_t DNBArchMachARM64::k_num_gpr_registers = llvm::array_lengthof(g_gpr_registers);<br>
> +const size_t DNBArchMachARM64::k_num_vfp_registers = llvm::array_lengthof(g_vfp_registers);<br>
> +const size_t DNBArchMachARM64::k_num_exc_registers = llvm::array_lengthof(g_exc_registers);<br>
> const size_t DNBArchMachARM64::k_num_all_registers = k_num_gpr_registers + k_num_vfp_registers + k_num_exc_registers;<br>
><br>
> //----------------------------------------------------------------------<br>
> @@ -1663,7 +1665,7 @@ DNBArchMachARM64::g_reg_sets[] =<br>
>     { "Exception State Registers",  g_exc_registers,    k_num_exc_registers     }<br>
> };<br>
> // Total number of register sets for this architecture<br>
> -const size_t DNBArchMachARM64::k_num_register_sets = sizeof(g_reg_sets)/sizeof(DNBRegisterSetInfo);<br>
> +const size_t DNBArchMachARM64::k_num_register_sets = llvm::array_lengthof(g_reg_sets);<br>
><br>
><br>
> const DNBRegisterSetInfo *<br>
><br>
> Modified: lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp (original)<br>
> +++ lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -20,6 +20,8 @@<br>
> #include "MachThread.h"<br>
> #include "MachProcess.h"<br>
><br>
> +#include "llvm/ADT/STLExtras.h"<br>
> +<br>
> extern "C" bool CPUHasAVX(); // Defined over in DNBArchImplX86_64.cpp<br>
><br>
> #if defined (LLDB_DEBUGSERVER_RELEASE) || defined (LLDB_DEBUGSERVER_DEBUG)<br>
> @@ -1201,10 +1203,10 @@ DNBArchImplI386::g_exc_registers[] =<br>
> };<br>
><br>
> // Number of registers in each register set<br>
> -const size_t DNBArchImplI386::k_num_gpr_registers = sizeof(g_gpr_registers)/sizeof(DNBRegisterInfo);<br>
> -const size_t DNBArchImplI386::k_num_fpu_registers_no_avx = sizeof(g_fpu_registers_no_avx)/sizeof(DNBRegisterInfo);<br>
> -const size_t DNBArchImplI386::k_num_fpu_registers_avx = sizeof(g_fpu_registers_avx)/sizeof(DNBRegisterInfo);<br>
> -const size_t DNBArchImplI386::k_num_exc_registers = sizeof(g_exc_registers)/sizeof(DNBRegisterInfo);<br>
> +const size_t DNBArchImplI386::k_num_gpr_registers = llvm::array_lengthof(g_gpr_registers);<br>
> +const size_t DNBArchImplI386::k_num_fpu_registers_no_avx = llvm::array_lengthof(g_fpu_registers_no_avx);<br>
> +const size_t DNBArchImplI386::k_num_fpu_registers_avx = llvm::array_lengthof(g_fpu_registers_avx);<br>
> +const size_t DNBArchImplI386::k_num_exc_registers = llvm::array_lengthof(g_exc_registers);<br>
> const size_t DNBArchImplI386::k_num_all_registers_no_avx = k_num_gpr_registers + k_num_fpu_registers_no_avx + k_num_exc_registers;<br>
> const size_t DNBArchImplI386::k_num_all_registers_avx = k_num_gpr_registers + k_num_fpu_registers_avx + k_num_exc_registers;<br>
><br>
> @@ -1232,7 +1234,7 @@ DNBArchImplI386::g_reg_sets_avx[] =<br>
> };<br>
><br>
> // Total number of register sets for this architecture<br>
> -const size_t DNBArchImplI386::k_num_register_sets = sizeof(g_reg_sets_no_avx)/sizeof(DNBRegisterSetInfo);<br>
> +const size_t DNBArchImplI386::k_num_register_sets = llvm::array_lengthof(g_reg_sets_no_avx);<br>
><br>
> DNBArchProtocol *<br>
> DNBArchImplI386::Create (MachThread *thread)<br>
><br>
> Modified: lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp (original)<br>
> +++ lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -25,6 +25,8 @@<br>
> #include "DNBLog.h"<br>
> #include "DNBRegisterInfo.h"<br>
><br>
> +#include "llvm/ADT/STLExtras.h"<br>
> +<br>
> static const uint8_t g_breakpoint_opcode[] = { 0x7F, 0xC0, 0x00, 0x08 };<br>
><br>
> const uint8_t * const<br>
> @@ -386,10 +388,10 @@ static DNBRegisterInfo g_vec_registers[]<br>
> };<br>
><br>
> // Number of registers in each register set<br>
> -const size_t k_num_gpr_registers = sizeof(g_gpr_registers)/sizeof(DNBRegisterInfo);<br>
> -const size_t k_num_fpr_registers = sizeof(g_fpr_registers)/sizeof(DNBRegisterInfo);<br>
> -const size_t k_num_exc_registers = sizeof(g_exc_registers)/sizeof(DNBRegisterInfo);<br>
> -const size_t k_num_vec_registers = sizeof(g_vec_registers)/sizeof(DNBRegisterInfo);<br>
> +const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_registers);<br>
> +const size_t k_num_fpr_registers = llvm::array_lengthof(g_fpr_registers);<br>
> +const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_registers);<br>
> +const size_t k_num_vec_registers = llvm::array_lengthof(g_vec_registers);<br>
> // Total number of registers for this architecture<br>
> const size_t k_num_ppc_registers = k_num_gpr_registers + k_num_fpr_registers + k_num_exc_registers + k_num_vec_registers;<br>
><br>
> @@ -407,7 +409,7 @@ static const DNBRegisterSetInfo g_reg_se<br>
>     { "Altivec Registers",            g_vec_registers, k_num_vec_registers }<br>
> };<br>
> // Total number of register sets for this architecture<br>
> -const size_t k_num_register_sets = sizeof(g_reg_sets)/sizeof(DNBRegisterSetInfo);<br>
> +const size_t k_num_register_sets = llvm::array_lengthof(g_reg_sets);<br>
><br>
><br>
> const DNBRegisterSetInfo *<br>
><br>
> Modified: lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp (original)<br>
> +++ lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -13,6 +13,8 @@<br>
><br>
> #if defined (__i386__) || defined (__x86_64__)<br>
><br>
> +#include "llvm/ADT/STLExtras.h"<br>
> +<br>
> #include <sys/cdefs.h><br>
> #include <sys/types.h><br>
> #include <sys/sysctl.h><br>
> @@ -1525,10 +1527,10 @@ DNBArchImplX86_64::g_exc_registers[] =<br>
> };<br>
><br>
> // Number of registers in each register set<br>
> -const size_t DNBArchImplX86_64::k_num_gpr_registers = sizeof(g_gpr_registers)/sizeof(DNBRegisterInfo);<br>
> -const size_t DNBArchImplX86_64::k_num_fpu_registers_no_avx = sizeof(g_fpu_registers_no_avx)/sizeof(DNBRegisterInfo);<br>
> -const size_t DNBArchImplX86_64::k_num_fpu_registers_avx = sizeof(g_fpu_registers_avx)/sizeof(DNBRegisterInfo);<br>
> -const size_t DNBArchImplX86_64::k_num_exc_registers = sizeof(g_exc_registers)/sizeof(DNBRegisterInfo);<br>
> +const size_t DNBArchImplX86_64::k_num_gpr_registers = llvm::array_lengthof(g_gpr_registers);<br>
> +const size_t DNBArchImplX86_64::k_num_fpu_registers_no_avx = llvm::array_lengthof(g_fpu_registers_no_avx);<br>
> +const size_t DNBArchImplX86_64::k_num_fpu_registers_avx = llvm::array_lengthof(g_fpu_registers_avx);<br>
> +const size_t DNBArchImplX86_64::k_num_exc_registers = llvm::array_lengthof(g_exc_registers);<br>
> const size_t DNBArchImplX86_64::k_num_all_registers_no_avx = k_num_gpr_registers + k_num_fpu_registers_no_avx + k_num_exc_registers;<br>
> const size_t DNBArchImplX86_64::k_num_all_registers_avx = k_num_gpr_registers + k_num_fpu_registers_avx + k_num_exc_registers;<br>
><br>
> @@ -1556,7 +1558,7 @@ DNBArchImplX86_64::g_reg_sets_avx[] =<br>
> };<br>
><br>
> // Total number of register sets for this architecture<br>
> -const size_t DNBArchImplX86_64::k_num_register_sets = sizeof(g_reg_sets_avx)/sizeof(DNBRegisterSetInfo);<br>
> +const size_t DNBArchImplX86_64::k_num_register_sets = llvm::array_lengthof(g_reg_sets_avx);<br>
><br>
><br>
> DNBArchProtocol *<br>
><br>
> Modified: lldb/trunk/tools/debugserver/source/TTYState.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/TTYState.h?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/TTYState.h?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/tools/debugserver/source/TTYState.h (original)<br>
> +++ lldb/trunk/tools/debugserver/source/TTYState.h Fri Jun 27 00:17:41 2014<br>
> @@ -17,6 +17,8 @@<br>
> #include <termios.h><br>
> #include <stdint.h><br>
><br>
> +#include "llvm/ADT/STLExtras.h"<br>
> +<br>
> class TTYState<br>
> {<br>
> public:<br>
> @@ -50,7 +52,7 @@ public:<br>
><br>
>     bool GetState(uint32_t idx, int fd, bool saveProcessGroup);<br>
>     bool SetState(uint32_t idx) const;<br>
> -    uint32_t NumStates() const { return sizeof(m_ttystates)/sizeof(TTYState); }<br>
> +    uint32_t NumStates() const { return llvm::array_lengthof(m_ttystates); }<br>
>     bool ValidStateIndex(uint32_t idx) const { return idx < NumStates(); }<br>
><br>
> protected:<br>
> @@ -58,4 +60,4 @@ protected:<br>
>     TTYState            m_ttystates[2];<br>
> };<br>
><br>
> -#endif<br>
> \ No newline at end of file<br>
> +#endif<br>
><br>
> Modified: lldb/trunk/tools/lldb-perf/common/clang/lldb_perf_clang.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-perf/common/clang/lldb_perf_clang.cpp?rev=211868&r1=211867&r2=211868&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-perf/common/clang/lldb_perf_clang.cpp?rev=211868&r1=211867&r2=211868&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/tools/lldb-perf/common/clang/lldb_perf_clang.cpp (original)<br>
> +++ lldb/trunk/tools/lldb-perf/common/clang/lldb_perf_clang.cpp Fri Jun 27 00:17:41 2014<br>
> @@ -13,6 +13,7 @@<br>
> #include "lldb-perf/lib/Results.h"<br>
> #include "lldb-perf/lib/TestCase.h"<br>
> #include "lldb-perf/lib/Xcode.h"<br>
> +#include "llvm/ADT/STLExtras.h"<br>
> #include <iostream><br>
> #include <unistd.h><br>
> #include <fstream><br>
> @@ -179,7 +180,7 @@ int main (int argc, char const *argv[],<br>
>                         "-x", "c++",<br>
>                         NULL,<br>
>                         NULL };<br>
> -                    clang_argv[sizeof(clang_argv)/sizeof(const char *)-2] = temp_source_path;<br>
> +                    clang_argv[llvm::array_lengthof(clang_argv)-2] = temp_source_path;<br>
>                     SBLaunchInfo launch_info(clang_argv);<br>
>                     Launch (launch_info);<br>
>                     next_action.None(); // Don't continue or do anything, just wait for next event...<br>
><br>
><br>
> _______________________________________________<br>
> lldb-commits mailing list<br>
> <a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org
</div></div>