diff --git a/lldb/source/Expression/IRExecutionUnit.cpp b/lldb/source/Expression/IRExecutionUnit.cpp index 15c2a7d83eb1..37bc4cb371c4 100644 --- a/lldb/source/Expression/IRExecutionUnit.cpp +++ b/lldb/source/Expression/IRExecutionUnit.cpp @@ -1023,7 +1023,7 @@ IRExecutionUnit::MemoryManager::getSymbolAddress(const std::string &Name) { void *IRExecutionUnit::MemoryManager::getPointerToNamedFunction( const std::string &Name, bool AbortOnFailure) { - assert(sizeof(void *) == 8); + static_assert(sizeof(void *) == 8, ""); return (void *)getSymbolAddress(Name); } diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp index 841c34b7ce7d..8e493c7a326f 100644 --- a/lldb/source/Interpreter/CommandObject.cpp +++ b/lldb/source/Interpreter/CommandObject.cpp @@ -1103,7 +1103,8 @@ CommandObject::ArgumentTableEntry CommandObject::g_arguments_data[] = { const CommandObject::ArgumentTableEntry *CommandObject::GetArgumentTable() { // If this assertion fires, then the table above is out of date with the // CommandArgumentType enumeration - assert((sizeof(CommandObject::g_arguments_data) / - sizeof(CommandObject::ArgumentTableEntry)) == eArgTypeLastArg); + static_assert((sizeof(CommandObject::g_arguments_data) / + sizeof(CommandObject::ArgumentTableEntry)) == eArgTypeLastArg, + ""); return CommandObject::g_arguments_data; } diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp index 0ea4d91f8f79..65bac166ffc3 100644 --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -1972,8 +1972,8 @@ bool RenderScriptRuntime::JITTypePacked(AllocationDetails *alloc, // We want 4 elements from packed data const uint32_t num_exprs = 4; - assert(num_exprs == (eExprTypeElemPtr - eExprTypeDimX + 1) && - "Invalid number of expressions"); + static_assert(num_exprs == (eExprTypeElemPtr - eExprTypeDimX + 1), + "Invalid number of expressions"); char expr_bufs[num_exprs][jit_max_expr_size]; uint64_t results[num_exprs]; @@ -2031,8 +2031,8 @@ bool RenderScriptRuntime::JITElementPacked(Element &elem, // We want 4 elements from packed data const uint32_t num_exprs = 4; - assert(num_exprs == (eExprElementFieldCount - eExprElementType + 1) && - "Invalid number of expressions"); + static_assert(num_exprs == (eExprElementFieldCount - eExprElementType + 1), + "Invalid number of expressions"); char expr_bufs[num_exprs][jit_max_expr_size]; uint64_t results[num_exprs]; @@ -2090,8 +2090,8 @@ bool RenderScriptRuntime::JITSubelements(Element &elem, } const short num_exprs = 3; - assert(num_exprs == (eExprSubelementsArrSize - eExprSubelementsId + 1) && - "Invalid number of expressions"); + static_assert(num_exprs == (eExprSubelementsArrSize - eExprSubelementsId + 1), + "Invalid number of expressions"); char expr_buffer[jit_max_expr_size]; uint64_t results; diff --git a/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_ARM64.cpp b/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_ARM64.cpp index 3fdaaadf77ef..bbd0e14a3267 100644 --- a/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_ARM64.cpp +++ b/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_ARM64.cpp @@ -782,7 +782,7 @@ RegisterContextMinidump_ARM64::RegisterContextMinidump_ARM64( auto regs_data = data.GetData(&offset, sizeof(m_regs.v)); if (regs_data) memcpy(m_regs.v, regs_data, sizeof(m_regs.v)); - assert(k_num_regs == k_num_reg_infos); + static_assert(k_num_regs == k_num_reg_infos, ""); } size_t RegisterContextMinidump_ARM64::GetRegisterCount() { return k_num_regs; } diff --git a/lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp b/lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp index 1d6f4c7f9df4..6cb342922525 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp +++ b/lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp @@ -122,7 +122,7 @@ bool MachVMRegion::GetRegionForAddress(nub_addr_t addr) { m_start = addr; m_depth = 1024; mach_msg_type_number_t info_size = kRegionInfoSize; - assert(sizeof(info_size) == 4); + static_assert(sizeof(info_size) == 4, ""); m_err = ::mach_vm_region_recurse(m_task, &m_start, &m_size, &m_depth, (vm_region_recurse_info_t)&m_data, &info_size);