Promote more debug-only assertions to regular assertions.

llvm-svn: 355569
This commit is contained in:
Adrian Prantl 2019-03-07 00:14:20 +00:00
parent 1dfba3cfba
commit 28f7466f4e
5 changed files with 2 additions and 22 deletions

View File

@ -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

View File

@ -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() {}

View File

@ -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

View File

@ -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) {

View File

@ -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);
}