diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 05cc4ef367e7..61c270fa2fa3 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -2843,7 +2843,7 @@ bool SymbolFileDWARF::DIEDeclContextsMatch(const DWARFDIE &die1, if (decl_ctx_die1.Tag() != decl_ctx_die2.Tag()) return false; } -#if defined LLDB_CONFIGURATION_DEBUG +#ifndef NDEBUG // Make sure the top item in the decl context die array is always // DW_TAG_compile_unit or DW_TAG_partial_unit. If it isn't then diff --git a/lldb/source/Symbol/CompilerType.cpp b/lldb/source/Symbol/CompilerType.cpp index 80b5583cb837..289003ac0da3 100644 --- a/lldb/source/Symbol/CompilerType.cpp +++ b/lldb/source/Symbol/CompilerType.cpp @@ -35,10 +35,8 @@ CompilerType::CompilerType(TypeSystem *type_system, CompilerType::CompilerType(clang::ASTContext *ast, clang::QualType qual_type) : m_type(qual_type.getAsOpaquePtr()), m_type_system(ClangASTContext::GetASTContext(ast)) { -#ifdef LLDB_CONFIGURATION_DEBUG if (m_type) assert(m_type_system != nullptr); -#endif } CompilerType::~CompilerType() {} diff --git a/lldb/source/Symbol/DWARFCallFrameInfo.cpp b/lldb/source/Symbol/DWARFCallFrameInfo.cpp index b85d806bef8e..cc9f791dfde6 100644 --- a/lldb/source/Symbol/DWARFCallFrameInfo.cpp +++ b/lldb/source/Symbol/DWARFCallFrameInfo.cpp @@ -40,9 +40,7 @@ GetGNUEHPointer(const DataExtractor &DE, offset_t *offset_ptr, uint64_t baseAddress = 0; uint64_t addressValue = 0; const uint32_t addr_size = DE.GetAddressByteSize(); -#ifdef LLDB_CONFIGURATION_DEBUG assert(addr_size == 4 || addr_size == 8); -#endif bool signExtendValue = false; // Decode the base part or adjust our offset diff --git a/lldb/source/Symbol/LineTable.cpp b/lldb/source/Symbol/LineTable.cpp index 7f95b0584fc0..bdd8be927d2b 100644 --- a/lldb/source/Symbol/LineTable.cpp +++ b/lldb/source/Symbol/LineTable.cpp @@ -125,7 +125,7 @@ void LineTable::InsertSequence(LineSequence *sequence) { pos++; } -#ifdef LLDB_CONFIGURATION_DEBUG +#ifndef NDEBUG // If we aren't inserting at the beginning, the previous entry should // terminate a sequence. if (pos != begin_pos) { diff --git a/lldb/source/Utility/DataExtractor.cpp b/lldb/source/Utility/DataExtractor.cpp index 161a7a165999..bc1af6508307 100644 --- a/lldb/source/Utility/DataExtractor.cpp +++ b/lldb/source/Utility/DataExtractor.cpp @@ -136,9 +136,7 @@ DataExtractor::DataExtractor(const void *data, offset_t length, length), m_byte_order(endian), m_addr_size(addr_size), m_data_sp(), m_target_byte_size(target_byte_size) { -#ifdef LLDB_CONFIGURATION_DEBUG assert(addr_size == 4 || addr_size == 8); -#endif } //---------------------------------------------------------------------- @@ -153,9 +151,7 @@ DataExtractor::DataExtractor(const DataBufferSP &data_sp, ByteOrder endian, : m_start(nullptr), m_end(nullptr), m_byte_order(endian), m_addr_size(addr_size), m_data_sp(), m_target_byte_size(target_byte_size) { -#ifdef LLDB_CONFIGURATION_DEBUG assert(addr_size == 4 || addr_size == 8); -#endif SetData(data_sp); } @@ -171,9 +167,7 @@ DataExtractor::DataExtractor(const DataExtractor &data, offset_t offset, : m_start(nullptr), m_end(nullptr), m_byte_order(data.m_byte_order), m_addr_size(data.m_addr_size), m_data_sp(), m_target_byte_size(target_byte_size) { -#ifdef LLDB_CONFIGURATION_DEBUG assert(m_addr_size == 4 || m_addr_size == 8); -#endif if (data.ValidOffset(offset)) { offset_t bytes_available = data.GetByteSize() - offset; if (length > bytes_available) @@ -186,9 +180,7 @@ DataExtractor::DataExtractor(const DataExtractor &rhs) : m_start(rhs.m_start), m_end(rhs.m_end), m_byte_order(rhs.m_byte_order), m_addr_size(rhs.m_addr_size), m_data_sp(rhs.m_data_sp), m_target_byte_size(rhs.m_target_byte_size) { -#ifdef LLDB_CONFIGURATION_DEBUG assert(m_addr_size == 4 || m_addr_size == 8); -#endif } //---------------------------------------------------------------------- @@ -276,9 +268,7 @@ lldb::offset_t DataExtractor::SetData(const DataExtractor &data, offset_t data_offset, offset_t data_length) { m_addr_size = data.m_addr_size; -#ifdef LLDB_CONFIGURATION_DEBUG assert(m_addr_size == 4 || m_addr_size == 8); -#endif // If "data" contains shared pointer to data, then we can use that if (data.m_data_sp) { m_byte_order = data.m_byte_order; @@ -706,16 +696,12 @@ long double DataExtractor::GetLongDouble(offset_t *offset_ptr) const { // RETURNS the address that was extracted, or zero on failure. //------------------------------------------------------------------ uint64_t DataExtractor::GetAddress(offset_t *offset_ptr) const { -#ifdef LLDB_CONFIGURATION_DEBUG assert(m_addr_size == 4 || m_addr_size == 8); -#endif return GetMaxU64(offset_ptr, m_addr_size); } uint64_t DataExtractor::GetAddress_unchecked(offset_t *offset_ptr) const { -#ifdef LLDB_CONFIGURATION_DEBUG assert(m_addr_size == 4 || m_addr_size == 8); -#endif return GetMaxU64_unchecked(offset_ptr, m_addr_size); } @@ -728,9 +714,7 @@ uint64_t DataExtractor::GetAddress_unchecked(offset_t *offset_ptr) const { // RETURNS the pointer that was extracted, or zero on failure. //------------------------------------------------------------------ uint64_t DataExtractor::GetPointer(offset_t *offset_ptr) const { -#ifdef LLDB_CONFIGURATION_DEBUG assert(m_addr_size == 4 || m_addr_size == 8); -#endif return GetMaxU64(offset_ptr, m_addr_size); }