summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/Core/MappedHash.h3
-rw-r--r--lldb/source/Core/DataEncoder.cpp3
-rw-r--r--lldb/source/Core/ValueObjectMemory.cpp3
-rw-r--r--lldb/source/Expression/IRInterpreter.cpp36
-rw-r--r--lldb/source/Host/windows/EditLineWin.cpp14
-rw-r--r--lldb/source/Interpreter/OptionValueProperties.cpp3
-rw-r--r--lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp4
-rw-r--r--lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp3
-rw-r--r--lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp3
-rw-r--r--lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp2
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp12
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp5
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp7
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp3
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp7
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp3
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp3
-rw-r--r--lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp17
-rw-r--r--lldb/source/Symbol/ClangASTContext.cpp5
-rw-r--r--lldb/source/Symbol/Type.cpp6
-rw-r--r--lldb/source/Target/ABI.cpp3
-rw-r--r--lldb/source/Target/Platform.cpp5
-rw-r--r--lldb/source/Target/StackFrameList.cpp3
-rw-r--r--lldb/tools/debugserver/source/DNBDataRef.cpp15
-rw-r--r--lldb/tools/driver/Platform.cpp9
-rw-r--r--lldb/tools/lldb-perf/lib/Results.cpp6
26 files changed, 67 insertions, 116 deletions
diff --git a/lldb/include/lldb/Core/MappedHash.h b/lldb/include/lldb/Core/MappedHash.h
index 44fe6321616..842a116d07a 100644
--- a/lldb/include/lldb/Core/MappedHash.h
+++ b/lldb/include/lldb/Core/MappedHash.h
@@ -52,8 +52,7 @@ public:
default:
break;
}
- assert(!"Invalid hash function index");
- return 0;
+ llvm_unreachable("Invalid hash function index");
}
static const uint32_t HASH_MAGIC = 0x48415348u;
diff --git a/lldb/source/Core/DataEncoder.cpp b/lldb/source/Core/DataEncoder.cpp
index dd6adc0a868..33404365157 100644
--- a/lldb/source/Core/DataEncoder.cpp
+++ b/lldb/source/Core/DataEncoder.cpp
@@ -258,8 +258,7 @@ uint32_t DataEncoder::PutMaxU64(uint32_t offset, uint32_t byte_size,
case 8:
return PutU64(offset, value);
default:
- assert(!"GetMax64 unhandled case!");
- break;
+ llvm_unreachable("GetMax64 unhandled case!");
}
return UINT32_MAX;
}
diff --git a/lldb/source/Core/ValueObjectMemory.cpp b/lldb/source/Core/ValueObjectMemory.cpp
index 86747b84522..18f3c94c522 100644
--- a/lldb/source/Core/ValueObjectMemory.cpp
+++ b/lldb/source/Core/ValueObjectMemory.cpp
@@ -165,8 +165,7 @@ bool ValueObjectMemory::UpdateValue() {
switch (value_type) {
default:
- assert(!"Unhandled expression result value kind...");
- break;
+ llvm_unreachable("Unhandled expression result value kind...");
case Value::eValueTypeScalar:
// The variable value is in the Scalar value inside the m_value.
diff --git a/lldb/source/Expression/IRInterpreter.cpp b/lldb/source/Expression/IRInterpreter.cpp
index ef96b85971b..e5705984eb8 100644
--- a/lldb/source/Expression/IRInterpreter.cpp
+++ b/lldb/source/Expression/IRInterpreter.cpp
@@ -1602,25 +1602,23 @@ bool IRInterpreter::Interpret(llvm::Module &module, llvm::Function &function,
lldb::addr_t addr = tmp_op.ULongLong();
size_t dataSize = 0;
- if (execution_unit.GetAllocSize(addr, dataSize)) {
- // Create the required buffer
- rawArgs[i].size = dataSize;
- rawArgs[i].data_ap.reset(new uint8_t[dataSize + 1]);
-
- // Read string from host memory
- execution_unit.ReadMemory(rawArgs[i].data_ap.get(), addr, dataSize,
- error);
- if (error.Fail()) {
- assert(!"we have failed to read the string from memory");
- return false;
- }
- // Add null terminator
- rawArgs[i].data_ap[dataSize] = '\0';
- rawArgs[i].type = lldb_private::ABI::CallArgument::HostPointer;
- } else {
- assert(!"unable to locate host data for transfer to device");
- return false;
- }
+ bool Success = execution_unit.GetAllocSize(addr, dataSize);
+ (void)Success;
+ assert(Success &&
+ "unable to locate host data for transfer to device");
+ // Create the required buffer
+ rawArgs[i].size = dataSize;
+ rawArgs[i].data_ap.reset(new uint8_t[dataSize + 1]);
+
+ // Read string from host memory
+ execution_unit.ReadMemory(rawArgs[i].data_ap.get(), addr, dataSize,
+ error);
+ assert(!error.Fail() &&
+ "we have failed to read the string from memory");
+
+ // Add null terminator
+ rawArgs[i].data_ap[dataSize] = '\0';
+ rawArgs[i].type = lldb_private::ABI::CallArgument::HostPointer;
} else /* if ( arg_ty->isPointerTy() ) */
{
rawArgs[i].type = lldb_private::ABI::CallArgument::TargetValue;
diff --git a/lldb/source/Host/windows/EditLineWin.cpp b/lldb/source/Host/windows/EditLineWin.cpp
index 124104b0006..b7b7b666dcd 100644
--- a/lldb/source/Host/windows/EditLineWin.cpp
+++ b/lldb/source/Host/windows/EditLineWin.cpp
@@ -285,11 +285,10 @@ void el_end(EditLine *el) {
// assert( !"Not implemented!" );
}
-void el_reset(EditLine *) { assert(!"Not implemented!"); }
+void el_reset(EditLine *) { llvm_unreachable("Not implemented!"); }
int el_getc(EditLine *, char *) {
- assert(!"Not implemented!");
- return 0;
+ llvm_unreachable("Not implemented!");
}
void el_push(EditLine *, const char *) {}
@@ -297,8 +296,7 @@ void el_push(EditLine *, const char *) {}
void el_beep(EditLine *) { Beep(1000, 500); }
int el_parse(EditLine *, int, const char **) {
- assert(!"Not implemented!");
- return 0;
+ llvm_unreachable("Not implemented!");
}
int el_get(EditLine *el, int code, ...) {
@@ -311,7 +309,7 @@ int el_get(EditLine *el, int code, ...) {
*dout = clientData;
} break;
default:
- assert(!"Not implemented!");
+ llvm_unreachable("Not implemented!");
}
return 0;
}
@@ -322,7 +320,7 @@ int el_source(EditLine *el, const char *file) {
return 0;
}
-void el_resize(EditLine *) { assert(!"Not implemented!"); }
+void el_resize(EditLine *) { llvm_unreachable("Not implemented!"); }
const LineInfo *el_line(EditLine *el) { return 0; }
@@ -331,7 +329,7 @@ int el_insertstr(EditLine *, const char *) {
return 0;
}
-void el_deletestr(EditLine *, int) { assert(!"Not implemented!"); }
+void el_deletestr(EditLine *, int) { llvm_unreachable("Not implemented!"); }
History *history_init(void) {
// return dummy handle
diff --git a/lldb/source/Interpreter/OptionValueProperties.cpp b/lldb/source/Interpreter/OptionValueProperties.cpp
index 9a621bea835..7e4df3a3e1d 100644
--- a/lldb/source/Interpreter/OptionValueProperties.cpp
+++ b/lldb/source/Interpreter/OptionValueProperties.cpp
@@ -584,8 +584,7 @@ Error OptionValueProperties::DumpPropertyValue(const ExecutionContext *exe_ctx,
}
lldb::OptionValueSP OptionValueProperties::DeepCopy() const {
- assert(!"this shouldn't happen");
- return lldb::OptionValueSP();
+ llvm_unreachable("this shouldn't happen");
}
const Property *OptionValueProperties::GetPropertyAtPath(
diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
index ba531b2e3f2..aaca0458267 100644
--- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
@@ -196,8 +196,8 @@ bool fixupX86StructRetCalls(llvm::Module &module) {
llvm::AllocaInst *new_func_ptr =
new llvm::AllocaInst(new_func_ptr_type, "new_func_ptr", call_inst);
// store the new_func_cast to the newly allocated space
- (void)new llvm::StoreInst(new_func_cast, new_func_ptr,
- "new_func_ptr_load_cast", call_inst);
+ (new llvm::StoreInst(new_func_cast, new_func_ptr, call_inst))
+ ->setName("new_func_ptr_load_cast");
// load the new function address ready for a jump
llvm::LoadInst *new_func_addr_load =
new llvm::LoadInst(new_func_ptr, "load_func_pointer", call_inst);
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
index dae33f6257d..a757bba70d1 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
@@ -480,8 +480,7 @@ Error ProcessKDP::DoResume() {
default:
// The only valid thread resume states are listed above
- assert(!"invalid thread resume state");
- break;
+ llvm_unreachable("invalid thread resume state");
}
}
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
index 273e1966f3f..9f594f35d70 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
@@ -116,8 +116,7 @@ ThreadKDP::CreateRegisterContextForFrame(StackFrame *frame) {
new RegisterContextKDP_x86_64(*this, concrete_frame_idx));
break;
default:
- assert(!"Add CPU type support in KDP");
- break;
+ llvm_unreachable("Add CPU type support in KDP");
}
}
} else {
diff --git a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
index 7c8c26047f8..75f7251fb10 100644
--- a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
+++ b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
@@ -167,7 +167,7 @@ DynamicRegisterInfo::SetRegisterInfo(const StructuredData::Dictionary &dict,
reg_info.byte_offset =
containing_reg_info->byte_offset + msbyte;
} else {
- assert(!"Invalid byte order");
+ llvm_unreachable("Invalid byte order");
}
} else {
if (msbit > max_bit)
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
index 3c33ddb335d..ba84c40e976 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
@@ -1053,8 +1053,7 @@ bool RegisterContextLLDB::ReadRegisterValueFromRegisterLocation(
case UnwindLLDB::RegisterLocation::eRegisterNotSaved:
break;
case UnwindLLDB::RegisterLocation::eRegisterSavedAtHostMemoryLocation:
- assert("FIXME debugger inferior function call unwind");
- break;
+ llvm_unreachable("FIXME debugger inferior function call unwind");
case UnwindLLDB::RegisterLocation::eRegisterSavedAtMemoryLocation: {
Error error(ReadRegisterValueFromMemory(
reg_info, regloc.location.target_memory_location, reg_info->byte_size,
@@ -1062,8 +1061,7 @@ bool RegisterContextLLDB::ReadRegisterValueFromRegisterLocation(
success = error.Success();
} break;
default:
- assert("Unknown RegisterLocation type.");
- break;
+ llvm_unreachable("Unknown RegisterLocation type.");
}
return success;
}
@@ -1097,8 +1095,7 @@ bool RegisterContextLLDB::WriteRegisterValueToRegisterLocation(
case UnwindLLDB::RegisterLocation::eRegisterNotSaved:
break;
case UnwindLLDB::RegisterLocation::eRegisterSavedAtHostMemoryLocation:
- assert("FIXME debugger inferior function call unwind");
- break;
+ llvm_unreachable("FIXME debugger inferior function call unwind");
case UnwindLLDB::RegisterLocation::eRegisterSavedAtMemoryLocation: {
Error error(WriteRegisterValueToMemory(
reg_info, regloc.location.target_memory_location, reg_info->byte_size,
@@ -1106,8 +1103,7 @@ bool RegisterContextLLDB::WriteRegisterValueToRegisterLocation(
success = error.Success();
} break;
default:
- assert("Unknown RegisterLocation type.");
- break;
+ llvm_unreachable("Unknown RegisterLocation type.");
}
return success;
}
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 55551b267e8..b70f0903dbd 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -2599,10 +2599,7 @@ size_t GDBRemoteCommunicationClient::GetCurrentThreadIDs(
thread_ids.push_back(1);
}
} else {
-#if defined(LLDB_CONFIGURATION_DEBUG)
-// assert(!"ProcessGDBRemote::UpdateThreadList() failed due to not getting the
-// sequence mutex");
-#else
+#if !defined(LLDB_CONFIGURATION_DEBUG)
Log *log(ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_PROCESS |
GDBR_LOG_PACKETS));
if (log)
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 3747b2b86d5..b9e915d6bfe 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -1599,12 +1599,7 @@ StructuredData::ArraySP ScriptInterpreterPython::OSPlugin_ThreadsInfo(
// as the underlying typedef for uint* types, size_t, off_t and other values
// change.
-template <typename T> const char *GetPythonValueFormatString(T t) {
- assert(!"Unhandled type passed to GetPythonValueFormatString(T), make a "
- "specialization of GetPythonValueFormatString() to support this "
- "type.");
- return nullptr;
-}
+template <typename T> const char *GetPythonValueFormatString(T t) = delete;
template <> const char *GetPythonValueFormatString(char *) { return "s"; }
template <> const char *GetPythonValueFormatString(char) { return "b"; }
template <> const char *GetPythonValueFormatString(unsigned char) {
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
index 78fe571c50c..ef356685529 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
@@ -65,8 +65,7 @@ bool DWARFDebugRanges::Extract(SymbolFileDWARF *dwarf2Data,
break;
default:
- assert(!"DWARFRangeList::Extract() unsupported address size.");
- break;
+ llvm_unreachable("DWARFRangeList::Extract() unsupported address size.");
}
// Filter out empty ranges
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
index ad18c56b330..39c52a8a5e5 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
@@ -734,12 +734,11 @@ int DWARFFormValue::Compare(const DWARFFormValue &a_value,
}
case DW_FORM_indirect:
- assert(!"This shouldn't happen after the form has been extracted...");
- break;
+ llvm_unreachable(
+ "This shouldn't happen after the form has been extracted...");
default:
- assert(!"Unhandled DW_FORM");
- break;
+ llvm_unreachable("Unhandled DW_FORM");
}
return -1;
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp b/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
index afdb1d6afed..cb1e5c18561 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
@@ -167,8 +167,7 @@ void DWARFMappedHash::Prologue::AppendAtom(AtomType type, dw_form_t form) {
case DW_FORM_exprloc:
case DW_FORM_flag_present:
case DW_FORM_ref_sig8:
- assert(!"Unhandled atom form");
- break;
+ llvm_unreachable("Unhandled atom form");
case DW_FORM_string:
case DW_FORM_block:
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index 567ac88fdf0..16bb578e99c 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -1253,8 +1253,7 @@ SymbolFileDWARFDebugMap::GetCompileUnit(SymbolFileDWARF *oso_dwarf) {
}
}
}
- assert(!"this shouldn't happen");
- return lldb::CompUnitSP();
+ llvm_unreachable("this shouldn't happen");
}
SymbolFileDWARFDebugMap::CompileUnitInfo *
diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
index 0852f192203..be770a38fba 100644
--- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
+++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
@@ -442,15 +442,14 @@ size_t UnwindAssemblyInstEmulation::WriteMemory(
case EmulateInstruction::eContextPushRegisterOnStack: {
uint32_t reg_num = LLDB_INVALID_REGNUM;
uint32_t generic_regnum = LLDB_INVALID_REGNUM;
- if (context.info_type ==
- EmulateInstruction::eInfoTypeRegisterToRegisterPlusOffset) {
- const uint32_t unwind_reg_kind = m_unwind_plan_ptr->GetRegisterKind();
- reg_num = context.info.RegisterToRegisterPlusOffset.data_reg
- .kinds[unwind_reg_kind];
- generic_regnum = context.info.RegisterToRegisterPlusOffset.data_reg
- .kinds[eRegisterKindGeneric];
- } else
- assert(!"unhandled case, add code to handle this!");
+ assert(context.info_type ==
+ EmulateInstruction::eInfoTypeRegisterToRegisterPlusOffset &&
+ "unhandled case, add code to handle this!");
+ const uint32_t unwind_reg_kind = m_unwind_plan_ptr->GetRegisterKind();
+ reg_num = context.info.RegisterToRegisterPlusOffset.data_reg
+ .kinds[unwind_reg_kind];
+ generic_regnum = context.info.RegisterToRegisterPlusOffset.data_reg
+ .kinds[eRegisterKindGeneric];
if (reg_num != LLDB_INVALID_REGNUM &&
generic_regnum != LLDB_REGNUM_GENERIC_SP) {
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index e5fb9dc1ef2..3c817a409b0 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -390,7 +390,7 @@ static void ParseLangArgs(LangOptions &Opts, InputKind IK, const char *triple) {
case IK_AST:
case IK_LLVM_IR:
case IK_RenderScript:
- assert(!"Invalid input kind!");
+ llvm_unreachable("Invalid input kind!");
case IK_OpenCL:
LangStd = LangStandard::lang_opencl;
break;
@@ -7568,8 +7568,7 @@ ClangASTContext::GetTemplateArgument(lldb::opaque_compiler_type_t type,
return CompilerType();
default:
- assert(!"Unhandled clang::TemplateArgument::ArgKind");
- break;
+ llvm_unreachable("Unhandled clang::TemplateArgument::ArgKind");
}
}
}
diff --git a/lldb/source/Symbol/Type.cpp b/lldb/source/Symbol/Type.cpp
index 2374a6d2b20..2df193fa45e 100644
--- a/lldb/source/Symbol/Type.cpp
+++ b/lldb/source/Symbol/Type.cpp
@@ -484,8 +484,7 @@ bool Type::ResolveClangType(ResolveState compiler_type_resolve_state) {
break;
default:
- assert(!"Unhandled encoding_data_type.");
- break;
+ llvm_unreachable("Unhandled encoding_data_type.");
}
} else {
// We have no encoding type, return void?
@@ -529,8 +528,7 @@ bool Type::ResolveClangType(ResolveState compiler_type_resolve_state) {
break;
default:
- assert(!"Unhandled encoding_data_type.");
- break;
+ llvm_unreachable("Unhandled encoding_data_type.");
}
}
diff --git a/lldb/source/Target/ABI.cpp b/lldb/source/Target/ABI.cpp
index de4f685eb1c..87363a3b8ae 100644
--- a/lldb/source/Target/ABI.cpp
+++ b/lldb/source/Target/ABI.cpp
@@ -189,8 +189,7 @@ bool ABI::PrepareTrivialCall(Thread &thread, lldb::addr_t sp,
lldb::addr_t returnAddress, llvm::Type &returntype,
llvm::ArrayRef<ABI::CallArgument> args) const {
// dummy prepare trivial call
- assert(!"Should never get here!");
- return false;
+ llvm_unreachable("Should never get here!");
}
bool ABI::GetFallbackRegisterLocation(
diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp
index 43371ec2361..d8db53663f1 100644
--- a/lldb/source/Target/Platform.cpp
+++ b/lldb/source/Target/Platform.cpp
@@ -1876,9 +1876,8 @@ size_t Platform::GetSoftwareBreakpointTrapOpcode(Target &target,
} break;
default:
- assert(
- !"Unhandled architecture in Platform::GetSoftwareBreakpointTrapOpcode");
- break;
+ llvm_unreachable(
+ "Unhandled architecture in Platform::GetSoftwareBreakpointTrapOpcode");
}
assert(bp_site);
diff --git a/lldb/source/Target/StackFrameList.cpp b/lldb/source/Target/StackFrameList.cpp
index 872e153ddb0..146b2b05dbd 100644
--- a/lldb/source/Target/StackFrameList.cpp
+++ b/lldb/source/Target/StackFrameList.cpp
@@ -541,8 +541,7 @@ StackFrameSP StackFrameList::GetFrameAtIndex(uint32_t idx) {
if (m_frames.empty()) {
// Why do we have a thread with zero frames, that should not ever
// happen...
- if (m_thread.IsValid())
- assert("A valid thread has no frames.");
+ assert(!m_thread.IsValid() && "A valid thread has no frames.");
} else {
ResetCurrentInlinedDepth();
frame_sp = m_frames[original_idx];
diff --git a/lldb/tools/debugserver/source/DNBDataRef.cpp b/lldb/tools/debugserver/source/DNBDataRef.cpp
index d7dce1ab733..95b85f3d7f5 100644
--- a/lldb/tools/debugserver/source/DNBDataRef.cpp
+++ b/lldb/tools/debugserver/source/DNBDataRef.cpp
@@ -115,18 +115,13 @@ uint32_t DNBDataRef::GetMax32(offset_t *offset_ptr, uint32_t byte_size) const {
switch (byte_size) {
case 1:
return Get8(offset_ptr);
- break;
case 2:
return Get16(offset_ptr);
- break;
case 4:
return Get32(offset_ptr);
- break;
default:
- assert(!"GetMax32 unhandled case!");
- break;
+ llvm_unreachable("GetMax32 unhandled case!");
}
- return 0;
}
//----------------------------------------------------------------------
@@ -139,21 +134,15 @@ uint64_t DNBDataRef::GetMax64(offset_t *offset_ptr, uint32_t size) const {
switch (size) {
case 1:
return Get8(offset_ptr);
- break;
case 2:
return Get16(offset_ptr);
- break;
case 4:
return Get32(offset_ptr);
- break;
case 8:
return Get64(offset_ptr);
- break;
default:
- assert(!"GetMax64 unhandled case!");
- break;
+ llvm_unreachable("GetMax64 unhandled case!");
}
- return 0;
}
//----------------------------------------------------------------------
diff --git a/lldb/tools/driver/Platform.cpp b/lldb/tools/driver/Platform.cpp
index 1a58d4de03e..a9d1bee5ccf 100644
--- a/lldb/tools/driver/Platform.cpp
+++ b/lldb/tools/driver/Platform.cpp
@@ -34,9 +34,8 @@ int ioctl(int d, int request, ...) {
return 0;
} break;
default:
- assert(!"Not implemented!");
+ llvm_unreachable("Not implemented!");
}
- return -1;
}
int kill(pid_t pid, int sig) {
@@ -44,13 +43,11 @@ int kill(pid_t pid, int sig) {
if (pid == getpid())
exit(sig);
//
- assert(!"Not implemented!");
- return -1;
+ llvm_unreachable("Not implemented!");
}
int tcsetattr(int fd, int optional_actions, const struct termios *termios_p) {
- assert(!"Not implemented!");
- return -1;
+ llvm_unreachable("Not implemented!");
}
int tcgetattr(int fildes, struct termios *termios_p) {
diff --git a/lldb/tools/lldb-perf/lib/Results.cpp b/lldb/tools/lldb-perf/lib/Results.cpp
index 17a022f2ea1..a4cdce525e2 100644
--- a/lldb/tools/lldb-perf/lib/Results.cpp
+++ b/lldb/tools/lldb-perf/lib/Results.cpp
@@ -76,8 +76,7 @@ static void AddResultToArray(CFCMutableArray &parent_array,
} break;
default:
- assert(!"unhandled result");
- break;
+ llvm_unreachable("unhandled result");
}
}
@@ -125,8 +124,7 @@ static void AddResultToDictionary(CFCMutableDictionary &parent_dict,
result->GetAsUnsigned()->GetValue(), true);
} break;
default:
- assert(!"unhandled result");
- break;
+ llvm_unreachable("unhandled result");
}
}
void Results::Write(const char *out_path) {
OpenPOWER on IntegriCloud