[LLDB][NFC] Move some constructors to their cpp file

CompilerType constructors rely on the NDEBUG macro, so it's better to move them to their cpp file so that the header doesn't get confused when this macro is used differently for other compilation units.
This commit is contained in:
walter erquinigo
2023-10-17 18:50:17 -04:00
parent 170b552136
commit 7d1bf1c5cf
2 changed files with 15 additions and 8 deletions

View File

@@ -42,10 +42,7 @@ public:
///
/// \see lldb_private::TypeSystemClang::GetType(clang::QualType)
CompilerType(lldb::TypeSystemWP type_system,
lldb::opaque_compiler_type_t type)
: m_type_system(type_system), m_type(type) {
assert(Verify() && "verification failed");
}
lldb::opaque_compiler_type_t type);
/// This is a minimal wrapper of a TypeSystem shared pointer as
/// returned by CompilerType which conventien dyn_cast support.
@@ -88,10 +85,8 @@ public:
lldb::TypeSystemSP GetSharedPointer() const { return m_typesystem_sp; }
};
CompilerType(TypeSystemSPWrapper type_system, lldb::opaque_compiler_type_t type)
: m_type_system(type_system.GetSharedPointer()), m_type(type) {
assert(Verify() && "verification failed");
}
CompilerType(TypeSystemSPWrapper type_system,
lldb::opaque_compiler_type_t type);
CompilerType(const CompilerType &rhs)
: m_type_system(rhs.m_type_system), m_type(rhs.m_type) {}

View File

@@ -951,6 +951,18 @@ bool CompilerType::GetValueAsScalar(const lldb_private::DataExtractor &data,
return false;
}
CompilerType::CompilerType(CompilerType::TypeSystemSPWrapper type_system,
lldb::opaque_compiler_type_t type)
: m_type_system(type_system.GetSharedPointer()), m_type(type) {
assert(Verify() && "verification failed");
}
CompilerType::CompilerType(lldb::TypeSystemWP type_system,
lldb::opaque_compiler_type_t type)
: m_type_system(type_system), m_type(type) {
assert(Verify() && "verification failed");
}
#ifndef NDEBUG
bool CompilerType::Verify() const {
if (!IsValid())